Reboot Cisco from DCL script - VMS

This is a discussion on Reboot Cisco from DCL script - VMS ; Chaps, I'd like to be able to reboot a Cisco router from a DCL script. Effectively I need the equivalent of a TRIGGER NODE which would reload a DECserver. My initial thoughts would be to use the remoting functionality within ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Reboot Cisco from DCL script

  1. Reboot Cisco from DCL script

    Chaps,

    I'd like to be able to reboot a Cisco router from a DCL script.
    Effectively I need the equivalent of a TRIGGER NODE which would reload
    a DECserver.

    My initial thoughts would be to use the remoting functionality within
    SSH but any and all other suggestions would be happily accepted.

    Thanks in advance for any inspiration.


  2. Re: Reboot Cisco from DCL script

    In article <1193139711.898353.163530@v29g2000prd.googlegroups. com>, issinoho writes:
    >I'd like to be able to reboot a Cisco router from a DCL script.
    >Effectively I need the equivalent of a TRIGGER NODE which would reload
    >a DECserver.
    >
    >My initial thoughts would be to use the remoting functionality within
    >SSH but any and all other suggestions would be happily accepted.


    Use Kermit. We use this to create an accounting log and similar stuff
    for our Cisco routers.

    Regards,
    Christoph Gartmann

    --
    Max-Planck-Institut fuer Phone : +49-761-5108-464 Fax: -452
    Immunbiologie
    Postfach 1169 Internet: gartmann@immunbio dot mpg dot de
    D-79011 Freiburg, Germany
    http://www.immunbio.mpg.de/home/menue.html

  3. Re: Reboot Cisco from DCL script

    On 23 Oct, 13:13, gartm...@nonsense.immunbio.mpg.de (Christoph
    Gartmann) wrote:
    > In article <1193139711.898353.163...@v29g2000prd.googlegroups. com>, issinoho writes:
    >
    > >I'd like to be able to reboot a Cisco router from a DCL script.
    > >Effectively I need the equivalent of a TRIGGER NODE which would reload
    > >a DECserver.

    >
    > >My initial thoughts would be to use the remoting functionality within
    > >SSH but any and all other suggestions would be happily accepted.

    >
    > Use Kermit. We use this to create an accounting log and similar stuff
    > for our Cisco routers.
    >
    > Regards,
    > Christoph Gartmann
    >
    > --
    > Max-Planck-Institut fuer Phone : +49-761-5108-464 Fax: -452
    > Immunbiologie
    > Postfach 1169 Internet: gartmann@immunbio dot mpg dot de
    > D-79011 Freiburg, Germany
    > http://www.immunbio.mpg.de/home/menue.html


    That sounds like a good idea.

    Would anyone with more Kermit than I (none!) care to hazard a small
    script, along the lines of,

    set host /connect
    username
    password
    reload
    exit

    Thanks.


  4. Re: Reboot Cisco from DCL script

    On Tue, 23 Oct 2007 04:41:51 -0700, issinoho wrote:

    > Chaps,
    >
    > I'd like to be able to reboot a Cisco router from a DCL script.
    > Effectively I need the equivalent of a TRIGGER NODE which would reload
    > a DECserver.

    I do this through a Xyplex which should be similar to the DECServer, I
    think,
    telnet to the port on the Xyplex attached to the router, then talk to IOS
    >
    > My initial thoughts would be to use the remoting functionality within
    > SSH but any and all other suggestions would be happily accepted.
    >
    > Thanks in advance for any inspiration.
    >




    --
    PL/I for OpenVMS
    www.kednos.com

  5. Re: Reboot Cisco from DCL script


    "issinoho" wrote in message
    news:1193145481.484803.226080@z24g2000prh.googlegr oups.com...
    > On 23 Oct, 13:13, gartm...@nonsense.immunbio.mpg.de (Christoph
    > Gartmann) wrote:
    >> In article <1193139711.898353.163...@v29g2000prd.googlegroups. com>,
    >> issinoho writes:
    >>
    >> >I'd like to be able to reboot a Cisco router from a DCL script.
    >> >Effectively I need the equivalent of a TRIGGER NODE which would reload
    >> >a DECserver.

    >>
    >> >My initial thoughts would be to use the remoting functionality within
    >> >SSH but any and all other suggestions would be happily accepted.

    >>
    >> Use Kermit. We use this to create an accounting log and similar stuff
    >> for our Cisco routers.
    >>
    >> Regards,
    >> Christoph Gartmann
    >>
    >> --
    >> Max-Planck-Institut fuer Phone : +49-761-5108-464 Fax: -452
    >> Immunbiologie
    >> Postfach 1169 Internet: gartmann@immunbio dot mpg dot de
    >> D-79011 Freiburg, Germany
    >> http://www.immunbio.mpg.de/home/menue.html

    >
    > That sounds like a good idea.
    >
    > Would anyone with more Kermit than I (none!) care to hazard a small
    > script, along the lines of,
    >
    > set host /connect
    > username
    > password
    > reload
    > exit
    >
    > Thanks.
    >


    Here's a snippet of a DCL procedure where I upload Brocade switch
    configurations via Kermit:

    $SWITCH_LOOP:
    $ if f$search(tmpfile) .nes. "" then delete 'tmpfile';*/log
    $ if f$type(switch_'count') .eqs. "" then goto END_SWITCH_LOOP
    $
    $! Create/run Kermit file
    $
    $ switch = switch_'count'
    $ switch = f$element(0,".",switch)
    $ username = switch_username_'count'
    $ password = switch_password_'count'
    $
    $ open/write/ERROR=ERROR_POINT tmpfile 'tmpfile'
    $ write tmpfile "set telopt TERMINAL-TYPE refused"
    $ write tmpfile "set telopt NAWS refused"
    $ write tmpfile "set telopt NEW-ENVIRONMENT refused"
    $ write tmpfile "set telopt kermit refused"
    $ write tmpfile "set host ''switch'"
    $ write tmpfile "input 5 login:"
    $ write tmpfile "output ''username'\13"
    $ write tmpfile "input 5 Password:"
    $ write tmpfile "output ''password'\13"
    $ write tmpfile "input 5 >\32"
    $ write tmpfile "output configupload
    ""''this_host_ip'"",""''save_account'"",""''switch'.cfg"",""''save_password'""\13
    "
    $ write tmpfile "input 10 >\32"
    $ write tmpfile "output quit\13"
    $ write tmpfile "finish"
    $ close tmpfile
    $
    $ write sys$output "Running Switch script for ''switch', this may take a few
    minutes ..."
    $
    $ mcr site$util:ckermit 'tmpfile'
    $
    $ count = count + 1
    $ goto SWITCH_LOOP
    $END_SWITCH_LOOP:

    -Jeff




  6. Re: Reboot Cisco from DCL script

    In article <1193145481.484803.226080@z24g2000prh.googlegroups. com>, issinoho writes:
    >Would anyone with more Kermit than I (none!) care to hazard a small
    >script, along the lines of,


    SET MACRO ECHO OFF
    SET INPUT ECHO ON
    SET QUIET OFF
    ;
    DEFINE error EXIT \%1
    ;
    SET FLOW NONE
    ; Ctrl-C = 3, Ctrl-R = 18
    SET ESCAPE-CHARACTER 3
    SET INPUT TIMEOUT-ACTION PROCEED
    SET INPUT CASE OBSERVE
    SET TELNET TERMINAL-TYPE vt220
    SET TERMINAL BYTESIZE 8
    SET HOST your_router.your_domain.something
    INPUT 10 {Password: }
    IF FAILURE error 11
    OUTPUT top-secret\013
    INPUT 5 {routerprompt>}
    IF FAILURE error 12
    OUTPUT enable\013
    INPUT 5 {Password: }
    IF FAILURE error 13
    OUTPUT more-secret\013
    INPUT 5 {routerprompt#}
    IF FAILURE error 14
    OUTPUT reload\013
    INPUT 5 {Proceed with reload? [confirm]}
    IF FAILURE error 15
    OUTPUT \013
    CLOSE SESSION
    IF FAILURE error 16
    OUTPUT {quit\13}
    ;
    EXIT

    Then put a DCL-script around this like the following:

    $ wermit = "$device:[dir]wermit_axp"
    $ wermit the_above_script.ini
    $ IF ckermit_status .NE. 0
    $ THEN
    $ subject = """Reload script error! RC=" + F$STRING( ckermit_status ) +
    $ MAIL/SUBJ='subject' 'error_msg' SYSTEM
    $ EXIT
    $ ENDIF

    Regards,
    Christoph Gartmann

    --
    Max-Planck-Institut fuer Phone : +49-761-5108-464 Fax: -452
    Immunbiologie
    Postfach 1169 Internet: gartmann@immunbio dot mpg dot de
    D-79011 Freiburg, Germany
    http://www.immunbio.mpg.de/home/menue.html

  7. Re: Reboot Cisco from DCL script

    On 23 Oct, 14:45, gartm...@nonsense.immunbio.mpg.de (Christoph
    Gartmann) wrote:
    > In article <1193145481.484803.226...@z24g2000prh.googlegroups. com>, issinoho writes:
    >
    > >Would anyone with more Kermit than I (none!) care to hazard a small
    > >script, along the lines of,

    >
    > SET MACRO ECHO OFF
    > SET INPUT ECHO ON
    > SET QUIET OFF
    > ;
    > DEFINE error EXIT \%1
    > ;
    > SET FLOW NONE
    > ; Ctrl-C = 3, Ctrl-R = 18
    > SET ESCAPE-CHARACTER 3
    > SET INPUT TIMEOUT-ACTION PROCEED
    > SET INPUT CASE OBSERVE
    > SET TELNET TERMINAL-TYPE vt220
    > SET TERMINAL BYTESIZE 8
    > SET HOST your_router.your_domain.something
    > INPUT 10 {Password: }
    > IF FAILURE error 11
    > OUTPUT top-secret\013
    > INPUT 5 {routerprompt>}
    > IF FAILURE error 12
    > OUTPUT enable\013
    > INPUT 5 {Password: }
    > IF FAILURE error 13
    > OUTPUT more-secret\013
    > INPUT 5 {routerprompt#}
    > IF FAILURE error 14
    > OUTPUT reload\013
    > INPUT 5 {Proceed with reload? [confirm]}
    > IF FAILURE error 15
    > OUTPUT \013
    > CLOSE SESSION
    > IF FAILURE error 16
    > OUTPUT {quit\13}
    > ;
    > EXIT
    >
    > Then put a DCL-script around this like the following:
    >
    > $ wermit = "$device:[dir]wermit_axp"
    > $ wermit the_above_script.ini
    > $ IF ckermit_status .NE. 0
    > $ THEN
    > $ subject = """Reload script error! RC=" + F$STRING( ckermit_status ) +
    > $ MAIL/SUBJ='subject' 'error_msg' SYSTEM
    > $ EXIT
    > $ ENDIF
    >
    > Regards,
    > Christoph Gartmann
    >
    > --
    > Max-Planck-Institut fuer Phone : +49-761-5108-464 Fax: -452
    > Immunbiologie
    > Postfach 1169 Internet: gartmann@immunbio dot mpg dot de
    > D-79011 Freiburg, Germany
    > http://www.immunbio.mpg.de/home/menue.html


    Many thanks to everyone.


  8. Re: Reboot Cisco from DCL script

    Another option to remotely control a device would be SNMP. Many devices
    support SNMP commands for a reboot.

    You can use the TCPIP$SNMP_REQUEST.EXE utility which was well documented
    in the 5.0 docs but later removed from the documentation.

    This would offer a "cleaner" interface at run time, one command with all
    parameters on the same line and no scripts that can fail due to
    unexpected prompt etc), but would take more time to setup (find the
    proper incantation with the right long dotted numeric sequence to
    trigger the reboot as well as configure the Cisco unit to accept such
    requests from your host/community.

  9. Re: Reboot Cisco from DCL script

    On Tue, 23 Oct 2007 11:41:51 -0000, issinoho
    wrote:

    >Chaps,
    >
    >I'd like to be able to reboot a Cisco router from a DCL script.
    >Effectively I need the equivalent of a TRIGGER NODE which would reload
    >a DECserver.
    >
    >My initial thoughts would be to use the remoting functionality within
    >SSH but any and all other suggestions would be happily accepted.
    >
    >Thanks in advance for any inspiration.


    If you have Perl available, have a look at the
    Net::Telnet::Cisco module ...

    loosely/roughly:

    my $cs = Net::Telnet::Cisco->new( Host => $rtr );
    $cs->login( '', '' );
    $cs->enable( '' ); } );
    @cmd_output = $cs->cmd( ' terminal length 0' );
    # ...etc...
    @cmd_output = $cs->cmd( $cmd );
    #...etc...
    $cs->close;

+ Reply to Thread