Sun N1 System Manager 1.3 Discovery and Administration Guide

ProcedureTo Create a Notification That is Triggered by a Script

You can create a notification rule for an event that triggers the execution of a Borne shell script on the management server. The Borne shell script must be executable by the root user.

The script should be written to direct its output (stdout/stderr) to a log file.

The fields of the event are passed into the script as environment variables:

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 destination destination topic topic
    type script
    

    The event notification is created and enabled. The destination must be a fully qualified path to a custom Bourne shell script used to manage the notification. The script must be executable by the root user. See create notification in Sun N1 System Manager 1.3 Command Line Reference Manual for details and valid topics.

    If the script is executed as a result of an event triggered internally by the N1 System Manager, the script is executed as root.

    If the script is executed as a result of an event triggered by a user, the script is executed by the user that triggered the event.

  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.