Running TCL from cisco kron

Is it possible to run tcl script from cisco kron?

sh ver .... Cisco IOS Software, C831 Software (C831-K9O3Y6-M), Version 12.3(2)XE3, RELEASE SOFTWARE (fc1) ... Cisco C831 (MPC857DSL) processor (revision 0x500) with 58983K/6553K bytes of memory. Processor board ID FCZ094451NC (385101830), with hardware revision 041F CPU rev number 7

2 Ethernet interfaces 4 FastEthernet interfaces 128K bytes of NVRAM. 12288K bytes of processor board System flash (Read/Write) 2048K bytes of processor board Web flash (Read/Write)

% cat p.tcl:

proc dosomepingingandstuff {} { ping 10.1.1.1 return "ok for now" }

copy scp://xxx@10.1.1.1/p.tcl nvram:p.tcl ...

conf t scripting tcl init nvram:p.tcl ^z

cs-nonexistant#tclsh cs-nonexistant(tcl)#dosomepingingandstuff ok for now cs-nonexistant(tcl)#tclquit cs-nonexistant#

So far p.tcl works (I ran tcpdump icmp on 10.1.1.1 and saw these pings)

But:

conf t kron occurrence pinging in 1 recurring policy-list pinging ! kron policy-list pinging cli tclsh cli dosomepingingandstuff cli tclquit ! ^z debug kron all

*Mar 1 00:10:17.987: Major 1, Minor 0 *Mar 1 00:10:17.987: Timer Event pinging *Mar 1 00:10:17.987: Kron delay for next pinging 60000 *Mar 1 00:10:17.987: Call parse_cmd 'tclsh' *Mar 1 00:10:17.995: Kron CLI return 0 '' *Mar 1 00:10:17.995: Major 4, Minor 7 *Mar 1 00:10:17.995: Respond to end of CLI Process *Mar 1 00:10:17.995: Call parse_cmd 'dosomepingingandstuff' *Mar 1 00:10:18.007: Kron CLI return 2 '' *Mar 1 00:10:18.007: Major 4, Minor 7 *Mar 1 00:10:18.007: Respond to end of CLI Process *Mar 1 00:10:18.011: Call parse_cmd 'tclquit' *Mar 1 00:10:18.011: Kron CLI return 0 '' *Mar 1 00:10:18.015: Major 4, Minor 7 *Mar 1 00:10:18.015: Respond to end of CLI Process

It doesn't work. 10.1.1.1 sees no pings and apparently dosomepingingandstuff wasn't called. Worse, free memory in sh mem stat slowly goes down until I get out of memory message when I try to invoke tclsh again. Much worse, sometimes router console mysteriously blocks console (I can log in from the network, but serial console doesn't respond, clear line console doesn't help)...

What's wrong? Is it possible to run tcl scripts from kron at all? No, I don't want to just ping 10.1.1.1, I want to ping it and do several configuration changes if 10.1.1.1 is not available and revert them back if 10.1.1.1 is back online. And no, I don't have extra fbsd/obsd/linux/whatever computers on the remote locations where 831s installed, only dumb citrix terminals, so 831 has to figure out some logic without external help.

Reply to
rm-throwaway4
Loading thread data ...

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.