Description

This article explains the concept of events and attributes used in Junos event-options policies and how they are used to create event-based automation.

Solution

What are events:

Events are predefined system generated notification messages by various Junos processes (like interface status changes, BGP neighbor states, log messages, etc.)

 

What are attributes:

Each event has one or more attributes, such as interface name, peer IP, event message, severity, etc.  Attributes are used to further filter the event to match your policy.

 

Example:

In the below logs message,  SNMP_TRAP_LINK_DOWN: is an event and rest are attributes.

 

root@R1> show log messages | last 20 ...

Oct 10 17:48:59 R1 mib2d[1371]: SNMP_TRAP_LINK_DOWN: ifIndex 531, ifAdminStatus down(2), ifOperStatus down(2), ifName ge-0/3/1.0

 

Event: SNMP_TRAP_LINK_DOWN

 

Attributes: ifIndex 531, ifAdminStatus down(2), ifOperStatus down(2), ifName ge-0/3/1.0



Once we know the event from the log message, we can search for that event as below to be used in the configuration.

root@a04-35# set event-options policy Test events snmp?
Possible completions:
  <event>
  snmp_get_error1
  snmp_get_error2
  snmp_get_error3
  snmp_get_error4
  snmp_rtslib_failure
  snmp_trap_link_down
  snmp_trap_link_up
  snmp_trap_tracert_path_change
  snmp_trap_tracert_test_completed
  snmp_trap_tracert_test_failed

 

Once we know the event, we can further match on the attributes as listed below.

 

root@a04-35# ...y Test attributes-match snmp_trap_link_down.?
Possible completions:
  <from-event-attribute>  First attribute to compare
  snmp_trap_link_down.admin-status
  snmp_trap_link_down.interface-name
  snmp_trap_link_down.operational-status
  snmp_trap_link_down.snmp-interface-index

 

 

 

Modification History

v1