01-29-2016 01:43 AM
Hi,
I would like to query the interface status from some switch in every week automatically and send it to me via email. Could you please someone help me? Any idea how I can do it?
Thanks
Solved! Go to Solution.
02-01-2016 07:28 AM
This will do what you want.
event manager int-status
event timer cron cron-entry "0 0 * * 0"
action 1.0 cli command "enable"
action 2.0 cli command "show int status"
action 3.0 mail to user@company.com from user@company.com server 10.1.1.1 subject "Show int status" body "$_cli_result"
02-02-2016 06:37 AM
You need to use your company's SMTP server. You never need to specify a password for EEM. EEM assumes authentication. If you are using command authorization, then you will also need to add "event manager session user USERNAME" where USERNAME is a AAA user authorized to run all the EEM CLI commands.
This policy is configured to be a timer policy, so it cannot be run manually. You'd need to use the "none" event detector to do that.
02-01-2016 07:28 AM
This will do what you want.
event manager int-status
event timer cron cron-entry "0 0 * * 0"
action 1.0 cli command "enable"
action 2.0 cli command "show int status"
action 3.0 mail to user@company.com from user@company.com server 10.1.1.1 subject "Show int status" body "$_cli_result"
02-02-2016 02:10 AM
To the server have to write the company mail server ip or snmp server ip? The to and from mail address can be the same? We use TACACS so if the enable command run after i need to add the username and PW too?
When i try to run the event i get this
XXX-XX-XXX-swa-001a#event manager run int-status
EEM policy int-status not registered with event none Event Detector
Thank you very much for your help.
02-02-2016 06:37 AM
You need to use your company's SMTP server. You never need to specify a password for EEM. EEM assumes authentication. If you are using command authorization, then you will also need to add "event manager session user USERNAME" where USERNAME is a AAA user authorized to run all the EEM CLI commands.
This policy is configured to be a timer policy, so it cannot be run manually. You'd need to use the "none" event detector to do that.
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