EEM Embedded Event Manager

EEM Embedded Event Manager Embedded Event Manager
prior to any kind of network management technology, such as SNMP, RMON, after detecting the incident does not solve the problem, these traditional network management technology only monitoring functions, but it does not solve the functional failure ,
in order to more effectively manage the network, capable of when an event occurs, then the use of effective action to prevent network problems, Cisco's network management technology to launch further -Embedded event Manager (EEM).

EEM In normal operation, the specified event can be monitored on a regular basis, when the monitored event occurs, EEM designated information may be generated or the specified action
EEM several components are the following:
1.EEM Server EEM main equivalent.
2.Core Event Publishers (Event Detectors) event detector
that is used for EEM component detects events, is responsible for detecting various defined events detected events can be based on other network management technology, Event Detectors will report to the Server when an event occurs .
3.Event Subscribers (Policies)
When Event Detector detects the occurrence of the specified event, Event Subscribers will perform the specified actions, specific action includes generating a message, or perform commands.
EEM Applet
When configuring the Applet, there are three kinds of configuration state: Event, Action, Set.
Event event criteria used to define, when the requirements specified threshold or trigger occurs, it indicates that the event is generated.
Action after action performed when the event occurs.
Set is a set of variables, currently only supports _exit_.
In EEM Applet configuration, ** a Policy strategy supports only one event, ** is a Policy can only detect an event, and there is no event, will have warning that if the Applet not registered successfully quit Policy configuration; but if no action, the event can still be detected, but no action after the incident, a Policy You can configure multiple action.
For example EEM
Write a Cisco IOS EEM applet named “BOUNCEGIG” that automates the above task.
User the " %SYS-5-RESTART: " syslog pattern in order to trigger the script when R3 has restarted.
Ensure that the script bounces interface Gig0/0 first then bounces interface Gig0/1.
Test router solution and ensure that there is an entry in the EEM events history similar to the following output.

Configuration command

event manager applet BOUNCEGIG
event syslog pattern "%SYS-5-RESTART:" 
 action 1.0 cli command "enable"
 action 2.0 cli command "conf t"
 action 3.0 cli command "int Gi0/0"
 action 4.0 cli command "shut" 
 action 5.0 cli command "no shut" 
 action 6.0 cli command "int Gi0/1"  
 action 7.0 cli command "shut" 
 action 8.0 cli command "no shut”
debug event manager action cli 查看事件执行过程

example-2 OSPF例子
Configure R3 with event manger applet “ENABLE_OSPF_DEBUG” when OSPF neighbor ship goes down with R5 , it should enable the Debug ip ospf events and Debug ip ospf adj
Configure another EEM applet “ DISABLE_OSPF_DEBUG” when OSPF neighbor ship comes up with R5. It should disable all the debug messages.
Make sure that each event generates a syslog message with a priority of 6 that shows the name of the event being activated.
These logs should be seen both in the console and in the log buffer.
You MUST be able to have these events run on R3 when R5 bounces it’s interface.
配置命令

event manager applet ENABLE_OSPF_DEBUG
 event syslog pattern ".*%OSPF-5-ADJCHG:.*Serial0/0/0.*FULL to DOWN.*"
 action 1.0 cli command "enable"
 action 2.0 cli command "debug ip ospf events"
 action 3.0 cli command "debug ip ospf adj"
 action 4.0 syslog priority informational msg "ENABLE_OSPF_DEBUG”
event manager applet DISABLE_OSPF_DEBUG
 event syslog pattern ".*%OSPF-5-ADJCHG:.*Serial0/0/0.*LOADING to FULL.*"
 action 1.0 cli command "enable"
 action 2.0 cli command "un all"
 action 3.0 syslog priority informational msg "DISABLE_OSPF_DEBUG"

example3
On R3 Configure an EEM applet name “Conf_Change” (without the quotes).
The EEM applet use show clock and append to flash:ConfSave.txt .
The EEM applet needs to activate every time someone makes changes to the config. Also, a syslog message has to be generated with the string “Configuration changed”
配置命令
event manager applet Conf_Change \创建EEM
event syslog pattern “%SYS-5-CONFIG_I” \设置按钮,触发EEM
action 1.0 cli command “enable” \创建动作
action 2.0 cli command “show clock | append flash:ConfSave.txt”
action 3.0 syslog msg " Configuration changed "

Published 231 original articles · won praise 222 · views 20000 +

Guess you like

Origin blog.csdn.net/qinshangwy/article/details/104823434