Sun N1 System Manager 1.3 Discovery and Administration Guide

ProcedureTo Create and Test an Event Notification

Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. Type the following command:


    N1-ok> create notification notification topic topic
    type type destination destination
    

    The event notification is created and enabled. See create notification in Sun N1 System Manager 1.3 Command Line Reference Manual for details and valid topics.

  3. Type the following command:


    N1-ok> start notification notification test
    

    A test notification message is sent. See start notification in Sun N1 System Manager 1.3 Command Line Reference Manual for details.

    You can also create a notification that is triggered by a script. See To Create a Notification That is Triggered by a Script for details.


Example 6–21 Creating an Email Notification for Server Groups Being Created

This example shows how to create an event notification to be sent by email if a server group is created. Note that an SMTP email server must first be configured using the n1smconfig utility as described in Configuring the N1 System Manager in Sun N1 System Manager 1.3 Installation and Configuration Guide.

The event notification is called notif2. The recipient's email address is nobody@sun.com


N1-ok> create notification notif2 destination nobody@sun.com
Lifecycle.Logical.CreateGroup type email

The show notification command can be used to verify that the event notification has been created.


N1-ok> show notification
Name    Event Topic                         Destination       State
notif2  Lifecycle.Logical.CreateGroup       nobody@sun.com    enabled 

The event can be invoked by creating a false group, as a test.


N1-ok> create group test

An email should be sent if the notification was created successfully. Otherwise, the following error message is displayed:


Notification test failed.

Verify if the SMTP server is configured correctly and is reachable, and if the email address used in the notification rule is valid.



Example 6–22 Creating an SNMP Notification for Hardware Health Thresholds Being Exceeded

This example shows how to create an event notification to be sent by SNMP if a hardware health threshold is exceeded. The event notification is called notif3. The recipient SNMP address is sun.com


N1-ok> create notification notif3 destination sun.com
topic EReport.Physical.ThresholdExceeded type snmp

The topic, which is the type of event to trigger the notification, is Ereport.Physical.ThresholdExceeded

The show notification command can be used to verify that the event notification has been created.


N1-ok> show notification
Name    Event Topic                         Destination  State
notif3  EReport.Physical.ThresholdExceeded  sun.com      enabled

You can specify the event notification you want to see by using show notification command with the notification attribute value.


N1-ok> show notification notif3
Name    Event Topic                         Destination  State
notif3  EReport.Physical.ThresholdExceeded  sun.com      enabled


Example 6–23 Creating an Email Notification for Hardware State Changes

This example shows how to create an event notification to be sent by email if a server's hardware state changes. Hardware state changes include power state changes, such as a power supply failure. Note that an SMTP email server must first be configured using the n1smconfig utility as described in Configuring the N1 System Manager in Sun N1 System Manager 1.3 Installation and Configuration Guide.

The event notification is called notif44. The recipient's email address is nobody@sun.com


N1-ok> create notification notif44 destination nobody@sun.com
EReport.Physical.ThresholdExceeded type email

The show notification command can be used to verify that the event notification has been created.


N1-ok> show notification
Name    Event Topic                         Destination       State
notif44 EReport.Physical.ThresholdExceeded  nobody@sun.com    enabled 

Verify if the SMTP server is configured correctly and is reachable, and if the email address used in the notification rule is valid.