nv-l
[Top] [All Lists]

Re: force reload

To: nv-l@lists.tivoli.com
Subject: Re: force reload
From: "Joel A. Gerber" <joel.gerber@USAA.COM>
Date: Tue, 25 Jan 2000 14:58:40 -0600
        I use NetView 5.1.1 on AIX 4.2.1, with CiscoWorks 4.0 and RME 2.2.
        My question is simple: I wish to scheduler a reload on my Cisco
router in the night,
        using a script file or something else (Cisco works or other...).
        I have tried some times, but problem is that router answer to me
with a request
        to confirm reload, and so my command abort.

        how can I make this reload?

        bye
        thanks

        dimitri

Another possibility is to write a script in expect to issue the commands to
the router, and read the responses, and confirm the reload.  I do not have
an expect script that does that, but here is another script (this particular
script is for running the "show cam dynamic" command on Catalyst 5000s, but
it's a good example of how to use expect to telnet, login, and run a
command):

#!/usr/sbin/expect
# When running on Essentials server, change the path in the above line to:
# /opt/CSCOpx/objects/tcltk/bin/expect
########################################

# Get the command line arguments
set HOST [lindex $argv 0]
set camdir [lindex $argv 1]
# Set the telnet password for the Catalyst 5000 switches
set TNPW password
set TACACSID tacacsID
set TACACSPW tacacsPW

# set the logfile
set cfgfile $camdir/$HOST.cam

puts "host - $HOST"
# Log into the device
spawn telnet $HOST
# if TACACS authentication is enabled, then the userID and password
#       will be sent, otherwise just the TELNET password is sent
while 1 {
        expect {
        "Enter password:" {
                send "$TNPW\r"
                break }
        "Username:" {
                send "$TACACSID\r"
                expect "Password:"
                send "$TACACSPW\r"
                break }
                }
        }
expect "${HOST}"
send "set length 0\r"
expect "Screen length"
log_file $cfgfile
send "show cam dynamic\r"
while 1 {
        expect {
        "Do you wish" {
                send "y\r" }
        "Total Matching CAM" {
                log_file
                send "exit\r"
                break}
        }
}

BTW, expect is included with the Essentials product.


Joel Gerber - I/T Networking Professional - USAA Information Technology Co.
- San Antonio, TX
* (210)456-4231         * mailto:Joel.Gerber@USAA.com   "
http://www.usaa.com


<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web