Configuring Event Policy (NSM Procedure)

Event policies can listen for specific events, create log files, invoke Junos OS commands, and invoke event scripts.

To configure an event policy in NSM:

  1. In the NSM navigation tree, select Device Manager > Devices.
  2. Click the Device Tree tab, and then double-click the device to select it.
  3. Click the Configuration tab. In the configuration tree, expand Event Options.
  4. Select Policy.
  5. Add or modify settings as specified in Table 212.
  6. Click one:
    • OK—Saves the changes.
    • Cancel—Cancels the modifications.

Table 212: Configure Event Policy Details

Task

Your Action

Define an event policy to be processed by the event process (eventd) process.

  1. Click Add new entry next to Policy.
  2. In the Name box, enter the policy name.
  3. In the Comment box, enter the comment for the policy.

Execute the policy only if the attributes of two events are correlated or if the attribute of one event matches a regular expression.

  1. Click Add new entry next to Attributes Match.
  2. In the From Event Attribute box, enter the first attribute to compare.
  3. From the Condition list, select the match condition for the attributes.
  4. In the To Event Attribute Value box, enter another attribute.
  5. In the Comment box, enter the comment for the attributes-match.

Create a list of events that trigger this policy. If one or more of the listed events occurs, the policy is executed.

  1. Click Add new entry next to Events.
  2. In the New events dialog box, enter the name of the event.

Define actions to take if an event occurs. For each policy, you can configure multiple actions.

  1. Click Then next to policy.
  2. In the comment box, enter the comment.
  3. Select the Ignore check box to define a policy that ignores particular events.
  4. Select the Raise Trap check box to define a policy that raises a Simple Network Management Protocol (SNMP) trap in response to an event.

Specify operational mode commands to be issued, the format of the command output, and a name and destination for the output file.

  1. Expand Then and select Event Script.
  2. Click Add new entry next to Event Script.
  3. In the Name box, enter the filename.
  4. In the comment box, enter the comment for the event script.
  5. From the Username list, select the user associated with an action in an event policy.
  6. In the Output Filename box, enter the filename to which to write command or script output for the specified commands or script.
  7. From the Output Format list, select the format for the output of the specified commands.

Include command-line arguments to the script for Junos OS op scripts and assign a location to which to upload command or script output for the specified policy.

  1. Expand event-script.
  2. Click Arguments next to event-script.
  3. Click Add new entry next to Arguments.
  4. In the Name box, enter the arguments to the script as name.
  5. In the comment box, enter the comment.
  6. In the Value box, enter the variables in the argument values to allow data from the triggering event to be automatically included in the argument.
  7. Click Destination next to event-script.
  8. From the Name list, select the location to which to upload command or script output for the specified policy.
  9. In the Comment box, enter the comment.
  10. From the Transfer Delay list, select the delay in seconds before transferring files.
  11. Expand Destinations and select Retry Count next to it.
  12. In the Comment box, enter the comment for the retry count.
  13. From the Retry list, select the number of retries.
  14. From the Retry Interval list, select the length of time to wait between retries.

Specify operational mode commands to be issued, the format of the command output, and a name and destination for the output file on receipt of an event.

  1. Expand Execute Commands.
  2. Click Commands.
  3. In the Name box, enter the command.
  4. Click Destination next to Execute Commands.
  5. See Configuring Destinations for File Archiving (NSM Procedure)

Specify a file to be uploaded to a destination on receipt of an event.

  1. Click Upload next to Event Script.
  2. In the Filename box, enter the name of the file to be uploaded.
  3. From the Destination list, select the name of a destination.
  4. From the User Name list, select the username.
  5. From the transfer relay list, select the delay before transferring files.

Create a list of events that must (or must not) occur within a specified time interval for the policy to be triggered.

  1. Click Add new entry next to Within.
  2. Expand Within.
  3. From the Name list, select the interval between events.
  4. Click Events next to within.
  5. Click Add new entry next to Events.
  6. In the New events dialog box, enter the events that trigger this policy.
  7. Expand Not.
  8. Click Events next to Not.
  9. In the New events dialog box, enter the events that trigger this policy.
  10. Click Trigger next to Not.
  11. In the Comment box, enter the comment.
  12. Select one of the following:
    1. until—if the policy is to be executed each time a matching event is received and stops being executed when the number of matching events received equals number.
    2. on—if the policy is executed when the number of matching events received equals number.
    3. after—if the policy is executed when the number of matching events received equals number + 1.
  13. From the Count list, select the number of times an event or set of events should occur within a specified time period.

Related Documentation