07-19-2013 12:12 AM
I'm getting an error in Joe Clarks scripts that monitor up/down status of ports and shutdown those ports that have been "down" for a given amount time.
Whenever the script runs at midnight the policy fails:
Tcl policy execute failed:
tm_suspend_ports.tcl: can't read "port": no such variable
/////////////////////show logging///////////////////////////////////
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: can't read "port": no such variable
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: while executing
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: "action_syslog msg "Shutting down port $port since it was last used on [clock format $suspend_ports($port)]""
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: invoked from within
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: "$slave eval $Contents"
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: (procedure "eval_script" line 7)
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: invoked from within
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: "eval_script slave $scriptname"
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: invoked from within
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: "if {$security_level == 1} { #untrusted script
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: interp create -safe slave
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: interp share {} stdin slave
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: interp share {} stdout slave
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: ..."
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: (file "tmpsys:/lib/tcl/base.tcl" line 50)
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: Tcl policy execute failed:
Jul 18 19:00:08.422: %HA_EM-6-LOG: tm_suspend_ports.tcl: can't read "port": no such variable
//////////////////////show registered///////////////////////////////////
No. Class Type Event Type Trap Time Registered Secu Name
1 script user syslog Off Thu Jul 18 22:50:57 2013 2048 sl_suspend_ports.tcl
pattern {LINEPROTO-5-UPDOWN}
nice 0 queue-priority normal maxrun 600.000 scheduler rp_primary
2 script user timer cron On Thu Jul 18 22:51:06 2013 2048 tm_suspend_ports.tcl
cron entry {0 0 * * *}
nice 0 queue-priority normal maxrun 600.000 scheduler rp_primary
////////////////////show run//////////////////////////////////////////
event manager environment suspend_ports_days 1
event manager environment suspend_ports_config flash:/susp_ports.dat
event manager directory user policy "flash:/test"
event manager session cli username "netops"
event manager policy sl_suspend_ports.tcl
event manager policy tm_suspend_ports.tcl trap
07-19-2013 10:44 AM
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