event_wait
Places the Tcl policy into a sleep state. When the Tcl policy receives a new signal announcing a new event,
the policy is placed into a wake state and again returns to a sleep state. This loop continues. If
event_wait
policy is invoked before
event_completed
policy, an error results and the policy exits.
Syntax
event_wait [refresh_vars]
Arguments
(Optional) Indicates whether built-in and environment
variables should be updated (refreshed) from the EEM
Policy Director during this event instance.
refresh_vars
Result String
None
Set _cerrno
No
Sample Usage
The
event_wait
event detector returns an array type value with a single element named
event_state
. Event_state
is a value sent back from the EEM Server indicating whether or not an error has occurred in processing the
event. An example of an error here would be if the user configured
event_wait
before configuring
event_completion
when handling the event instance.
The following sample output shows the use of both
event_completion
and
event_wait
Tcl commands:
::cisco::eem::event_register_syslog tag e1 occurs 1 pattern CLEAR maxrun 0
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
set i 1
while {1 == 1} {
# Start high performance policy loop
array set arr_einfo [event_reqinfo]
if {$_cerrno != 0} {
set result [format "component=%s; subsys err=%s; posix err=%s;\n%s" \
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err $_cerr_str]
error $result
}
action_syslog msg "event $i serviced" priority info
if {$i == 5} {
action_syslog msg "Exiting after servicing 5 events" priority info
exit 0
}
incr i
event_completion status 0
array set _event_state_arr [event_wait refresh_vars 0]
if {$_event_state_arr(event_state) != 0} {
action_syslog msg "Exiting: failed event_state " \
" $event_state_arr(event_state)" priority info
exit 0
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
1982
event_wait
Summary of Contents for Catalyst 2960 Series
Page 96: ......
Page 196: ......
Page 250: ......
Page 292: ......
Page 488: ......
Page 589: ...P A R T VI Cisco Flexible NetFlow Configuring NetFlow Lite page 509 ...
Page 590: ......
Page 619: ...P A R T VII QoS Configuring QoS page 539 Configuring Auto QoS page 645 ...
Page 620: ......
Page 750: ......
Page 1604: ......
Page 1740: ......
Page 2105: ...P A R T XII Configuring Cisco IOS IP SLAs Configuring Cisco IP SLAs page 2025 ...
Page 2106: ......
Page 2118: ......
Page 2164: ......