NETCONF Tracing Operations Overview

Starting with Junos OS Release 12.2, you can configure tracing operations for the NETCONF XML management protocol. NETCONF tracing operations record NETCONF session data in a trace file. By default, NETCONF tracing operations are not enabled.

You configure NETCONF tracing operations at the [edit system services netconf traceoptions] hierarchy level.

[edit system services]netconf {traceoptions {file <filename> <files number> <match regular-expression> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;on-demand;}}

To enable NETCONF tracing operations and to trace all incoming and outgoing data from NETCONF sessions on that device, configure the flag all statement. You can restrict tracing to only incoming or outgoing NETCONF data by configuring the flag value as either incoming or outgoing, respectively. Additionally, to restrict the trace output to include only those lines that match a particular expression, configure the file match statement and define the regular expression against which the output is matched.

NETCONF tracing operations record NETCONF session data in the file /var/log/netconf . To specify a different trace file, configure the file statement and desired filename.

By default, when the trace file reaches 128 KB in size, it is renamed and compressed to filename.0.gz, then filename.1.gz, and so on, until there are 10 trace files. Then the oldest trace file (filename.9.gz) is overwritten. You can configure limits on the number and size of trace files by including the file files number and file size size statements. You can configure up to a maximum of 1000 files. Specify the file size in bytes or use sizek to specify KB, sizem to specify MB, or sizeg to specify GB. You cannot configure the maximum number of trace files and the maximum trace file size independently. If one option is configured, the other option must also be configured along with a filename.

To control the tracing operation from within a NETCONF session, configure the on-demand statement. This requires that you start and stop tracing operations from within the NETCONF session. If you configure the on-demand statement, you must issue the <rpc><request-netconf-trace><start/></request-netconf-trace></rpc> RPC in the NETCONF session to start tracing operations for that session. To stop tracing for that NETCONF session, issue the <rpc><request-netconf-trace><stop/></request-netconf-trace></rpc> RPC.

By default, access to the NETCONF trace file is restricted to the owner. You can manually configure access by including either the world-readable or no-world-readable statement. The no-world-readable statement restricts trace file access to the owner. This is the default. The world-readable statement enables unrestricted access to the trace file.

Related Documentation