I currently have an EEM script running that sends me the output of "show interface" every 24 hours (aka 86400 seconds) via the following:
event manager environment _mail_domain dzubin.com
event manager environment _mail_smtp emailserver
event manager environment _mail_rcpt [email protected]
event manager applet everyday
event timer watchdog time 86400 maxrun 9999999
action 1.0 info type routername
action 1.5 cli command "enable"
action 2.0 cli command "show int FastEthernet4"
action 3.0 mail server "$_mail_smtp" to "$_mail_rcpt" from "$_info_routername@$_mail_domain" subject "show interface FastEthernet4" body "$_cli_result"
It works great, but the timing gets all screwed up if the router is rebooted. I have NTP enabled on the router... is there any was to schedule the script to run at a certain time rather than just after 86400 seconds?
Sure, just convert the watchdog timer to a cron timer:
event timer cron cron-entry "0 0 * * *" maxrun 9999999
This will run the policy at midnight.