I have been playing with an EEM script for a month now and I am still unable to get it to work correctly. I was hoping someone might be able to give me a clue as to how I can make this work.
I have a lot of switches to manage, so I get them all to backup to tftp on a time schedule. This works fine, I can do this as an archive or kron policy.
However, I need to be alerted if the tftp backup fails, or i will spend half of my day checking if the switches actually backed up or failed.
I put in this configuration on the switch:
event manager environment _email_to [email omitted]
event manager environment _email_server [ip add omitted]
event manager environment _email_from [email omitted]
event manager environment _Failure_Message SYS-98-BACKUP-FAIL
event manager applet tftptest
event syslog pattern "%Error opening tftp:"
action 1.0 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "$_event_pub_time:BACKUP_FAIL" body "_Failure_Message"
action 2.0 syslog priority notifications msg "SYS-98-BACKUP-FAIL"
I already have an eem script to email me an alert for a config change so i know that the email and ip addresses are correct.
Can anyone help?
Is this "%Error opening tftp:" message an actual syslog message? Does it show in "show log"? You might consider changing your kron job to an EEM policy that can detect the error in line and send a notification if the job fails.
In the EEM scripting guide Cisco published on their site, it describes any log with a % at the beginning as a syslog. However I dont see this message on a syslog server. I might give that a try then, but do you know if the alert trigger if the failure is not a syslog?
Thanks for your help Joe
This does not look like it would be a syslog message. And unless it is, no, the EEM applet won't trigger. Not all messages that start with '%' are syslogs.
Can you elaborate on the issue?
Have you managed to enable "debug event manager" and run the applet manually before trying to connect to some dummy tftp server?
Do you see the message "%Error opening tftp:" in the log/syslog or only in the terminal?
Thanks for your messages, I really appreciate it.
Does anyone have any suggestions how I can amend my script to alert of a TFTP backup failure? Or is it just not possible?