O'Reilly logo

JUNOS Automation Cookbook by Adam Chappell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works…

Steps 1, 2, and 3 jump straight in to defining custom logic that we want to run when the JUNOS event framework has determined that the criteria are met. So the SLAX script we create can assume straight away that a link has been flapping and jump straight into a decisive action. Step 1 defines the usual boilerplate that we need for event scripts, and step 2 creates an SLAX/XML template for the configuration snippet that we're going to commit if we need to disable an interface. Step 3 is where all of the logic is implemented and I'll walk you through it slowly.

Firstly, we use an XPath expression to extract the interface name attribute from the incoming event data. We do this using an XPath predicate, effectively saying, Give ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required