Chapter 26. event-handler
event-handler is a feature in Arista switches that allows bash scripts to be executed when certain system events occur. As of EOS version 4.9.3, the triggers are pretty limited, but I have a feeling that they will be expanded upon in the future.
Note
This chapter is written based on the feature set found in EOS version 4.9.3. Future versions may support additional features.
So what’s the benefit of such a feature? Let’s say that you’ve got a system that’s been spontaneously rebooting at odd times, and your executive management is too cheap to buy network management software. You could configure an event handler to email you (or the system guys, or whomever you’d like) any time the switch’s interface to that server goes down.
Description
Event-handler allows the creation of a trigger, and an action. The trigger in my server example would be the interface on the switch going up or down. The action would be the email being sent. Additionally, a delay can be set so that a configured amount of time must pass after the trigger before the action is taken.
Two types of triggers are allowed. They are:
- onBoot
Triggered when the system boots. Note that this trigger also activates when exiting from event-handler configuration mode.
- onIntf
Triggered on certain interface-specific events.
Note
I’ve been told that additional triggers likely to arrive soon include on-startup-config, which will be triggered any time the startup-config is written, and on-vm, which will be triggered any ...
Get Arista Warrior now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.