Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nortel 350/450-24T

Status
Not open for further replies.

f0rager

Technical User
Apr 21, 2008
1
US
I have about 250 Nortel devices (350/450-24T) that need to change the password, I know there were a thread (thread902-286467) related to the same matter so I would like to see if the tool and script that was provided to do the change still available
 
I just recently wrote an Expect script to automate the process of resetting (changing) all the passwords on ~ 400 Nortel switches.

The later switches might support setting the user passwords through the SNMP MIB but I don't think the 350/450s support it.

Here's a starting point for you;


#!/usr/bin/expect -f
#
# This Expect script was generated by autoexpect on Wed Jul 27 17:25:28 2005
# Expect and autoexpect were both written by Don Libes, NIST.
#
set force_conservative 1 ;# set to 1 to force conservative mode even if
;# script wasn't run conservatively originally
if {$force_conservative} {
set send_slow {1 .1}
proc send {ignore arg} {
sleep .1
exp_send -s -- $arg
}
}

#
set PATH "/root/"
set TELNET "/usr/bin/telnet"

set SWITCH [lindex $argv 0]
set PASSWORD [lindex $argv 1]

set RO "user"
set RW "secure"

set TODAY [timestamp -format %y%m%d ]
set WEEKDAY [timestamp -format %a ]
set DATE [timestamp -format %c ]

set send_human {.1 .3 1 .05 2}

#log_file $PATH/$SWITCH.expect.log
log_file /usr/local/etc/password.expect.log
log_user 0 # Disable logging to STDOUT
#log_user 1 # Enable logging to STDOUT

set timeout 60
spawn $TELNET $SWITCH
match_max 100000

expect "Trying"
expect "Connected"
sleep 1
send -- ""
expect "Enter Password"
send -- "$PASSWORD\r"
expect {
"Main Menu" {
}
"Incorrect Password" {
send_log "$SWITCH : Incorrect Password"
exit 1
}
}
sleep 1
send -- "o"
sleep 1
expect "Console/Comm Port Configuration"
send -- "[B"
send -- "[B"
send -- "[B"
send -- "$RO\r"
send -- "[B"
send -- "$RW\r"
send -- ""
expect "Main Menu"
send -- "l"
expect eof


Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top