cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1268
Views
0
Helpful
1
Replies

Run the script immediately without waiting watchdog timer

sbae
Cisco Employee
Cisco Employee

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>...

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

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.

View solution in original post

1 Reply 1

Joe Clarke
Cisco Employee
Cisco Employee

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.