11-22-2013 04:14 PM
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,
11-22-2013 08:15 PM
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,
11-25-2013 09:22 AM
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,
11-25-2013 12:37 PM
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
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