Thursday 26 July 2018

Advanced Event Management on Arista EOS

Advanced Event Management

  • Proactive tools include Event Manager and the Scheduler; which focus on automation.  Both tools enable scripted actions to take place in response to a pre-defined trigger.  
  • When leveraged alongside SYSDB and the wealth of Linux tools that can be run on an the EOS platform, the user is offered the capability to trigger actions on virtually any aspect of system state, all without the requirement for real time user input !

Event Manager:

  • Event Manager provides a platform to enable automation of actions in response to pre-defined event triggers.  
  • It allows the creation of an event, the definition of under which circumstances the event should trigger and what action should occur in such a situation.
  • See the below link for complete details and configuration guide: https://eos.arista.com/introduction-to-managing-eos-devices-automation-and-extensibility/
  • Once an event has been triggered the configured action will be executed, this action will be initiated natively from the Linux bash shell, which means the action is not limited by the EOS CLI syntax, but rather any function or action achievable natively in the Linux bash shell.  Typical examples of actions would be to call a file, call a script, execute a native bash command or even EOS CLI commands.
  • Call a bash script – action bash /mnt/flash/EmailOnLinkDown
  • Call a python script to run as a daemon – action bash daemonize /mnt/flash/IntfMonitor
  • Execute a single CLI command, which sends an IM to all Network admins – action bash FastCli -p15 -c ‘xmpp send NetworkAdmins command Interface Ethernet1 is down’
  • Execute a series of CLI commands, which bring down a particular interface – action bash FastCli -p15 -c $’conf\n interface ethernet2\n shut’

Email Client Configuration in EOS:

Scheduler:

  • While the Advance Event Manager enables actions based on complex triggers, the scheduler provides a similar functionality to repetitive time based triggers.
  • The major addition to the Scheduler is that it captures the standard output of an action to a gzipped file in flash, and enables the user to configure how many of these files they wish to keep at any one time.
  • To create a scheduled job, a user simply defines how often a task should run, how many log files it should store, and what the job should be.
  • Unlike Event-manager, this command is executed natively in EOS, however by prepending the ‘bash’ argument   we can execute bash commands and call scripts, for example ‘command bash /mnt/flash/ConfigBackup’.
  • By default EOS has a scheduled task configured to collect a show tech every 60 minutes and store up to 100 instances of the show tech, ensuring that following an issue we have both the pre and post issue data that we need to assist with analysis.

switch#show run all | grep schedule
schedule tech-support interval 60 max-log-files 100 command show tech-support


No comments:

Post a Comment