cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2544
Views
0
Helpful
5
Replies

Make a script to test int bri0/0/0:1 state (up or down) every xx minutes

dfrenay_olabs
Level 1
Level 1

Hi,

I've a problem on a isdn line (in theory up all the time) and i want to test with track and event manager the state of the int bri0/0/0:1 every ten minutes and

if is down (not test state change up <=> down but only state down) make a task (reboot router or other). How test if the interface is down with track and event manager every xx minutes ? It's easy to test up => down or down => up but if no state change, i don't understand how to make that ?

thank you for you help.

5 Replies 5

Joe Clarke
Cisco Employee
Cisco Employee

You could poll the SNMP ifOperStatus object for this interface will a poll-interval of 600.  To do this, you would need to obtain the ifIndex of the BRI0/0/0:1 interface.  Test the ifOperStatus value against 2.  If ifOperStatus equals 2, then the interface is down and you can reload the router or do whatever else you'd like.

Ok.

The Ifindex'value of int bri0/0/0:1 is 2 and ifindex'oid is 1.3.6.1.2.1.2.2.1.1 and Ifoperstatus'oid is 1.3.6.1.2.1.2.2.1.8 but what

is the relationship between this three values with the command event snmp oid....

thank you for your help...

Hey,

With the info from Joseph and you Davide i did try on router with this EEM :

event manager applet Monitor_Interface_Bri0/0/0:1_DOWN

event snmp oid 1.3.6.1.2.1.2.2.1.8.2 get-type exact entry-op eq entry-val 2 entry-type increment poll-interval 600

action 1.0 reload

or

event manager applet Monitor_Interface_Bri0/0/0:1_DOWN

event snmp oid 1.3.6.1.2.1.2.2.1.8.2 get-type exact entry-op eq entry-val 2 entry-type increment poll-interval 600

action 1.0 cli command " enable "

action 1.1 cli command " conf t "

action 1.2 cli command " interface Bri0/0/0:1 "

action 1.3 cli command " shutdown "

action 1.4 cli command " no  shutdown "

action 1.5 cli command " exit "

action 1.6 cli command " exit "

The first one is going to restart the router and the second one is going to put the interface in shutdown state, after is going to get the interface UP from shutdown.

Hope this is going to help you.

Thank you,

Bogdan

Yep, both are fine.

Thank you for you help ! it run.  (number 27 replace number 2 for ifindex bri0/0/0:1)

Currently :

event manager applet Monitor_Interface_Bri0/0/0:1_DOWN

event snmp oid 1.3.6.1.2.1.2.2.1.8.27 get-type exact entry-op eq entry-val "2" entry-type increment poll-interval 660

action 1.0 syslog msg "applet monitor interface bri : state down => reboot router"

action 2.0 cli command "show clock | append flash0:intbridown"

action 3.0 cli command "show int bri0/0/0:1 | append flash0:intbridown"

action 4.0 cli command "show controllers bri0/0/0 | append flash0:intbridown"

action 5.0 reload