Discussion:
[rancid] Rancid & Enterasys B2/B3/N3/N7 switch
r***@free.fr
2010-01-27 16:49:29 UTC
Permalink
Hi,
I tried to contact ***@mail.comune.modena.it to discuss about his Enterasys
B2 scripts but the answer was an undelivery mail !!

I tested the scripts but it doesn't function :

***@nsradminfedlog:~/bin$ ./B2rancid 192.168.1.1
sh: B2login: command not found
192.168.1.1: missed cmd(s): show version,show config
192.168.1.1: End of run not found
!

I had the same error when I modified my own scripts before to see valvai81's
one.
I try the scripts with B2 and N7 switchs with the same result.

However, the next command function very well, better than rivlogin.

***@nsradminfedlog:~/bin$ ./B2login 192.168.1.1

Do you have any idea ??

Best regards, Aurelie
Valentino Vaia
2010-01-27 19:54:42 UTC
Permalink
My mail address is valvai81 at gmail.com .

To correct the error

sh: B2login: command not found
192.168.1.1: missed cmd(s): show version,show config
192.168.1.1: End of run not found


you must add to the $PATH variable the path of yours scripts for example:
PATH=$PATH:/usr/local/rancid/bin
r***@free.fr
2010-01-28 10:08:45 UTC
Permalink
Post by Valentino Vaia
My mail address is valvai81 at gmail.com .
To correct the error
sh: B2login: command not found
192.168.1.1: missed cmd(s): show version,show config
192.168.1.1: End of run not found
PATH=$PATH:/usr/local/rancid/bin
Hi,
When I add PATH=$PATH:/home/rancid/bin in B2rancid script, I have an error :
***@nsradminfedlog:~/bin$ ./B2rancid 192.168.1.1
Can't modify constant item in scalar assignment at ./B2rancid line 48, near
"$PATH:"
syntax error at ./B2rancid line 48, near "$PATH:"
"use" not allowed in expression at ./B2rancid line 49, at end of line
Execution of ./B2rancid aborted due to compilation errors.

I try with the user root but with the same result.

So I add the PATH on rancid-run script.
***@nsradminfedlog:~/bin$ ./rancid-run 192.168.1.1

I have no error but when I verify the result on
/home/rancid/var/logs/SW_SC_R.20100128.102727, I have nothing !!

starting: jeudi 28 janvier 2010, 10:27:27 (UTC+0100)

ending: jeudi 28 janvier 2010, 10:27:27 (UTC+0100)

So I put the PATH on B2login :
***@nsradminfedlog:~/bin$ ./B2rancid 192.168.1.1
sh: B2login: command not found
192.168.1.1: missed cmd(s): show config
192.168.1.1: End of run not found
!
***@nsradminfedlog:~/bin$ ./B2login 192.168.1.1
can't read "PATH": no such variable
while executing
"PATH=$PATH:/home/rancid/bin"
(file "./B2login" line 53)





....
An idea ??
Valentino Vaia
2010-01-28 17:36:34 UTC
Permalink
Post by r***@free.fr
Post by Valentino Vaia
My mail address is valvai81 at gmail.com .
To correct the error
sh: B2login: command not found
192.168.1.1: missed cmd(s): show version,show config
192.168.1.1: End of run not found
PATH=$PATH:/usr/local/rancid/bin
Hi,
Can't modify constant item in scalar assignment at ./B2rancid line 48, near
"$PATH:"
syntax error at ./B2rancid line 48, near "$PATH:"
"use" not allowed in expression at ./B2rancid line 49, at end of line
Execution of ./B2rancid aborted due to compilation errors.
I try with the user root but with the same result.
So I add the PATH on rancid-run script.
I have no error but when I verify the result on
/home/rancid/var/logs/SW_SC_R.20100128.102727, I have nothing !!
starting: jeudi 28 janvier 2010, 10:27:27 (UTC+0100)
ending: jeudi 28 janvier 2010, 10:27:27 (UTC+0100)
sh: B2login: command not found
192.168.1.1: missed cmd(s): show config
192.168.1.1: End of run not found
!
can't read "PATH": no such variable
while executing
"PATH=$PATH:/home/rancid/bin"
(file "./B2login" line 53)
....
An idea ??
You haven't to modify the script.
At the shell prompt you must modify the $PATH for example

