Let’s see how to let our Cisco router to do some tasks automatically. This time we will use EEM (Embedded Events Manager).

EEM is an integrated Cisco IOS Software tool that allows system management from the device itself.

We can monitor events that occur on the device and then take corrective or informational actions. This allows us for example to diagnose why an EIGRP is down, and get information and take actions accordingly. Maybe the neighbor went down because high CPU usage, or another reason.

So let’s suppose we want to run

no shutdown

Each time an interface goes down. Maybe this is not a good example of usage but works, and for the purpose of this article, it’s enough.

We configure the following EEM applet:

event manager applet "Bring Up f0/0"
  event syslog pattern "Interface FastEthernet0/0.* down" period 1
  action 2.0 cli command "en"
  action 2.1 cli command "conf t"
  action 2.2 cli command "int f0/0"
  action 2.3 cli command "no shut"
  action 3.0 syslog msg "Interface F0/0 up by EEM"

So whenever the device log generates a message with the specified pattern, EEM will trigger the applet executing commands specified.