---------- Forwarded message ----------
From: Valentino Vaia <***@gmail.com>
Date: 2010/1/29
Subject: Re: [rancid] Rancid & Enterasys B2/B3/N3/N7 switch
Post by Valentino Vaiain this way in the bin directory you will find a file named
192.168.1.1.new with the output of the B2login script.
You receive a login timeout from the B2rancid, have you added in the
.clogin.rc file the username and the password of the switch?
add user 192.168.1.1 your-username
add userpassword 192.168.1.1 your-password
No problem to login, .clogin.rc file is ok.
executing B2login -t 90 -c"show config" 192.168.1.1
PROMPT MATCH: FED-SW-GSI-003-E1(ro)->
HIT COMMAND:FED-SW-GSI-003-E1(ro)->show config
In ShowConfig: FED-SW-GSI-003-E1(ro)->show config
192.168.1.1: End of run not found
192.168.1.1: End of run not found
Error: TIMEOUT reached
So I can connect but I have a problem with commands.
As I don't have change your script, have you ever had the error ?
!RANCID-CONTENT-TYPE: Enterasys B2
!
This command shows non-default configurations only.
Use 'show config all' to show both default and non-default
configurations.
begin
!
#***** NON-DEFAULT CONFIGURATION *****
!
!
#arp
!
#arpinspection
!
#banner
!
#cdp
!
#ciscodp
!
#console
!
#diffserv
!
#dhcps
!
#dhcpsnooping
!
--More-- <space> next page, <cr> one line, <q> quit
Error: TIMEOUT reached
Now I understand your problem, I have had the same with allied telesis
switch. What is your B2's firmware version? I haven't this trouble
with firmware major than 4. To correct this trouble is necessary
modify the B2login or change firmware.
Strange, this B2 switch has a firmware > 4 !!
Chassis Firmware Revision: 04.02.01.0006
But if you have the correction, I'm interested for the other switchs.
I don't understand why yours B2 ask you to press <space>?!?
I have the same firmware and I haven't to press anything?!?
In the script expect B2login you can substitute the procedure run_commands
whit this:
proc run_commands { command } {
global in_proc
set in_proc 1
set commands [split $command \;]
set num_commands [llength $commands]
for { set i 0 } { $i < $num_commands } { incr i } {
send "[subst -nocommands [lindex $commands $i]]\r"
expect "->"
expect {
" config" {
send -- " ";
expect {
"<space> next page, <cr> one line, <q> quit " { send --
" "; exp_continue}
"->" { send "\r" }
}
}
"->" { }
}
}
set in_proc 0
}
I use a procedure similar for allied telesis and it works.
After the modification can you post to me the output of?
./B2login -u your-username -p your-password -c "show config" 192.168.5.31
If the B2login works probably you must change the order of the commands in
the command_table in the B2rancid
from this
@commandtable = (
# {'bcc' => 'RunCommand'},
{'show config' => 'ShowConfig'},
{'show version' => 'ShowConfig'},
# {'exit' => 'RunCommand'}
);
to
@commandtable = (
# {'bcc' => 'RunCommand'},
{'show version' => 'ShowConfig'},
{'show config' => 'ShowConfig'},
# {'exit' => 'RunCommand'}
);
I have done this for Allied switch.