nv-l
[Top] [All Lists]

RE: Password changes on cisco routers

To: nv-l@lists.tivoli.com
Subject: RE: Password changes on cisco routers
From: Sean Davidson <sean.davidson@mail.publix.com>
Date: Wed, 27 Sep 2000 08:07:40 -0400
You can also use just plain shell scripts. Here's an AIX shell script I use
to tftp config, write it to memory, and then write it to a tftp server. It
uses SNMP, so you must have snmpset executable on machine you are running it
from, the necessary Cisco MIBs loaded, and the snmp write community string.
The input file should contain IP addresses or resolvable names. The name is
usually the better approach because it will use this name/ip address with
"-confg" appended to it when writing back to tftp server. You can put
multiple names in the input file.

#!/bin/sh
# usage: rsdcw.sh < file.containing.list.of.routers
#
# NOTES:
#
#     -  The last octet of the cfgNet variable must contain the IP address
of
#        the TFTP server.
#
#     -  The last octet of the writeNet variable must contain the IP address
of
#        the TFTP server.
#
#     -  The errlog variable indicates the path/filename exceptions will be
#        written to.
#
#     -  The config variable must contain either a valid path/filename or a
#        validated in the default TFTP read directory (/tftpboot). The file
must be
#        a valid Cisco configuration file. (containing valid Cisco commands)
#
#     -  The timeout/retries variables are for the snmpset commands.
#
#     -  This script defaults to using the snmp community strings specified
in
#        /usr/OV/conf/ovsnmp.conf. Make sure these strings are correct.
#
# Created by: Sean Davidson 11/26/97
#
# Revision History:
#
#
#
#
#
############################################################################
#############

cfgNet="cisco.local.lsystem.hostConfigSet.172.16.250.22"
wrMem="cisco.local.lsystem.writeMem.0"
writeNet="cisco.local.lsystem.writeNet.172.16.250.22"
type="octetstringascii"
type1="integer"
timeout="-t 100"
retries="-r 3"
errlog=/tmp/rsdcw1.log
# CHANGE THIS TO CONFIG FILE NAME IN /TFTPBOOT
config=ttil

# Always remove error log
rm -f $errlog       >/dev/null 2>&1

echo "RSD CiscoWorks script started at `date`" >> $errlog
echo >> $errlog

# Set up command and log exceptions to file
while read TEMP
do
{
echo $TEMP
} | snmpset $timeout $retries $TEMP $cfgNet $type $config
rc="$?"
if [ "$rc" != "0" ]; then
        echo "Config Network failed for router $TEMP at `date`" >> $errlog
fi
snmpset $timeout $retries $TEMP $wrMem $type1 1
rc="$?"
if [ "$rc" != "0" ]; then
        echo "Write Memory failed for $TEMP at `date`.  Return Code: $rc" >>
$errlog
fi
snmpset $timeout $retries $TEMP $writeNet $type $TEMP-confg
rc="$?"
if [ "$rc" != "0" ]; then
        echo "Write Net failed for router $TEMP at `date`" >> $errlog
fi
done

-----Original Message-----
From: Boulieris, Arthur [mailto:Arthur.Boulieris@nz.unisys.com]
Sent: Tuesday, September 26, 2000 11:47 PM
To: 'nv-l@tkg.com'
Subject: [NV-L] Password changes on cisco routers


Hi all, 
this isnt really a Netview question but thought some one might be able to
help.
I need to be able to change passwords from a script, I used to have a telnet
scripting tool but it doesnt run on unix.
Does anyone know where i can get one, have not been able to find one on the
web.

Thanks Arthur 

   Arthur Boulieris
   Implementation & Support Specialist
   Systems Management

 <<...OLE_Obj...>> 

    Ph: 64-4-462 2787
    Mobile: 025 543 529
    Arthur.Boulieris@Unisys.com


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

Archive operated by Skills 1st Ltd

See also: The NetView Web