***@nsradminfedlog:~/bin$ PATH=$PATH:/home/rancid/bin


When you execute the rancid-run the $PATH variable is correct, but when
you want try the script (perl B2rancid) you must specificate the correct
PATH. This is true not only for my scripts (B2rancid and B2login) but
also to all the Rancid scripts.
You can also modify the B2rancid in the line where is called the B2login
from:

system "B2login -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "B2login failed for $host: $!\n";


to:

system "/home/rancid/bin/B2login -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "B2login failed for $host: $!\n";
Valentino Vaia
2010-01-29 13:29:45 UTC
Permalink
Post by Valentino Vaia
Post by r***@free.fr
Post by Valentino Vaia
My mail address is valvai81 at gmail.com .
To correct the error
sh: B2login: command not found
192.168.1.1: missed cmd(s): show version,show config
192.168.1.1: End of run not found
PATH=$PATH:/usr/local/rancid/bin
Hi,
When I add PATH=$PATH:/home/rancid/bin in B2rancid script, I have an error
Can't modify constant item in scalar assignment at ./B2rancid line 48, near
"$PATH:"
syntax error at ./B2rancid line 48, near "$PATH:"
"use" not allowed in expression at ./B2rancid line 49, at end of line
Execution of ./B2rancid aborted due to compilation errors.
I try with the user root but with the same result.
So I add the PATH on rancid-run script.
I have no error but when I verify the result on
/home/rancid/var/logs/SW_SC_R.20100128.102727, I have nothing !!
starting: jeudi 28 janvier 2010, 10:27:27 (UTC+0100)
ending: jeudi 28 janvier 2010, 10:27:27 (UTC+0100)
sh: B2login: command not found
192.168.1.1: missed cmd(s): show config
192.168.1.1: End of run not found
!
can't read "PATH": no such variable
while executing
"PATH=$PATH:/home/rancid/bin"
(file "./B2login" line 53)
....
An idea ??
You haven't to modify the script.
At the shell prompt you must modify the $PATH for example
When you execute the rancid-run the $PATH variable is correct, but when
you want try the script (perl B2rancid) you must specificate the correct
PATH. This is true not only for my scripts (B2rancid and B2login) but
also to all the Rancid scripts.
You can also modify the B2rancid in the line where is called the B2login
system "B2login -t $timeo -c "$cisco_cmds" $host </dev/null > $host.raw
2>&1" || die "B2login failed for $host: $!n";
system "/home/rancid/bin/B2login -t $timeo -c "$cisco_cmds" $host
</dev/null > $host.raw 2>&1" || die "B2login failed for $host: $!n";
rien, nada, nothing ... I have the same results, with or without the PATH
modification.
192.168.1.1: End of run not found
Error: TIMEOUT reached
192.168.1.1
spawn ssh -c 3des -x -l ro 192.168.1.1
Enterasys SecureStack B2
Command Line Interface
Enterasys Networks, Inc.
50 Minuteman Rd.
Andover, MA 01810-1008 U.S.A.
Phone: +1 978 684 1000
WWW: http://www.enterasys.com
(c) Copyright Enterasys Networks, Inc. 2007
Chassis Firmware Revision: 04.02.01.0006
FED-SW-GSI-003-E1(ro)->exit
Connection to 192.168.1.1 closed by remote host.
Connection to 192.168.1.1 closed.
Is their any debug mode I can activate ?
For me the output is different after the modification of the $PATH variable.
To debug you can try the -d option for example

***@nsradminfedlog:~/bin$ ./B2rancid -d 192.168.1.1


in 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?
for example:
add user 192.168.1.1 your-username
add userpassword 192.168.1.1 your-password
Valentino Vaia
2010-01-29 20:44:07 UTC
Permalink
---------- Forwarded message ----------
From: Valentino Vaia <***@gmail.com>
Date: 2010/1/29
Subject: Re: [rancid] Rancid & Enterasys B2/B3/N3/N7 switch
Post by Valentino Vaia
in 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.
Valentino Vaia
2010-01-29 13:37:33 UTC
Permalink
Can you send to me please the output of the different command:
1) ./B2login -u your-admin-username -p your-switch-password -c "show
version" sw-pmc-1-1
2) ./B2rancid -d sw-pmc-1-1

Have you added at the file .clogin.rc
add user sw-pmc-1-1 your-username
add userpassword sw-pmc-1-1 your-password
Hi,
I can execute *B2Login* and enter in *telnet* mode of *enterasys*.
sw-pmc-1-1(su)->show config
Error: TIMEOUT reached
rancid-vm:/usr/lib/rancid/bin# show config
bash: show: command not found
rancid-vm:/usr/lib/rancid/bin#
Thanks.
Marcos
Have you tried simply the B2login? What is the output?
./B2login -u your-admin-username -p you-switch-password -c "show
version" sw-pmc-1-1
Have you just tried this?
Have you added the username and password of the switch in .clogin.rc ?
Have you tried: ./B2rancid -d sw-pmc-1-1 ?
Valentino
Hi man,
I'm trying to get Enterasys *B3* config's, but rancid don't work.
sw-pmc-1-1 B2login error: Error: TIMEOUT reached
sw-pmc-1-1: missed cmd(s): show version,show config
sw-pmc-1-1: End of run not found
Do u know something about ?
Thanks !
Marcos
My mail address is valvai81 at gmail.com
<http://gmail.com> <http://gmail.com> .
To correct the error
sh: B2login: command not found
192.168.1.1 <http://192.168.1.1>: missed cmd(s): show
version,show
config
192.168.1.1 <http://192.168.1.1>: End of run not found
you must add to the $PATH variable the path of yours
scripts for
PATH=$PATH:/usr/local/rancid/bin
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Valentino Vaia
2010-01-29 14:21:39 UTC
Permalink
Excuse me, but the output of the B2login is nothing?
The timeout is caused from the absence of the username and the password
in .clogin.rc , have you modified it?
Hi,
rancid-vm:~# B2login -u rancid -p rancid123 -c "show version" sw-pmc-1-1
rancid-vm:~# B2rancid -d sw-pmc-1-1
executing B2login -t 90 -c"show config;show version" sw-pmc-1-1
sw-pmc-1-1 B2login error: Error: TIMEOUT reached
sw-pmc-1-1 B2login error: Error: TIMEOUT reached
sw-pmc-1-1: missed cmd(s): show version,show config
sw-pmc-1-1: missed cmd(s): show version,show config
sw-pmc-1-1: End of run not found
sw-pmc-1-1: End of run not found
!
rancid-vm:~#
1) ./B2login -u your-admin-username -p your-switch-password -c
"show version" sw-pmc-1-1
2) ./B2rancid -d sw-pmc-1-1
Have you added at the file .clogin.rc
add user sw-pmc-1-1 your-username
add userpassword sw-pmc-1-1 your-password
Hi,
I can execute *B2Login* and enter in *telnet* mode of *enterasys*.
sw-pmc-1-1(su)->show config
Error: TIMEOUT reached
rancid-vm:/usr/lib/rancid/bin# show config
bash: show: command not found
rancid-vm:/usr/lib/rancid/bin#
Thanks.
Marcos
Have you tried simply the B2login? What is the output?
./B2login -u your-admin-username -p you-switch-password -c "show
version" sw-pmc-1-1
Have you just tried this?
Have you added the username and password of the switch in .clogin.rc ?
Have you tried: ./B2rancid -d sw-pmc-1-1 ?
Valentino
Hi man,
I'm trying to get Enterasys *B3* config's, but rancid don't work.
sw-pmc-1-1 B2login error: Error: TIMEOUT reached
sw-pmc-1-1: missed cmd(s): show version,show config
sw-pmc-1-1: End of run not found
Do u know something about ?
Thanks !
Marcos
My mail address is valvai81 at gmail.com
<http://gmail.com>
<http://gmail.com> <http://gmail.com> .
To correct the error
sh: B2login: command not found
192.168.1.1 <http://192.168.1.1>: missed cmd(s): show
version,show
config
192.168.1.1 <http://192.168.1.1>: End of run not found
you must add to the $PATH variable the path of yours
scripts for
PATH=$PATH:/usr/local/rancid/bin
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Martin Barry
2010-01-29 13:53:52 UTC
Permalink
Post by r***@free.fr
sh: B2login: command not found
192.168.1.1: missed cmd(s): show version,show config
192.168.1.1: End of run not found
!
It can't find the command in your path. The output of

echo $PATH

for the user rancid runs as needs to contain the bin directory

cheers
Marty
Valentino Vaia
2010-02-01 08:08:06 UTC
Permalink
A possible solution for the timeout with the command "show config" on B2\B3
switches is to set the number of lines in output to 0 to disable 'more' .
On switch prompt:
set lenght 0
r***@free.fr
2010-02-02 13:20:37 UTC
Permalink
For B2 & B3 switch
- use B2rancid and B2login scripts
(- I prefer "show config all")
- if you need "more" to see all the config, just add a new command "set length
0" on B2rancid (even for a ro login)
# Main
@commandtable = (
# {'bcc' => 'RunCommand'},
{'set length 0' => 'ShowConfig'},
# {'show config all' => 'ShowConfig'},
{'show config' => 'ShowConfig'},
{'show version' => 'ShowConfig'},
# {'exit' => 'RunCommand'}
);


For N3 & N7 switch
- copy the B2login & B2rancid scripts to ENTlogin & ENTrancid
- don't forget to change rancid-fe and router.db
- on ENTrancid, just change
ProcessHistory("","","","!RANCID-CONTENT-TYPE: Enterasys N3-N7n!n");
- on ENTlogin, I modify "more offr" with only "r" (I don't know why but "more"
was unknown)
# Run commands given on the command line.
proc run_commands { prompt command } {
global in_proc
set in_proc 1

# send "more offr"
send "r"

I also configure /etc/hosts to improve reading.

Thanks to you Valvai81
Marcos A. Miachiro
2010-02-02 19:30:41 UTC
Permalink
Hi,

My rancid get timeout. I found it in my logs.....

Getting missed routers: round 4.
sw-pmc-2-1 B2login error: Error: TIMEOUT reached
sw-pmc-2-1: missed cmd(s): set length 0,show version,show config
sw-pmc-2-1: End of run not found
!
sw-pmc-1-1 B2login error: Error: TIMEOUT reached
sw-pmc-1-1: missed cmd(s): set length 0,show version,show config
sw-pmc-1-1: End of run not found
!

cvs diff: Diffing .
cvs diff: Diffing configs
cvs commit: Examining .
cvs commit: Examining configs
Post by Valentino Vaia
A possible solution for the timeout with the command "show config" on B2\B3
switches is to set the number of lines in output to 0 to disable 'more' .
set lenght 0
Valentino Vaia
2010-02-03 09:47:47 UTC
Permalink
Hi,

Can you post for a single switch the file .new ?
For example if you try
./B2rancid -d sw-pmc-2-1
you must post the output stored in
sw-pmc-2-1.new
Post by Marcos A. Miachiro
Hi,
My rancid get timeout. I found it in my logs.....
Getting missed routers: round 4.
sw-pmc-2-1 B2login error: Error: TIMEOUT reached
sw-pmc-2-1: missed cmd(s): set length 0,show version,show config
sw-pmc-2-1: End of run not found
!
sw-pmc-1-1 B2login error: Error: TIMEOUT reached
sw-pmc-1-1: missed cmd(s): set length 0,show version,show config
sw-pmc-1-1: End of run not found
!
cvs diff: Diffing .
cvs diff: Diffing configs
cvs commit: Examining .
cvs commit: Examining configs
A possible solution for the timeout with the command "show config"
on B2\B3 switches is to set the number of lines in output to 0 to
disable 'more' .
set lenght 0
Wagner Bonifacio Leite
2013-11-28 17:43:19 UTC
Permalink
Hello to all,
I'm trying to find files for Enterasys switches, both as C Series N Series,
for Rancid. Can you send me the files, both as B2login ENTlogin?

Thank you!

Regards,
Post by r***@free.fr
Hi,
about his Enterasys
B2 scripts but the answer was an undelivery mail !!
sh: B2login: command not found
192.168.1.1: missed cmd(s): show version,show config
192.168.1.1: End of run not found
!
I had the same error when I modified my own scripts before to see valvai81's
one.
I try the scripts with B2 and N7 switchs with the same result.
However, the next command function very well, better than rivlogin.
Do you have any idea ??
Best regards, Aurelie
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Loading...