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

show int status with EEM or any script

dako.viktor1
Level 1
Level 1

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

2 Accepted Solutions

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

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"

View solution in original post

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.

View solution in original post

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

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"

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. 

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.

Review Cisco Networking for a $25 gift card