06-08-2015 07:22 AM
Is there any option to run the script immediately without waiting watchdog timer?
Actually I want to run this script immediately whenever I register this script, and then run every 3600 sec.
(run script first -> after 3600sec -> run script -> after 3600sec....)
But, the following sample watchdog script will run after waiting 3600 sec.
(after 3600sec -> run script -> after 3600sec -> run script....)
Wordaround is making 2 scripts as
1. countdown time 1 name crc_1 maxrun 100
2. watchdog time 3600 name crc_2 maxrun 100
and, register these scripts(countdown, watchdog) at the same time.
============= Sample watchdog IOS-XR TCL ================
::cisco::eem::event_register_timer watchdog time 3600 name crc maxrun 100
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
array set ar_intf_crc {}
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
}
...<snip>...
Solved! Go to Solution.
06-12-2015 05:16 PM
Unfortunately, multiple event support is not yet available for XR, so you will need to register two policies. Technically, you could do it with three to avoid a lot of code duplication. One policy will be your one second timer, and the other will be your 3600 second timer. The third will be the actually policy itself using the none event detector. The two timer policies would simply do action_policy to invoke this third one.
06-12-2015 05:16 PM
Unfortunately, multiple event support is not yet available for XR, so you will need to register two policies. Technically, you could do it with three to avoid a lot of code duplication. One policy will be your one second timer, and the other will be your 3600 second timer. The third will be the actually policy itself using the none event detector. The two timer policies would simply do action_policy to invoke this third one.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide