Configuring an Event Policy to Upload Files
Various types of files are useful in diagnosing an event. These files include system log files, core files, and configuration files. When an event occurs, you can upload relevant files to a specified location for analysis.
To configure a policy that uploads files, include the following statements at the [edit event-options] hierarchy level:
When an event policy uploads files for analysis, the files are named and time-stamped in the following format to ensure unique filenames:
device-name_filename_YYYYMMDD_HHMMSS
If a policy uploads multiple files within a 1-second period, the software gives each file a unique number as well, as follows:
device-name_filename_YYYYMMDD_HHMMSS_number
The number can be from 001 through 999. For example, if you have an event policy with output filename rpd-messages on device1, and this event policy is executed three times in 1 second, the files are named as follows:
device1_rpd-messages_20070623_132333device1_rpd-messages_20070623_132333_001device1_rpd-messages_20070623_132333_002
In the events statement, you can list multiple events. If one or more of the listed events occurs, the upload action is executed. To view a partial list of the events that can be referenced in an event policy, issue the set event-options policy policy-name events ? configuration mode command:
Some of the system log messages that you can reference in an event policy are not listed in the output of the set event-options policy policy-name events ? command. For information about referencing these system log messages in your event policies, see Using Nonstandard System Log Messages to Trigger Event Policies.
In addition, you can reference internally generated events, which are discussed in Generating Internal Events to Trigger Event Policies.
If desired, you can include multiple upload statements, one for each type of file to be archived. In the filename statement, specify a file or multiple files to be uploaded. You can specify multiple files with one filename configuration statement (sometimes called filename globbing). For example, to upload all files that are located in the /var/log directory and that start with the messages string, include the following statement:
To upload the committed configuration file, include the upload filename committed destination destination-name statement at the [edit event-options policy policy-name then] hierarchy level:
For the destination statement, specify a destination name that you configured at the [edit event-options destinations] hierarchy level. For more information, see Defining Destinations for File Archiving by Event Policies.
Hide Navigation Pane
Show Navigation Pane
Download
SHA1