01-26-2017 04:00 AM
Good morning,
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?
Thanks
Claire
01-26-2017 08:47 AM
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.
01-26-2017 09:03 AM
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
01-26-2017 09:31 AM
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.
01-26-2017 09:21 AM
Hi Claire,
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?
Cheers.
01-27-2017 02:13 AM
Hi Leonardo,
I dont see the message in a syslog server, I only see it in the terminal.
Claire
01-27-2017 02:15 AM
Hi All,
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?
Thanks
Claire
01-27-2017 07:40 AM
Post what you're currently doing with kron.
02-14-2017 09:01 AM
Hi Claire,
I think you can use TCL script instead, by reading standard input.
Cheers.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide