Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Trace Script Processing on Devices Running Junos OS Evolved

When you execute an interactive script, the script can generate output, including warnings and errors, in the CLI or RPC reply. When the system triggers non-interactive scripts, for example, when an event policy triggers an event script, the script does not direct output to the terminal. In either case, you might need more information about the execution of the script. Junos OS Evolved captures trace data for all applications by default. You can view the collected traces for additional script processing information, including the memory and CPU usage, script arguments, script execution, and warnings and errors.

Junos OS Evolved collects trace data from all applications on all nodes on the Routing Engine. Whereas Junos OS logs the trace data for each type of script in separate log files, Junos OS Evolved stores the trace data for all scripts in the same location. The trace log includes data for commit, event, op, and SNMP scripts; YANG action and translation scripts; and Juniper Extension Toolkit scripts.

How to Display Trace Data for Scripts

Junos OS Evolved stores the trace data from all nodes that is collected on the primary Routing Engine under the /var/log/traces directory. The cscript application handles scripts, and the trace data for scripts is stored under the node.cscript.sequence-number subdirectories.

To view trace data for scripts, issue the show trace application cscript operational mode command.

You can include the terse option to display just the timestamp and message.

You can also refine the traces to display by specifying the trace time elapsed, process ID, and node. For example, the following command shows trace data for a specific process ID.

How to Modify Trace Settings for Scripts

Junos OS Evolved traces script processing by default and traces all applications at the info level for informational messages. You can configure trace settings for specific applications at the [edit system application] hierarchy level. For example, you can specify the trace level of the application on a given node.

To modify script tracing operations, configure the settings under the [edit system trace application cscript] hierarchy level. The following example configures the cscript application to trace script processing on node re0 at the debug level:

For more information about configuring trace settings, see trace.