Juniper Trace Options
Published: 20th of February 2019
Overview
Trace options are similar to running a debug in other vendors.
Enable Tracing
When tracing is enabled the results are stored in a trace file in the /var/log/ directory or sent to a remote syslog server.
Remote logging is configured under the system > tracing configuration hierarchy.
The architecture of Junos allow for the enabling of trace options in production without severely impacting a devices operational stability.
Tracing can be enabled at various levels of the configuration hierarchy such as the protocols and interfaces levels.
protocols {
ospf {
traceoptions {
file FILE-NAME [OPTIONS].. ;
flag FLAG-TYPE ;
flag FLAG-TYPE detail ;
}
}
}
Important
In order to avoid unnecessary resource utilization disable tracing when debugging is complete.
Options
There are a number of option available when enabling tracing as outline below.
- file - Name of the trace file
- size - Maximum size of the file (default: 128KB)
- files - Number of files to archive (default: 10)
- no-stamp - Do not place timestamp at start of lines in file (default: Timestamp added)
- replace - Overwrite existing file (default: Append to file)
- readable - Allow any user to view file (default: False)
- no-world-readable - Only user who configured the file can view (default)
View Trace Files
The show log <FILENAME>
command is used to
view a tracefile.
The monitor start <FILENAME>
command starts
real-time monitoring of the file.
The monitor stop <FILENAME>
command stops
real-time monitoring of the file.
The ESC + q key combination starts/stops syslog output to the screen.
Cleanup Trace Files
The clear log <FILENAME>
command is used to
delete the contents of a trace file.
The file delete <FILENAME>
command is used
to delete a trace file.
Bibliography
Author Unknown (2012) JNCIA-Junos Study Guide-Part 1. Juniper Networks |