event timer
To specify the event criteria for an Embedded Event Manager (EEM) applet that is run on the basis of time-specific events, use the event timercommand in applet configuration mode. To remove the time-specific event criteria, use the no form of this command.
event [tag event-tag] timer {absolute time time-value | countdown time time-value | cron cron-entry cron-entry | watchdog time time-value} [name timer-name]
no event [tag event-tag] timer {absolute time time-value | countdown time time-value | cron cron-entry cron-entry | watchdog time time-value} [name timer-name]
Syntax Description
Command Default
No EEM events are triggered on the basis of time-specific events.
Command Modes
Applet configuration
Command History
Usage Guidelines
For the cron-entry argument, the following special strings also are allowed in syntax:
•Range of numbers—The specified range is inclusive, and a hyphen separates the numbers. For example, 8-11 after the hour field specifies execution of a CRON timer event at hours 8, 9, 10, and 11.
•Asterisk (*)—Indicates that a field is not specified and can be any value.
•List—A list is a set of numbers or ranges separated by a comma but no space. For example, 1,2,5,9 or 0-4,8-12.
•Step value in conjunction with a range—Following a range with /number specifies skips of the number value through the range. For example, 0-23/2 in the hour field specifies that an event is triggered every second hour. Steps are permitted after an asterisk, for example */2 means every two hours.
Instead of the five fields of a UNIX crontab entry for the cron-entry argument, one of the following seven special strings can be entered:
•@yearly—An event is triggered once a year. This is the equivalent of specifying 0 0 1 1 * for the first five fields.
•@annually—Same as @yearly.
•@monthly—An event is triggered once a month. This is the equivalent of specifying 0 0 1 * * for the first five fields.
•@weekly—An event is triggered once a week. This is the equivalent of specifying 0 0 * * 0 for the first five fields.
•@daily—An event is triggered once a day. This is the equivalent of specifying 0 0 * * * for the first five fields.
•@midnight—Same as @daily.
•@hourly—An event is triggered once an hour. This is the equivalent of specifying 0 * * * * for the first five fields.
A CRON timer may not produce the intended result if the time-of-day clock is not set to the correct time. Network Time Protocol (NTP) services can be used to facilitate keeping an accurate time-of-day clock setting. For more details on NTP configuration, see the "Performing Basic System Management" chapter of the Cisco IOS Network Management Configuration Guide, Release 12.4.
Examples
The following example shows how to specify that an event is triggered one time after 5 hours:
Router(config)# event manager applet timer-absolute
Router(config-applet)# event timer absolute time 18000
The following example shows how to specify that an event is triggered once after 6 minutes and 6 milliseconds:
Router(config)# event manager applet timer-set
Router(config-applet)# event timer countdown time 360.006 name six-minutes
The following example shows how to specify that an event is triggered at 1:01 a.m. on January 1 each year:
Router(config)# event manager applet timer-cron1
Router(config-applet)# event timer cron cron-entry 1 1 1 1 * name Jan1
The following example shows how to specify that an event is triggered at noon on Monday through Friday of every week:
Router(config)# event manager applet timer-cron2
Router(config-applet)# event timer cron cron-entry 0 12 * * 1-5 name MonFri
The following example shows how to specify that an event is triggered at midnight on Sunday every week:
Router(config)# event manager applet timer-cron3
Router(config-applet)# event timer cron cron-entry @weekly name Sunday
The following example shows how to specify that an event is triggered every 5 hours:
Router(config)# event manager applet timer-watch
Router(config-applet)# event timer watchdog time 18000
Related Commands
Command
|
Description
|
---|---|
event manager applet
|
Registers an event applet with the Embedded Event Manager and enters applet configuration mode.
|