Supported Platforms
Capturing and Using Event Details and Remote Execution Details in Event Scripts
When an event script is triggered by an event policy, the initiating event policy forwards a set of event details to the triggered event script. These event details can be captured, evaluated, and sent to log files as required. In addition, any configured remote execution details are also forwarded to the event script. The remote execution details allow the event script to invoke remote procedure calls as detailed in Using RPCs and Operational Mode Commands in Event Scripts.
Two types of event details are returned: triggered events and received events. Triggered events record the details of the event that triggered the policy. Received events record the details of events that happened before the triggering event. Event details and remote execution details are forwarded to the event script as XML in the following format:
<event-script-input>
<junos-context>
...
</junos-context>
<trigger-event>
<id>event-id</id>
<type>event-type</type>
<generation-time>timestamp</generation-time>
<process>
<name>process-name</name>
<pid>pid</pid>
</process>
<hostname>hostname</hostname>
<facility>facility-string</facility>
<severity>severity-string</severity>
<attribute-list>
<attribute>
<name>attribute-name</name>
<value>attribute-value</value>
</attribute>
</attribute-list>
</trigger-event>
<received-events>
<received-event>
<id>event-id</id>
<type>event-type</type>
<generation-time>timestamp</generation-time>
<process>
<name>process-name</name>
<pid>pid</pid>
</process>
<hostname>hostname</hostname>
<facility>facility-string</facility>
<severity>severity-string</severity>
<attribute-list>
<attribute>
<name>attribute-name</name>
<<value>attribute-value</value>
</attribute>
</attribute-list>
</received-event>
</received-events>
<remote-execution-details>
<remote-execution-detail>
<remote-hostname>hostname</remote-hostname>
<username>username</username>
<passphrase>passphrase</passphrase>
</remote-execution-detail>
</remote-execution-details>
</event-script-input>
For information about the <junos-context> element, see Junos Script Automation: Global Parameters and Variables in the junos.xsl File.
For information about one method for using event details, see Example: Limiting Event Script Output Based on a Specific Event Type.