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

EEM ping to file on flash for smtp - close but no cigar

jacob6000
Level 1
Level 1

I have this script here and it has went throgh many tiny variations.

event manager applet SMTP_EEM_TEST

event syslog pattern " %SYS-5-CONFIG_I: Configured from console"

action 1.0 cli command "ping x.x.xx. source FastEthernet 0/1"

action 1.1 cli command "more $_cli_result | append flash:smtptest"

action 1.2 cli command "more flash:smtptest"

action 1.3 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Testing SMTP through EEM script" body "$_cli_result"

Some of my variations kick of an email so that part is fine. The problem is that it never creates a file called smtptest on flash. Typically I get "

% Incomplete command" in the body of the email beacuse the file wasn't created on flash. Eventually,I will have two more commands to add to it but I  have to get this one working first.

Please tell me what I am doing wrong.

Thank you,

3 Replies 3

jacob6000
Level 1
Level 1

Ok. I jumped back on and did one  last search. I see that "more" only works on files. I just modifed it by taking out action 1.1 and action 1.2.

Thanks,

Can all my ping and show commands be put into an actual tcl script so that I can get one email with all the data at once to review? Is this supported? Is there a script liket his already out there?

Thank you,

If you build the applet with the commands you want, you can convert it to Tcl using http://www.marcuscom.com/convert_applet .  Then, take the _cli_result from each command output and append them together (between calls):

append output $_cli_result

Then at the end:

set fd [open "flash:cmd_output.txt" "w"]

puts $fd $output

close $fd

Review Cisco Networking for a $25 gift card