Trace RPM Operations
RPM tracing operations track all RPM operations and record them in a log file. The logged error descriptions provide detailed information to help you solve problems faster.
RPM Trace Operations Overview
In Junos OS, you enable tracing operations by configuring the traceoptions statement
at the specific hierarchy level you want to trace. Junos OS Evolved uses a different
tracing architecture. All running applications create trace information, with
multiple instances of the same application having their own trace information.
Therefore, in Junos OS Evolved, trace messages are logged, viewed, and configured by
application. As a result, Junos OS Evolved does not support the
traceoptions
statement at many of the hierarchy levels that
Junos OS supports.
In Junos OS Evolved, you do not view trace files directly, and you should never add,
edit, or remove trace files under the /var/log/traces directory
because this can corrupt the traces. Instead, you use the show trace
application application-name node
node-name
command to read and decode trace
messages stored in the trace files. All running applications on Junos OS Evolved
create trace information at the info
level by default.
In Junos OS, by default, no events are traced. You can change this default behavior
by using the traceoptions
statement. If you include the
traceoptions
statement at the [edit services
rpm]
hierarchy level, the default tracing behavior is the
following:
-
Important events are logged in a file called rmopd located in the /var/log directory.
-
When the log file reaches 128 kilobytes (KB), it is renamed rmopd.0, then rmopd.1, and so on, until there are three trace files. Then the oldest trace file (rmopd.2) is overwritten.
-
Log files can be accessed only by the user who configures the tracing operation.
RPM is governed by the rmopd
application. For Junos OS Evolved, to
configure traces for a severity other than info
for the
rmopd
application, include the application rmopd node
node-name level severity
statement at the [edit system trace] hierarchy level.
For general monitoring and troubleshooting of devices running Junos OS or Junos OS Evolved, we recommend using standard tools such as CLI show commands, system log messages, SNMP, and telemetry data. You should avoid using trace messages for general debugging purposes and long-term solutions because they are subject to change without notice.
Configure the Trace Operations
By default, for Junos OS, if the traceoptions
configuration is
present, only important events are logged. You can configure the trace
operations to be logged by including the following statements at the
[edit services rpm traceoptions]
hierarchy level:
flag { all; configuration; error; ipc; ppm; rpd; statistics }
Table 1 describes the meaning of the RPM tracing flags.
Flag |
Description |
Default Setting |
---|---|---|
|
Trace all operations. |
Off |
|
Trace configuration events. |
Off |
|
Trace events related to catastrophic errors in daemon. |
Off |
|
Trace IPC events. |
Off |
|
Trace ppm events. |
Off |
|
Trace rpd events. |
Off |
|
Trace statistics. |
Off |
By default, for Junos OS Evolved, all running applications create trace
information at the info
level. To configure traces for a
severity other than info
for the rmopd
application, include the application rmopd node
node-name level severity
statement at the [edit system trace] hierarchy level. For information about the
various configurable severity levels for Junos OS Evolved, see trace.
See Also
Configure the RPM Log File Name
(Junos OS only) By default, the name of the file that records RPM trace output is rmopd. To specify a different file name:
[edit services rpm traceoptions] user@host set file filename
Configure the Number and Size of RPM Log Files
(Junos OS only) To configure the limits on the number and size of RPM trace files:
[edit services rpm traceoptions] user@host set file filename files number size size
The number of files can be from 2 through 1000 files. The file size of each file can be from 10 KB through 1 gigabyte (GB).
For example, set the maximum file size to 2 MB, and the maximum number of files to 20 for a log file named rpmtrace:
[edit services rpm traceoptions] user@host set file rpmtrace files 20 size 2MB
When the rpmtrace file reaches 2 MB, it is renamed rpmtrace.0, and a new file called rpmtrace is created. When the new rpmtrace reaches 2 MB, rpmtrace.0 is renamed rpmtrace.1 and rpmtrace is renamed rpmtrace.0. This process repeats until there are 20 trace files. Then the oldest file (rpmtrace.19) is overwritten by rpmtrace.18.
Configure Access to the Log File
(Junos OS only) By default, log files can be accessed only by the user who configures the tracing operation.
To specify that any user can read all log files:
[edit services rpm traceoptions] user@host set file filename world-readable
To explicitly set the default behavior:
[edit services rpm traceoptions] user@host set file filename no-world-readable
Configure a Regular Expression for Lines to Be Logged
(Junos OS only) By default, the trace operation output includes all lines relevant to the logged events.
To refine the output by specifying a regular expression (regex) to be matched:
[edit services rpm traceoptions] user@host set file filename match regular-expression