Sunday, June 12, 2011

Cisco's IOS Embedded Event Manager Example

Here's the lowdown-quick-n-dirty way to get an email notification sent to you via Cisco IOS Embedded Event Manager applet.
Basically, I've setup a couple variables that will be used by the "action" that gets triggered by a certain "event detector". In this scenario I've selected a syslog event.
There are many event detectors and actions that can be used in these scripts. See this Cisco document for reference. I thought you'd appreciate this quick easy example:

First set the variables:

router1# config term
router1(config)# event manager environment email_to someITguy@123.com
router1(config)# event manager environment email_from router1@.123.com
router1(config)# event manager environment email_server 1.2.3.4

Then configure your applet:

router1(config)# event manager applet SLA_1_down
router1(config-applet)# event syslog severity-notification pattern "state Up->Down"
router1(config-applet)# action 1 syslog msg "SLA 1 DOWN - Sending email to Support"
router1(config-applet)# action 2 mail server "$email_server" to "$email_to" from "$email_from" subject "SLA 1 state changed to DOWN" body "Check to see if Webserver is functional."
router1(config-applet)# end
router1# sh run | begin event manager
!
!
event manager environment email_to someITguy@123.com
event manager environment email_from router1@.123.com
event manager environment email_server 1.2.3.4
event manager applet SLA_1_down
 event syslog severity-notification pattern "state Up->Down"
 action 1 syslog msg "SLA 1 DOWN - Sending email to Support"
 action 2 mail server "$email_server" to "$email_to" from "$email_from" subject "SLA 1 state changed to DOWN" body "Check to see if Webserver is functional."
!
!
That should do it! So long as you have some sort of smtp relay allowed from your router's IP/subnet you will receive an email if the state of IP SLA 1 changes.

Please email this link to a friend. Thanks!

No comments:

Post a Comment