Remote monitoring using EEM?

Answered Question
Sep 10th, 2009

All,

Is it possible to create an applet that would monitor a remote ip address and then perform an action based on that reachability?

What I have is something like this:

RTRA->RTRB->RTRC->RTRD

I want to be able to monitor RTRC's reachability to RTRD, but I need to do it from RTRB. You can't see it above, but RTRA also connects to RTRD. If RTRB can't get to RTRD through RTRC, I want RTRB to apply a policy map in the direction of RTRA because traffic will get redirected. I'll also need RTRA to apply a policy map back in the direction of RTRB. Is this possible to do, or is there a better way of doing that?

I've got a script working that monitors the interface on RTRC, but RTRA would still need to know when RTRC can't get to RTRD somehow.

Thanks,

John

I have this problem too.
0 votes
Correct Answer by Joe Clarke about 7 years 3 months ago

I went ahead and coded an example Tcl policy to do what you want. It will run every 60 seconds, and poll the latest operational state of an IP SLA collector on a remote device. It requires a few environment variables. For example:

event manager environment check_ipsla_ip 10.1.1.1

event manager environment check_ipsla_comm public

event manager environment check_ipsla_index 117

event manager environment check_ipsla_cmds config t;interface fa0/0;ip policy route-map redirect

In this example, the device 10.1.1.1 will be polled with a community string of public. The IP SLA collector on the device is configured with index 117. The commands to be run are separated with semi-colons. More help is available in the script header.

Correct Answer by Joe Clarke about 7 years 3 months ago

The show event manager version command was not introduced until EEM 2.4 (e.g. 12.4(20)T). Before that, you just had to know. 12.4 mainline includes EEM 2.1. 12.4(2)T includes EEM 2.2, 12.4(11)T comes with EEM 2.3.

Correct Answer by Joe Clarke about 7 years 3 months ago

If you setup an IP SLA collector on RTRC that tested the required reachability to RTRD, then you could have an EEM applet policy on RTRB which used SNMP to poll the IP SLA Collector state on RTRC. If the collector went down, then you could have RTRB apply the necessary policy map.

However, RTRA wouldn't know about that unless it, too was watching the collector state on RTRC. If you actually wanted RTRB to connect to RTRA, that is possible using EEM, but only with Tcl. RTRA could easily run the same applet as RTRB, though.

The only requirements would be that RTRC supports IP SLA source operations, and that both RTRA and RTRB are IOS devices capable of supporting EEM 2.1 or higher.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (3 ratings)
Loading.
Correct Answer
Joe Clarke Thu, 09/10/2009 - 07:45

If you setup an IP SLA collector on RTRC that tested the required reachability to RTRD, then you could have an EEM applet policy on RTRB which used SNMP to poll the IP SLA Collector state on RTRC. If the collector went down, then you could have RTRB apply the necessary policy map.

However, RTRA wouldn't know about that unless it, too was watching the collector state on RTRC. If you actually wanted RTRB to connect to RTRA, that is possible using EEM, but only with Tcl. RTRA could easily run the same applet as RTRB, though.

The only requirements would be that RTRC supports IP SLA source operations, and that both RTRA and RTRB are IOS devices capable of supporting EEM 2.1 or higher.

Joe Clarke Thu, 09/10/2009 - 08:30

Grrr, it just dawned on me typing out the applet, that you will need something better than EEM 2.1 to do this. You'll actually need EEM 3.0 to do this with an applet since you need to poll the REMOTE router. With Tcl, this will be doable with your current version of code. I can code up an example if you want.

Correct Answer
Joe Clarke Thu, 09/10/2009 - 09:06

I went ahead and coded an example Tcl policy to do what you want. It will run every 60 seconds, and poll the latest operational state of an IP SLA collector on a remote device. It requires a few environment variables. For example:

event manager environment check_ipsla_ip 10.1.1.1

event manager environment check_ipsla_comm public

event manager environment check_ipsla_index 117

event manager environment check_ipsla_cmds config t;interface fa0/0;ip policy route-map redirect

In this example, the device 10.1.1.1 will be polled with a community string of public. The IP SLA collector on the device is configured with index 117. The commands to be run are separated with semi-colons. More help is available in the script header.

John Blakley Thu, 09/10/2009 - 08:35

Joe,

How can I tell what version of eem I'm running? These are on 3745s.

Thanks!

John

John Blakley Thu, 09/10/2009 - 08:51

The 3745s are running 12.4(25) Enterprise Svcs, and the 2800 (RTRB) is running 12.4(1a).

Joe Clarke Thu, 09/10/2009 - 08:06

Ugh. 12.4(1a). While all routers meet the EEM requirements, RTRB may see some bugs. As for IP SLA requirements, the routers must be running an image greater than IPBASE.

John Blakley Thu, 09/10/2009 - 08:55

I can update that router with no issues. Is there an easy way to tell what version eem is or is that by ios version? Is there a show command that can get me this information?

Correct Answer
Joe Clarke Thu, 09/10/2009 - 08:10

The show event manager version command was not introduced until EEM 2.4 (e.g. 12.4(20)T). Before that, you just had to know. 12.4 mainline includes EEM 2.1. 12.4(2)T includes EEM 2.2, 12.4(11)T comes with EEM 2.3.

Actions

This Discussion