PurposeCommand or Action
Registers the applet with the Embedded Event Manager and enters applet
configuration mode.
event manager applet applet-name
Example:
Device(config)# event manager
applet manual-policy
Step 3
Registers the Simple Network Management Protocol (SNMP) object event for
an Embedded Event Manager (EEM) applet to intercept SNMP GET and SET
requests for an object.
event snmp-object oid oid-value type
value sync {yes | no} skip {yes | no}
istable {yes | no} [default seconds]
[maxrun maxruntime-number]
Step 4
The default for this command is that it is not configured. If this command is
configured the defaults are the same as in the description of the syntax options,
Example:
Device(config-applet)# event
•
The oidkeyword specifies the SNMP object identifier (object ID).
•
The oid-value argument can be the Object ID value of the data element, in
SNMP dotted notation. An OID is defined as a type in the associated MIB,
snmp-object oid 1.9.9.9.9 type
gauge sync yes
Example:
action 1 syslog msg "oid =
$_snmp_oid"
CISCO-EMBEDDED-EVENT-MGR-MIB, and each type has an object
value.
•
The istable keyword specifies whether the OID is an SNMP table.
•
The sync keyword specifies that the applet is to run in synchronous mode.
The return code from the applet indicates whether to reply to the SNMP
Example:
action 2 syslog msg "request =
$_snmp_request"
request. The description for code 0 is “do not reply to the request” and the
description for code 1 is “reply to the request”. When the return code from
the applet replies to the request, a value is specified in the applet for the
object using action snmp-object-value command.
Example:
action 3 syslog msg "request_type
= $_snmp_request_type"
•
The typekeyword specifies the type of object.
•
The value argument is the value of the object.
•
Theskip keyword specifies whether to skip CLI command execution.
•
The default keyword specifies the time to process the SET or GET request
normally by the applet. If the default keyword is not specified, the default
time period is set to 30 seconds.
•
The milliseconds argument is the time period during which the SNMP
Object event detector waits for the policy to exit.
•
The maxrun keyword specifies the maximum runtime of the applet. If the
maxrun keyword is specified, the maxruntime-number value must be
specified. If the maxrun keyword is not specified, the default applet run
time is 20 seconds.
•
The milliseconds argument is the maximum runtime of the apple in
milliseconds. If the argument is not specified, the default 20-second run-time
limit is used.
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
1741
How to Write EEM Policies Using the Cisco IOS CLI