cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1160
Views
0
Helpful
3
Replies

Error in EEM script mail

jlerest
Level 1
Level 1

Hi,

I'm trying to email an alert by eem script when a catalyst 6807 rises a syslog message for an environment alarm (ex: power down). I use the attached script but when i want to add the syslog message in body email (line 83) something is wrong and i can't fixed the error : catalyst try to execute the syslog message (see email).

Same error for a catalyst 4507 4506 Sup 6L-E 10GE IOS 15.2(1)E but the same script works for a catalyst 4506 Sup 6L-E 10GE IOS 15.0(2)SG.

Any ideas ?

 

Thanks

 

3 Replies 3

Ashok Kumar
Cisco Employee
Cisco Employee

Hi,

Try a rather simple EEM applet, below is the configuration 

 

event manager applet TEST
 event syslog pattern " SYS-1" maxrun 60

 action 1.0 cli command "show logg | i SYS-1"
 action 1.1 mail server "mail.example.com" to "example@cisco.com" from "example@cisco.com" subject "Usage_Alert" body "$_cli_result
 action 2.0 syslog msg "Mail_Sent"

 

#1. Select trigger event syslog pattern for all environmental syslog

#2.  $_cli_result - it temp. variable in which stores last cli result

Hi,

 

I found my mystake. In the script, I commented the command "enable" and thus show commands were not recognized by cli. The script has always worked well, "Invalid input" was the result of show command.

But I suspect a different behavior between versions 15.0 and 15.2 for running level of tcl script.

 

Thanks

jlerest
Level 1
Level 1

Hi,

 

I found my mystake. In the script, I commented the command "enable" and thus show commands were not recognized by cli. The script has always worked well, "Invalid input" was the result of show command. For ios 15.2, i need to gain enable level.

So I suspect a different behavior between versions 15.0 and 15.2 for running level of tcl script.