[ Contents] [ Prev] [ Next] [ Index] [ Report an Error]

Configuring Event Policies

To configure event policies:

  1. Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
  2. Perform the configuration tasks described in Table 86.
  3. If you are finished configuring the network, commit the configuration.

Table 86: Configuring Event Policies

Task

J-Web Configuration Editor

CLI Configuration Editor

Configuring Destination for Uploading Files for Analysis

Navigate to the Destinations level in the configuration hierarchy.

  1. In the J-Web interface, select Configuration>View and Edit>Edit Configuration.
  2. Next to Event options, click Configure or Edit.
  3. Next to Destinations, click Add new entry.

From the [edit] hierarchy level, enter

edit event-options destinations

Enter the destination name—for example, bsd2.

You can reference the destination in an event policy.

In the Destination name box, type bsd2.

Set the destination name, the archive site location, and the password for accessing the archive site:

set bsd2 archive-sites ftp://ftp.robot.net/event_analyze password eventadmin

Configure the archive site—for example, ftp://ftp.robot.net/event_analyze—where you want the output of commands executed by the event policy to be uploaded in a file for analysis, and the password—for example, eventadmin—for accessing the archive site.

Note: You can specify the archive site as a Hypertext Transfer Protocol (HTTP) URL, FTP URL, or secure copy (SCP)-style remote file specification. URLs of the type file:// are also supported.

Note: When you specify the archive site, do not add a slash (/) to the end of the URL. For example, do not specify the archive site as ftp://ftp.robot.net/event_analyze/.

  1. Next to Archive sites, click Add new entry.
  2. In the Url box, type ftp://ftp.robot.net/event_analyze.
  3. In the Password box, type eventadmin.
  4. Click OK.
Configuring Event Policy  

Navigate to the Policy level in the configuration hierarchy, and enter the policy name—for example, event1.

  1. On the main Configuration page next to Event options, click Configure or Edit.
  2. Next to Policy, click Add new entry.
  3. In the Policy name box, type event1.

From the [edit] hierarchy level, enter

edit event-options policy event1

Configure the event name—for example, SNMP_TRAP_LINK_DOWN.

The SNMP_TRAP_LINK_DOWN event occurs when an interface that is monitored by SNMP becomes unavailable.

  1. Next to Events, click Add new entry.
  2. In the Event box, type SNMP_TRAP_LINK_DOWN.
  3. Click OK.

Set the event name:

set events SNMP_TRAP_LINK_DOWN

Flag the event to initiate an SNMP trap when it generates a system log message.

  1. Next to Then, click Configure.
  2. Select the Raise trap checkbox.
  3. Click OK.

Enter

set then

set raise-trap

Define the action to be taken when the configured event occurs.

For example, configure the Services Router to do the following when the SNMP_TRAP_LINK_DOWN event occurs for the t1–3/0/0 interface:

  1. Execute the show interfaces t1–3/0/0 and show configuration interfaces t1–3/0/0 commands.
  2. Upload the output of the show commands in a text file named config.txt to a server named bsd2.

Note: Do not include spaces, the slash, or the percent sign (%) in the filename.

  1. Next to Attributes match, click Add new entry.
  2. In the Condition list, select matches.
  3. In the From event attribute box, type SNMP_TRAP_LINK_DOWN.interface-name.
  4. In the To event attribute value box, type t1–3/0/0.
  5. Click OK.
  6. Next to Then, click Configure.
  7. Next to Execute commands, click Configure.
  8. In the Destination box, type bsd2.
  9. In the Output filename box, type config.txt.
  10. From the Output format list, select text.
  11. Next to Commands, click Add new entry.
  12. In the Command box, type show interfaces t1–3/0/0.
  13. Click OK.
  14. Next to Commands, click Add new entry.
  15. In the Command box, type show configuration interfaces t1–3/0/0.
  16. Click OK.
  1. Set the condition to execute the event policy only when the SNMP_TRAP_LINK_DOWN event occurs for the t1–3/0/0 interface:

    set attributes-match SNMP_TRAP_LINK_DOWN.interface-name equals t1–3/0/0

  2. Enter

    edit then execute-commands

  3. Set the commands to be executed when the configured event occurs:

    set commands show interfaces t1–3/0/0

    set commands show configuration interfaces t1–3/0/0

  4. Set the name and format of the file in which the output of the executed commands is to be uploaded to a destination server:

    set output-filename config.txt output-format text

  5. Set the name of the server to which the file containing the command output is to be uploaded:

    set destination bsd2


[ Contents] [ Prev] [ Next] [ Index] [ Report an Error]