Various types of files are useful in diagnosing an event. These files include system log files, core files, and configuration files. When a routing platform 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:
- [edit event-options]
-
policy policy-name {
-
events [ events ];
-
-
then {
-
upload filename committed destination destination-name;
-
-
upload filename filename destination destination-name {
-
retry-countnumber retry-interval seconds;
-
transfer-delay seconds;
- }
- }
- }
When an event policy uploads files for analysis, the files are time-stamped to ensure the filenames are unique, as follows:
router-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:
router-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 router1, and this event policy is executed three times in 1 second, the files are named as follows:
router1_rpd-messages_20070623_132333
router1_rpd-messages_20070623_132333_001
router1_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:
user@host# set event-options policy policy-name events ?
Possible completions:
<event>
[Open a set of values
acct_accounting_ferror
acct_accounting_fopen_error
...
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 Referencing Nonstandard Events.
In addition, you can reference internally generated events, which are discussed in Generating Internal Events.
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, you can configure the following:
- upload filename /var/log/messages*;
To upload the committed configuration file, include the committed statement in the configuration:
- [edit event-options policy policy-name then]
-
upload filename committed destination destination-name;
In the destination statement, include the destination name that you configured at the [edit event-options destinations] hierarchy level. For more information, see Defining Destinations for File Archiving.