Embedded Event Manager (EEM) is a powerful tool which monitor events and take informational, corrective, or any desired action when the monitored events occur. Capturing the state of the router during such situations can be invaluable in taking immediate recovery actions and gathering information to perform root-cause analysis.
Understanding of OSPF Routing Protocol
This document shows how to collect information from Router when there is an OSPF flap and the message seen is "Neighbor Down: dead timer expired". This means that the Router did not receive OSPF hello from the neighbor for the dead interface (120) seconds and then dropped the OSPF neighborship.
%OSPF-5-ADJCHG: Process 10, Nbr 18.104.22.168 on GigabitEthernet0/1 from FULL to DOWN, Neighbor Down: Dead timer expired
To troubleshoot this situation an EEM is configured to check for an OSPF-neighbor-down syslog message; when it occurs, it executes the following command and saves the output as a text file "GET_CLI_OUTPUT.txt" in the flash memory.
This script will collect CPU, memory, interfaces and OSPF outputs and will also run a unicast ping to the neighbor as well as multicast check with neighbor. The script is configured in the config mode.
Logging buffered 80000
event manager scheduler applet thread class default number 1
event manager applet OSPF-FLAP
event syslog pattern "FULL to DOWN, Neighbor Down: Dead timer expired"
action 2.0 cli command "enable"
action 3.0 cli command "sh proc cpu sorted | append flash:GET_CLI_OUTPUT.txt"
action 3.5 cli command "show interface | append flash:GET_CLI_OUTPUT.txt"
action 3.10 cli command "show proc memory | append flash:GET_CLI_OUTPUT.txt"
action 3.15 cli command "sh ip ospf nei | append flash:GET_CLI_OUTPUT.txt"
action 3.20 cli command "sh ip ospf int br | append flash:GET_CLI_OUTPUT.txt"
action 3.25 cli command "ping 22.214.171.124 rep 10 time 1"
action 3.25 cli command "ping 126.96.36.199 rep 10 time 1"
action 3.30 cli command "ping 10.10.12.2 rep 10 time 1"
action 5.0 syslog msg "$_cli_result" priority 5
Note: To display the content of a file in a compact Flash memory card, use the more flash: command.
Router# more flash: GET_CLI_OUTPUT.txt
1. Append command was integrated in CISCO IOS Release 12.2T
2. In case AAA is configured, user would require a Username/Password for CLI access.
- dir flash:
- more flash:GET_CLI_OUTPUT.txt