cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

289
Views
0
Helpful
8
Replies
Highlighted
Beginner

EEM Script to Alert on TFTP Backup Failure

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

Everyone's tags (4)
8 REPLIES 8
Hall of Fame Cisco Employee

Is this "%Error opening tftp:

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.

Beginner

In the EEM scripting guide

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

Hall of Fame Cisco Employee

This does not look like it

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.

Beginner

Hi Claire,

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.

Beginner

Hi Leonardo, 

Hi Leonardo, 

I dont see the message in a syslog server, I only see it in the terminal. 

Claire 

Beginner

Hi All, 

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 

Hall of Fame Cisco Employee

Post what you're currently

Post what you're currently doing with kron.

Beginner

Hi Claire,

Hi Claire,

I think you can use TCL script instead, by reading standard input.

Cheers.

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards