Cisco Support Community
Community Member

EEM script to find a pattern and send an alert of some sort

Hello folks, can someone suggest why the script below is not returning anything?
My goal is to execute 'show hsrp detail', if HSRP output contains pattern indicated below, I should be able to generate an alert somehow.

Please let me know what I am missing.


event manager applet HSRP

  event syslog pattern "Standby router is unknown"

  action 1.0 cli show hsrp detail

  action 2.0 syslog msg HSRP ISSUE  

  action 3.0 cli end


This is the output I want to find pattern from:

SWITCHTEST# show hsrp detail
Ethernet2/1 - Group 101 (HSRP-V2) (IPv4)
  Local state is Initial(Interface Down), priority 90 (Cfged 90), may preempt
    Forwarding threshold(for vPC), lower: 1 upper: 90
  Hellotime 3 sec, holdtime 10 sec
  Virtual IP address is (Cfged)
  Active router is unknown
  Standby router is unknown
  Authentication text "cisco"
  Virtual mac address is 0000.0c9f.f065 (Default MAC)
  6 state changes, last state change 04:18:02
  IP redundancy name is hsrp-Eth2/1-101 (default)


Cisco Employee

What you want to do is not

What you want to do is not possible on NX-OS yet.  While you can get the syslog message "HSRP ISSUE" the output of the command will not display.  You could store it on flash by redirecting the output to a local file, but it will not appear in the syslog message.

CreatePlease to create content