There's more

The most useful aspect of the event response op script above is the ability to bind attributes from events to arguments within an op script in order to take action. In the recipe, we used this behavior to communicate the name of the interface to the op script. However, there is an alternative method to using this channel of communication.

JUNOS also recognizes the notion of an event script, which is a SLAX script that directly consumes the XML content associated with an event and can act on the increased richness of information.

So instead of mapping attributes to arguments, we can write an event script that uses XPath expressions on an input document in order to analyze in detail the intricacies of events that occur on the JUNOS ...

Get JUNOS Automation Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.