Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

NETCONF and Junos XML Protocol Tracing Operations Overview

You can configure tracing operations for the NETCONF and Junos XML management protocols. NETCONF and Junos XML protocol tracing operations record NETCONF and Junos XML protocol session data, respectively, in a trace file. By default, NETCONF and Junos XML protocol tracing operations are not enabled.

Note:

Starting in Junos OS Release 16.1, when you enable tracing operations at the [edit system services netconf traceoptions] hierarchy, Junos OS enables tracing operations for both NETCONF and Junos XML protocol sessions and adds the [NETCONF] and [JUNOScript] tags to the log file entries to distinguish the type of session. Prior to Junos OS Release 16.1, only NETCONF session data was logged, and the [NETCONF] tag was omitted.

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

To enable NETCONF and Junos XML protocol tracing operations and to trace all incoming and outgoing data from NETCONF and Junos XML protocol sessions on that device, configure the flag all statement. As of Junos OS Release 16.1, a new option under the flag statement, debug, is introduced. This option enables debug-level tracing. However, we recommend using the flag all option. You can restrict tracing to only incoming or outgoing NETCONF or Junos XML protocol 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 and Junos XML protocol tracing operations record 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 or Junos XML protocol session, configure the on-demand statement. This requires that you start and stop tracing operations from within the session. If you configure the on-demand statement, you must issue the <rpc><request-netconf-trace><start/></request-netconf-trace></rpc> RPC in the session to start tracing operations for that session. To stop tracing for that session, issue the <rpc><request-netconf-trace><stop/></request-netconf-trace></rpc> RPC.

By default, access to the 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.

Change History Table

Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.

Release
Description
16.1
Starting in Junos OS Release 16.1, when you enable tracing operations at the [edit system services netconf traceoptions] hierarchy, Junos OS enables tracing operations for both NETCONF and Junos XML protocol sessions and adds the [NETCONF] and [JUNOScript] tags to the log file entries to distinguish the type of session.