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 22.214.171.124 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"