Sun N1 System Manager 1.2 Administration Guide

Setting Up Event Notifications

The N1 System Manager provides the ability to set up email or SNMP event notifications when events occur, either within the N1 System Manager itself or when specific events occur on provisionable servers. You can set up customized event notification rules for as many different scenarios as you need. Setting up default notifications for events can be done using the n1smconfig utility at install time. See Configuring the N1 System Manager System in Sun N1 System Manager 1.2 Installation and Configuration Guide for more information about installing and configuring the N1 System Manager.

You can create additional event notifications at the command line. Use the create notification command to create event notification rules based on events that occur or might occur about which you are interested. Use a topic to create an event notification.

For setting up event notifications using SNMP traps, use the SNMP MIB located at /opt/sun/n1gc/etc/SUN-N1SM-TRAP-MIB.mib. For more information about SNMP MIBs, see Monitoring MIBs.

A notification rule can be used to send a notification of each type of event to a selected destination, using either email or SNMP as the communication medium. For example, you can create a notification rule so that each time a new provisionable server is discovered by the management server, you receive a message on your pager to indicate that the event has happened:


create notification notification destination destination topic topic 
type type [description description]

See create notification in Sun N1 System Manager 1.2 Command Line Reference Manual for details of the terms used in this command syntax.

You can configure your SMTP server to use event notification, during the installation and configuration of the N1 System Manager. See Configuring the N1 System Manager System in Sun N1 System Manager 1.2 Installation and Configuration Guide.

Viewing and Modifying Event Notifications

Use the show notification and set notification commands to view and modify event notification details. Type help show notification or help set notification at the N1–ok command line for syntax and parameter details.

ProcedureTo View Event Notifications

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> show notification all
    

    The event notifications for which you have read privileges appear in the output. See show notification in Sun N1 System Manager 1.2 Command Line Reference Manual for details.

ProcedureTo View Event Notification Details

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> show notification notification
    

    The specified event notification details appear in the output. See show notification in Sun N1 System Manager 1.2 Command Line Reference Manual for details.


Example 5–15 Viewing Event Notification Details

This example shows how to use the show notification command to display the details about a notification.


N1-ok> show notification notif33
Name:          notif33
Event Topic:   EReport.Physical.ThresholdExceeded
Notifier Type: Email
Destination:   nobody@sun.com
State:         enabled

ProcedureTo Modify an Event Notification

This procedure describes how to change the name, description, or destination of 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> set notification notification name name description description
     destination destination
    

    The specified event notification attributes are set to the new values specified. See set notification in Sun N1 System Manager 1.2 Command Line Reference Manual for details.


Example 5–16 Modifying an Event Notification Name

This example shows how to use the set notification command with the name option to change a notification name from notif22 to notif23.


N1-ok> set notification notif22 name notif23

Creating, Testing, and Deleting Event Notifications

Use the create notification or delete notification commands to create and delete event notifications.

Use the start notification command with the test keyword to test an even notification.

Type help create notification or help delete notification at the N1–ok command line for syntax and parameter details.

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.2 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.2 Command Line Reference Manual for details.


Example 5–17 Creating an Email Notification

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 System in Sun N1 System Manager 1.2 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  EReport.Physical.ThresholdExceeded  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. Otherwsie, 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 5–18 Creating an SNMP Notification

This example shows how to create an event notification to be sent by SNMP if a physical threshold value 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 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 notificationcommand with the notification attribute value.


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

ProcedureTo Delete 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> delete notification notification
    

    The event notification is deleted.

Starting and Stopping Event Notifications

Event notifications are enabled, or started, by default at creation. Use the start notification command to enable an event notification that has been disabled. Type help start notification at the N1–ok command line for syntax and parameter details.

ProcedureTo Start 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> start notification notification
    

    The event notification is enabled. See start notification in Sun N1 System Manager 1.2 Command Line Reference Manual for details.

ProcedureTo Stop 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> stop notification notification
    

    The event notification is disabled. See stop notification in Sun N1 System Manager 1.2 Command Line Reference Manual for details.