Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Automation Scripting User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Trace Event Policy Processing on Devices Running Junos OS Evolved

date_range 08-Apr-25

An event policy is automatically triggered upon receipt of certain events, and thus it does not direct output to the terminal. To get information about the execution of event policies, you can review the event policy trace data.

Junos OS Evolved captures trace data for all applications on all nodes by default and stores it on the Routing Engine. Event policy tracing tracks and logs all event policy operations. You can view the collected traces for information about the processing of event policies, including the executed policies, their trigger events, the corresponding event policy actions, and any additional operations, warnings, and errors. This is different from Junos OS where you must explicitly configure traceoptions to collect event policy trace data.

How to Display Trace Data for Event Policies

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 master-eventd application handles event policy, and the event policy trace data is stored under the node.master-eventd.sequence-number subdirectories.

To view the event policy trace data, issue the show trace application master-eventd operational mode command.

content_copy zoom_out_map
user@host> show trace application master-eventd
2021-06-16 13:09:47.320304999 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_33  msg = "policy should now be executed", policy = "backup_config"
2021-06-16 13:09:47.320324689 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_21  msg = "Executing Policy", policy = "backup_config"
2021-06-16 13:09:47.320348369 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_1  func_name = "eventd_policy_action_next"
2021-06-16 13:09:47.320365189 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_1  func_name = "eventd_policy_action_next"
2021-06-16 13:09:47.320372819 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_1  func_name = "eventd_policy_action_next"
2021-06-16 13:09:47.320438179 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_6  msg = "executing commands", PolicyName = "backup_config", evt_id = "UI_COMMIT_COMPLETED", cmd_file = "/tmp/evt_cmd_vfEgUQ", output_file = "/tmp/evt_op_gDnEpr"
2021-06-16 13:09:47.320464959 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_1  func_name = "eventd_substitute_variable_cmd"
2021-06-16 13:09:49.150642247 re0:master-eventd:10911:TRACE_INFO EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_38  msg = "Eventd Rcvd signal", signo = 17
2021-06-16 13:09:49.150656107 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_27  msg = "SIGCHLD received"
2021-06-16 13:09:49.150687637 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_28  msg = "SIGCHLD received", pid = 492
2021-06-16 13:09:49.150696647 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_29  msg = "Child terminated", pid = 492, status = "successfully"
2021-06-16 13:09:49.150716687 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_1  func_name = "eventd_policy_action_next"
2021-06-16 13:09:49.150735047 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_1  func_name = "eventd_upload_file"
2021-06-16 13:09:49.158191526 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_28  msg = "SIGCHLD received", pid = 0
2021-06-16 13:09:49.354883114 re0:master-eventd:10911:TRACE_INFO EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_38  msg = "Eventd Rcvd signal", signo = 17
2021-06-16 13:09:49.354901704 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_27  msg = "SIGCHLD received"
2021-06-16 13:09:49.354924204 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_28  msg = "SIGCHLD received", pid = 506
2021-06-16 13:09:49.354932034 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_29  msg = "Child terminated", pid = 506, status = "successfully"
2021-06-16 13:09:49.354944754 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_1  func_name = "eventd_policy_action_next"
2021-06-16 13:09:49.354989194 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_1  func_name = "eventd_policy_action_next"
2021-06-16 13:09:49.354998454 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_1  func_name = "eventd_policy_action_next"
2021-06-16 13:09:49.355005984 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_3  msg = "removing active policy", PolicyName = "backup_config"
2021-06-16 13:09:49.355115774 re0:master-eventd:10911:TRACE_ERR EVENTOPTIONS_TRACE_POLICY_P_EVENTOPTIONS_TRACE_POLICY_28  msg = "SIGCHLD received", pid = -1
...

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

content_copy zoom_out_map
user@host> show trace application master-eventd terse
2021-06-16 13:09:47.320304999 msg = "policy should now be executed", policy = "backup_config"
2021-06-16 13:09:47.320324689 msg = "Executing Policy", policy = "backup_config"
2021-06-16 13:09:47.320348369 func_name = "eventd_policy_action_next"
2021-06-16 13:09:47.320365189 func_name = "eventd_policy_action_next"
2021-06-16 13:09:47.320372819 func_name = "eventd_policy_action_next"
2021-06-16 13:09:47.320438179 msg = "executing commands", PolicyName = "backup_config", evt_id = "UI_COMMIT_COMPLETED", cmd_file = "/tmp/evt_cmd_vfEgUQ", output_file = "/tmp/evt_op_gDnEpr"
2021-06-16 13:09:47.320464959 func_name = "eventd_substitute_variable_cmd"
...

How to Modify Trace Settings for Event Policies

Junos OS Evolved traces event policy 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 event policy tracing operations, configure the settings under the [edit system trace application master-eventd] hierarchy level. The following example configures tracing for the master-eventd application at the notice level on node re0:

content_copy zoom_out_map
[edit]
user@host# set system trace application master-eventd node re0 level notice
user@host# commit

For more information about configuring trace settings, see trace.

footer-navigation