Configuring
Destination for Uploading Files for Analysis |
Navigate to the Destinations level in the
configuration hierarchy.
|
- In the J-Web interface, select Configuration>View
and Edit>Edit Configuration.
- Next to Event options, click Configure or Edit.
- 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/.
|
- Next to Archive sites, click Add new entry.
- In the Url box, type ftp://ftp.robot.net/event_analyze.
- In the Password box, type eventadmin.
- Click OK.
|
Configuring Event Policy | | |
Navigate to the Policy level in the configuration
hierarchy, and enter the policy name—for example, event1.
|
- On the main Configuration page next to Event
options, click Configure or Edit.
- Next to Policy, click Add new entry.
- 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.
|
- Next to Events, click Add new
entry.
- In the Event box, type SNMP_TRAP_LINK_DOWN.
- 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.
|
- Next to Then, click Configure.
- Select the Raise trap checkbox.
- 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:
- Execute the show interfaces t1–3/0/0 and show configuration interfaces t1–3/0/0 commands.
- 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.
|
- Next to Attributes match, click Add new entry.
- In the Condition list, select matches.
- In the From event attribute box, type SNMP_TRAP_LINK_DOWN.interface-name.
- In the To event attribute value box, type t1–3/0/0.
- Click OK.
- Next to Then, click Configure.
- Next to Execute commands, click Configure.
- In the Destination box, type bsd2.
- In the Output filename box, type config.txt.
- From the Output format list, select text.
- Next to Commands, click Add new
entry.
- In the Command box, type show interfaces t1–3/0/0.
- Click OK.
- Next to Commands, click Add new
entry.
- In the Command box, type show configuration
interfaces t1–3/0/0.
- Click OK.
|
- 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
- Enter
edit then execute-commands
- 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
- 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
- Set the name of the server to which the file containing
the command output is to be uploaded:
set destination bsd2
|