01-18-2010 06:44 AM
I need to create a TCL script to check when the difference in the absolute value of the rxload on two interfaces, serial0/0/0:0 and serial0/0/1:0 is greater than 20 for more than 10 minutes. How would this be done?
01-18-2010 12:57 PM
I believe this policy will do what you want. It requires a few environment variables to be set first:
# check_load_diff : Integer value representing the maximum allowed
# rxload difference between the two interfaces.
#
# check_load_mins : Number of minutes the rxload difference must be
# above check_load_diff before the syslog will be sent.
#
# check_load_int1 : First interface to check.
#
# check_load_int2 : Second interface to check.
#
# check_load_time : Number of seconds between executions of this policy.
For example:
event manager environment check_load_diff 20
event manager environment check_load_mins 10
event manager environment check_load_int1 Serial0/0/0:0
event manager environment check_load_int2 Serial0/0/1:0
event manager environment check_load_time 60
Those values will cause the script to run every 60 seconds, and check for the conditions you described in this thread.
01-20-2010 09:04 AM
Thanks for your help. This worked great on a test router and one of our customer routers, but didn't work on the one customer that requested it. The one difference with their configuration is that they are using tacacs+. Would this make a difference? I wasn't able to get any information from the output interpreter.
Jan 20 10:49:32.987 CST: %HA_EM-6-LOG: tm_check_load.tcl: ..."
Jan 20 10:49:32.987 CST: %HA_EM-6-LOG: tm_check_load.tcl: (file "system:/lib/tcl/base.tcl" line 50)
Jan 20 10:49:32.987 CST: %HA_EM-6-LOG: tm_check_load.tcl: Tcl policy execute failed: Failed to find rxload for Serial0/0/0:0 in 'Remote#'
Jan 20 10:50:33.074 CST: %HA_EM-6-LOG: tm_check_load.tcl: Failed to find rxload for Serial0/0/0:0 in 'Remote#'
Jan 20 10:50:33.074 CST: %HA_EM-6-LOG: tm_check_load.tcl: while executing
Jan 20 10:50:33.074 CST: %HA_EM-6-LOG: tm_check_load.tcl: "get_curr_load $check_load_int1"
Jan 20 10:50:33.074 CST: %HA_EM-6-LOG: tm_check_load.tcl: invoked from within
Jan 20 10:50:33.074 CST: %HA_EM-6-LOG: tm_check_load.tcl: "$slave eval $Contents"
Jan 20 10:50:33.074 CST: %HA_EM-6-LOG: tm_check_load.tcl: (procedure "eval_script" line 7)
Jan 20 10:50:33.074 CST: %HA_EM-6-LOG: tm_check_load.tcl: invoked from within
Jan 20 10:50:33.074 CST: %HA_EM-6-LOG: tm_check_load.tcl: "eval_script slave $scriptname"
Jan 20 10:50:33.078 CST: %HA_EM-6-LOG: tm_check_load.tcl: invoked from within
Jan 20 10:50:33.078 CST: %HA_EM-6-LOG: tm_check_load.tcl: "if {$security_level == 1} { #untrusted script
Jan 20 10:50:33.078 CST: %HA_EM-6-LOG: tm_check_load.tcl: interp create -safe slave
Jan 20 10:50:33.078 CST: %HA_EM-6-LOG: tm_check_load.tcl: interp share {} stdin slave
Jan 20 10:50:33.078 CST: %HA_EM-6-LOG: tm_check_load.tcl: interp share {} stdout slave
Jan 20 10:50:33.078 CST: %HA_EM-6-LOG: tm_check_load.tcl: ..."
Jan 20 10:50:33.078 CST: %HA_EM-6-LOG: tm_check_load.tcl: (file "system:/lib/tcl/base.tcl" line 50)
Jan 20 10:50:33.078 CST: %HA_EM-6-LOG: tm_check_load.tcl: Tcl policy execute failed: Failed to find rxload for Serial0/0/0:0 in 'Remote#'
01-20-2010 09:35 AM
You need to add the following command if the device is doing command authorization:
event manager session cli username USER
Where USER is the username of a user authorized to run all of the CLI commands in the policy.
01-20-2010 10:06 AM
Thanks, that worked.
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