Custom responses to an event
In this recipe, we'll build on what we've learnt with the event policy framework in the previous two recipes, but we'll explore custom scripts that can fire when an event triggers. Specifically, we'll enhance the previous recipe so that, instead of just capturing the output to the show interface
command, we actually interpret the SNMP_TRAP_LINK_DOWN
event to extract the effected interface and then only execute the command for that interface.
Getting ready
In order to complete this recipe, you need access to a JUNOS device and a UNIX-like network management station running an OpenSSH (or equivalent) server. You should have configured your network management host with a suitable account profile so that the JUNOS device can access it. Steps 1 and 2 in the first recipe on archiving configurations can help you complete this step if necessary.
How to do it…
The steps for the recipe are as follows:
- Verify the configuration of the network management host to ensure that an...