Running Self-Diagnostics with Event Policies
To diagnose a fault or error condition on a routing platform, you need relevant information about the state of the platform. You can derive state information from event notifications. Event notifications are system log messages and Simple Network Management Protocol (SNMP) traps.
Timely diagnosis and intervention can correct error conditions and keep the routing platform in operation. Event policies allow you to automatically initiate self-diagnostic actions when specific events occur. These actions can either help you diagnose a fault or take corrective action.
This section contains the following topics:
Event Policy Overview
In response to events, event policies can execute the following actions:
- Ignore the event—Do not generate a system log message for this event and do not process any further policy instructions for this event.
- Raise a trap—Initiate an SNMP trap to notify SNMP trap-based applications when the event occurs.
- Upload a file—Upload a file to a specified destination. You can specify a transfer delay, so that, on receipt of an event, the upload process begins after the configured transfer delay. For example, a transfer delay can ensure that a core file has been completely generated before being uploaded.
- Execute CLI operational mode commands—Execute commands when an event occurs. The output of these commands is stored in a file, which is then uploaded to a specified URL.
- Execute operation scripts—Execute operation scripts when an event occurs. The output of the operation scripts is stored in a file, which is then uploaded to a specified URL. For information about operation scripts, see Automating Network Management and Troubleshooting with Operation Scripts.
To view a list of the events that can be referenced in an event policy, issue the help syslog ? command:
user@host> help syslog ?Possible completions: <syslog-tag> System log tag ACCT_ACCOUNTING_FERROR Error occurred during file processing ACCT_ACCOUNTING_FOPEN_ERROR Open operation failed on file ACCT_ACCOUNTING_SMALL_FILE_SIZE Maximum file size is smaller than record size ...
For information about these events, see the Junos System Log Messages Reference.
Configuring Event Policies
To configure event policies:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 49.
- If you are finished configuring the network, commit the configuration.
Table 49: 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. |
| 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/. |
| |
| Configuring Event Policy | ||
Navigate to the Policy level in the configuration hierarchy, and enter the policy name—for example, 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. |
| 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. |
| 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:
Note: Do not include spaces, the slash, or the percent sign (%) in the filename. |
|
|
Hide Navigation Pane
Show Navigation Pane
Download
SHA1