Chapter 6: Automating Network Operations and Troubleshooting

Table 45: Configuring Event Policies (continued)

Task

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

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/0interface:

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.

J-Web Configuration Editor

1.Next to Then, click Configure.

2.Select the Raise trap checkbox.

3.Click OK.

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.

CLI Configuration Editor

Enter

set then

set raise-trap

1.Set the condition to execute the event policy only when the

SNMP_TRAP_LINK_DOWN event occurs for the t1–3/0/0interface:

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

16.Click OK.

Running Self-Diagnostics with Event Policies 97

Page 119
Image 119
Juniper Networks J-Series Execute the show interfaces, Set then Set raise-trap, Set attributes-match, Set destination bsd2