Thursday, April 12, 2012

Cisco EEM script tracking WAN connection

This script will track WAN interface (ATM 0 in this case), if the status changed to down, it will collect some show result and save it to the nvram.

_______________________________________________________
track 1 interface ATM 0 line-protocol

event manager session cli username yourname

service internal

event manager applet MONITOR_INTERFACE

event track 1 state down

action 0.1 syslog msg "WAN interface down"

action 0.2 cli command "enable"

action 0.3 cli command "ter len 0"

action 0.4 cli command "show ip int brief | append nvram:MONITOR_INTERFACE.txt"

action 0.5 cli command "Show int atm 0 | append nvram:MONITOR_INTERFACE.txt"

action 0.6 cli command "show dsl interface atm 0 | append nvram:MONITOR_INTERFACE.txt"

action 0.7 cli command "show int summary | append nvram:MONITOR_INTERFACE.txt"

action 0.8 cli command "show log | append nvram:MONITOR_INTERFACE.txt"

action 0.9 syslog msg "Finished logging information to nvram:MONITOR_INTERFACE.txt..."

action 1.0 cli command "end"
____________________________________________________________

Reference: Monitor multiple interfaces with a single EEM applet
Working with the Embedded Event Manager (EEM)
EEM Script to reload router only once after tracked object is down.

No comments:

Post a Comment