Running TCL from cisco kron

Discussion in 'Cisco' started by rm-throwaway4@gunlab.com.ru, Dec 20, 2005.

  1. Guest

    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.
     
    , Dec 20, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Tikart

    Running ping with kron

    Andreas Tikart, Jun 28, 2004, in forum: Cisco
    Replies:
    0
    Views:
    676
    Andreas Tikart
    Jun 28, 2004
  2. Knut Rauscher

    kron every 5 minutes

    Knut Rauscher, Nov 27, 2004, in forum: Cisco
    Replies:
    3
    Views:
    1,939
    Hansang Bae
    Nov 30, 2004
  3. Patrick A

    Running ping with kron

    Patrick A, Mar 29, 2005, in forum: Cisco
    Replies:
    9
    Views:
    3,368
    Patrick A
    Apr 9, 2005
  4. Martin
    Replies:
    3
    Views:
    820
    Martin
    Nov 26, 2006
  5. pfunknasty

    Cisco 1811 Kron:

    pfunknasty, May 28, 2009, in forum: Cisco
    Replies:
    0
    Views:
    2,074
    pfunknasty
    May 28, 2009
Loading...

Share This Page