Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

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

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,

  • EEM Scripting
3 REPLIES
New Member

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

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,

New Member

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

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,

Cisco Employee

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

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

890
Views
0
Helpful
3
Replies
This widget could not be displayed.