Discussion:
[rancid] Dell Powerconnect switches - problem and suggestion
George Hills
2009-08-14 17:11:50 UTC
Permalink
Hi,

My thanks to Jeremy Singletary for his drancid/dlogin scripts, and Nate
Steffen for his updates and email help.

I've had a couple of different problems trying to get RANCID working
with some Dell Powerconnect switches recently.

I'm using rancid 2.3.2a7 from the Ubuntu package on Ubuntu Hardy amd64.

My Powerconnects are 6248s running 2.0.1.2 and 2.2.0.3 and 5324s running
2.0.0.40.

The 6248s had an easy problem - the dlogin script is sending "exit" and
expecting to get out, but that only takes it out of enable mode. It then
needs to send "quit" (*not* "exit" again) afterwards to get out.

I bodged this by just adding a line:

***@beast:~$ diff dlogin dlogin.gh
672a673
dsend "quit\r"
On the 5348 (where "exit" from enable mode logs you off...sigh...) I
think there's a problem with the pager. My "more" prompts look like

"More: <space>, Quit: q, One line: <return> "

and dlogin freezes when it sees one. Other than that it works fine. I
guess there's a problem with the regex but I can't work out what it is.
Would be grateful for any suggestions.

Cheers.
--
George Hills
Systems Administrator
Brightbox
http://www.brightbox.co.uk/
Jeremy Singletary
2009-08-15 02:45:05 UTC
Permalink
Looks like there are some invisible characters showing up in the pager
in newer Dells. Download this version of dlogin, and let us know if it
resolves the issue.

http://www.rickyninja.net/rancid/dlogin-dev

Thanks,
Jeremy
Post by George Hills
Hi,
My thanks to Jeremy Singletary for his drancid/dlogin scripts, and Nate
Steffen for his updates and email help.
I've had a couple of different problems trying to get RANCID working
with some Dell Powerconnect switches recently.
I'm using rancid 2.3.2a7 from the Ubuntu package on Ubuntu Hardy amd64.
My Powerconnects are 6248s running 2.0.1.2 and 2.2.0.3 and 5324s running
2.0.0.40.
The 6248s had an easy problem - the dlogin script is sending "exit" and
expecting to get out, but that only takes it out of enable mode. It then
needs to send "quit" (*not* "exit" again) afterwards to get out.
672a673
dsend "quit\r"
On the 5348 (where "exit" from enable mode logs you off...sigh...) I
think there's a problem with the pager. My "more" prompts look like
"More: <space>, Quit: q, One line: <return> "
and dlogin freezes when it sees one. Other than that it works fine. I
guess there's a problem with the regex but I can't work out what it is.
Would be grateful for any suggestions.
Cheers.
--
George Hills
Systems Administrator
Brightbox
http://www.brightbox.co.uk/
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Josh Rogers
2009-08-15 03:39:33 UTC
Permalink
What steps are necessary to monitor Dell switches? Download drancid, dlogin
and put them in /opt/local/libexec/rancid with other rancid executables,
then what? Update router.db and specify a device as a 'dell' instead of
'cisco' or 'juniper'

Is that basically it?



On Fri, Aug 14, 2009 at 9:45 PM, Jeremy Singletary
Post by Jeremy Singletary
Looks like there are some invisible characters showing up in the pager
in newer Dells. Download this version of dlogin, and let us know if it
resolves the issue.
http://www.rickyninja.net/rancid/dlogin-dev
Thanks,
Jeremy
Post by George Hills
Hi,
My thanks to Jeremy Singletary for his drancid/dlogin scripts, and Nate
Steffen for his updates and email help.
I've had a couple of different problems trying to get RANCID working
with some Dell Powerconnect switches recently.
I'm using rancid 2.3.2a7 from the Ubuntu package on Ubuntu Hardy amd64.
My Powerconnects are 6248s running 2.0.1.2 and 2.2.0.3 and 5324s running
2.0.0.40.
The 6248s had an easy problem - the dlogin script is sending "exit" and
expecting to get out, but that only takes it out of enable mode. It then
needs to send "quit" (*not* "exit" again) afterwards to get out.
672a673
dsend "quit\r"
On the 5348 (where "exit" from enable mode logs you off...sigh...) I
think there's a problem with the pager. My "more" prompts look like
"More: <space>, Quit: q, One line: <return> "
and dlogin freezes when it sees one. Other than that it works fine. I
guess there's a problem with the regex but I can't work out what it is.
Would be grateful for any suggestions.
Cheers.
--
George Hills
Systems Administrator
Brightbox
http://www.brightbox.co.uk/
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Jeremy Singletary
2009-08-15 04:23:09 UTC
Permalink
You'll also need a modified rancid-fe that recognizes the dell string in
router.db and calls drancid.

Did you look into what John Heasley suggested previously about trying
the SMC scripts?

-jeremy
What steps are necessary to monitor Dell switches? Download drancid,
dlogin and put them in /opt/local/libexec/rancid with other rancid
executables, then what? Update router.db and specify a device as a
'dell' instead of 'cisco' or 'juniper'
Is that basically it?
On Fri, Aug 14, 2009 at 9:45 PM, Jeremy Singletary
Looks like there are some invisible characters showing up in the
pager
in newer Dells. Download this version of dlogin, and let us know
if it
resolves the issue.
[2]http://www.rickyninja.net/rancid/dlogin-dev
Thanks,
Jeremy
Hi,
My thanks to Jeremy Singletary for his drancid/dlogin scripts, and
Nate
Steffen for his updates and email help.
I've had a couple of different problems trying to get RANCID working
with some Dell Powerconnect switches recently.
I'm using rancid 2.3.2a7 from the Ubuntu package on Ubuntu Hardy
amd64.
My Powerconnects are 6248s running 2.0.1.2 and 2.2.0.3 and 5324s
running
2.0.0.40.
The 6248s had an easy problem - the dlogin script is sending "exit"
and
expecting to get out, but that only takes it out of enable mode. It
then
needs to send "quit" (*not* "exit" again) afterwards to get out.
672a673
dsend "quit\r"
On the 5348 (where "exit" from enable mode logs you off...sigh...) I
think there's a problem with the pager. My "more" prompts look like
"More: <space>, Quit: q, One line: <return> "
and dlogin freezes when it sees one. Other than that it works fine.
I
guess there's a problem with the regex but I can't work out what it
is.
Would be grateful for any suggestions.
Cheers.
--
George Hills
Systems Administrator
Brightbox
[5]http://www.brightbox.co.uk/
_______________________________________________
Rancid-discuss mailing list
[7]http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
[9]http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
References
2. http://www.rickyninja.net/rancid/dlogin-dev
4. http://dlogin.gh/
5. http://www.brightbox.co.uk/
7. http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
9. http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Josh Rogers
2009-08-15 15:46:57 UTC
Permalink
Post by Jeremy Singletary
Did you look into what John Heasley suggested previously about trying
the SMC scripts?
I did try, but had trouble getting them to work. They want to call
hpuifilter, which doesn't connect for some reason, and I didn't get any
further.

I continued working on getting drancid/dlogin to work, and managed to get it
to get past 'show vlan' more prompt hanging by removing the carrot ^ from
the RE. Now, it completes the commands and shows it properly, but when it
issues the final 'exit' command to disconnect, its picking up the
"Connection closed by..." string created by the session closing and believes
it did not close cleanly.



On Fri, Aug 14, 2009 at 11:23 PM, Jeremy Singletary
Post by Jeremy Singletary
You'll also need a modified rancid-fe that recognizes the dell string in
router.db and calls drancid.
Did you look into what John Heasley suggested previously about trying
the SMC scripts?
-jeremy
What steps are necessary to monitor Dell switches? Download drancid,
dlogin and put them in /opt/local/libexec/rancid with other rancid
executables, then what? Update router.db and specify a device as a
'dell' instead of 'cisco' or 'juniper'
Is that basically it?
On Fri, Aug 14, 2009 at 9:45 PM, Jeremy Singletary
Looks like there are some invisible characters showing up in the
pager
in newer Dells. Download this version of dlogin, and let us know
if it
resolves the issue.
[2]http://www.rickyninja.net/rancid/dlogin-dev
Thanks,
Jeremy
Hi,
My thanks to Jeremy Singletary for his drancid/dlogin scripts, and
Nate
Steffen for his updates and email help.
I've had a couple of different problems trying to get RANCID working
with some Dell Powerconnect switches recently.
I'm using rancid 2.3.2a7 from the Ubuntu package on Ubuntu Hardy
amd64.
My Powerconnects are 6248s running 2.0.1.2 and 2.2.0.3 and 5324s
running
2.0.0.40.
The 6248s had an easy problem - the dlogin script is sending "exit"
and
expecting to get out, but that only takes it out of enable mode. It
then
needs to send "quit" (*not* "exit" again) afterwards to get out.
672a673
dsend "quit\r"
On the 5348 (where "exit" from enable mode logs you off...sigh...) I
think there's a problem with the pager. My "more" prompts look like
"More: <space>, Quit: q, One line: <return> "
and dlogin freezes when it sees one. Other than that it works fine.
I
guess there's a problem with the regex but I can't work out what it
is.
Would be grateful for any suggestions.
Cheers.
--
George Hills
Systems Administrator
Brightbox
[5]http://www.brightbox.co.uk/
_______________________________________________
Rancid-discuss mailing list
[7]http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
[9]http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
References
2. http://www.rickyninja.net/rancid/dlogin-dev
4. http://dlogin.gh/
5. http://www.brightbox.co.uk/
7. http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
9. http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
john heasley
2009-08-17 19:52:39 UTC
Permalink
Post by Josh Rogers
Post by Jeremy Singletary
Did you look into what John Heasley suggested previously about trying
the SMC scripts?
I did try, but had trouble getting them to work. They want to call
hpuifilter, which doesn't connect for some reason, and I didn't get any
further.
what do you mean by 'doent't connect for some reason'?
Post by Josh Rogers
I continued working on getting drancid/dlogin to work, and managed to get it
to get past 'show vlan' more prompt hanging by removing the carrot ^ from
the RE.
removing the anchor is a mistake. i'd guess it doesnt match because there
are probably control characters before the prompt.
Post by Josh Rogers
Now, it completes the commands and shows it properly, but when it
issues the final 'exit' command to disconnect, its picking up the
"Connection closed by..." string created by the session closing and believes
it did not close cleanly.
On Fri, Aug 14, 2009 at 11:23 PM, Jeremy Singletary
Post by Jeremy Singletary
You'll also need a modified rancid-fe that recognizes the dell string in
router.db and calls drancid.
Did you look into what John Heasley suggested previously about trying
the SMC scripts?
-jeremy
What steps are necessary to monitor Dell switches? Download drancid,
dlogin and put them in /opt/local/libexec/rancid with other rancid
executables, then what? Update router.db and specify a device as a
'dell' instead of 'cisco' or 'juniper'
Is that basically it?
On Fri, Aug 14, 2009 at 9:45 PM, Jeremy Singletary
Looks like there are some invisible characters showing up in the
pager
in newer Dells. Download this version of dlogin, and let us know
if it
resolves the issue.
[2]http://www.rickyninja.net/rancid/dlogin-dev
Thanks,
Jeremy
Hi,
My thanks to Jeremy Singletary for his drancid/dlogin scripts, and
Nate
Steffen for his updates and email help.
I've had a couple of different problems trying to get RANCID working
with some Dell Powerconnect switches recently.
I'm using rancid 2.3.2a7 from the Ubuntu package on Ubuntu Hardy
amd64.
My Powerconnects are 6248s running 2.0.1.2 and 2.2.0.3 and 5324s
running
2.0.0.40.
The 6248s had an easy problem - the dlogin script is sending "exit"
and
expecting to get out, but that only takes it out of enable mode. It
then
needs to send "quit" (*not* "exit" again) afterwards to get out.
672a673
dsend "quit\r"
On the 5348 (where "exit" from enable mode logs you off...sigh...) I
think there's a problem with the pager. My "more" prompts look like
"More: <space>, Quit: q, One line: <return> "
and dlogin freezes when it sees one. Other than that it works fine.
I
guess there's a problem with the regex but I can't work out what it
is.
Would be grateful for any suggestions.
Cheers.
--
George Hills
Systems Administrator
Brightbox
[5]http://www.brightbox.co.uk/
_______________________________________________
Rancid-discuss mailing list
[7]http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
[9]http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
References
2. http://www.rickyninja.net/rancid/dlogin-dev
4. http://dlogin.gh/
5. http://www.brightbox.co.uk/
7. http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
9. http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
George Hills
2009-08-15 12:03:49 UTC
Permalink
Post by Jeremy Singletary
Looks like there are some invisible characters showing up in the pager
in newer Dells. Download this version of dlogin, and let us know if
it resolves the issue.
http://www.rickyninja.net/rancid/dlogin-dev
It does indeed - a "dlogin -c "show run" $device" now completes
succesfully. I can see it answering the "More" prompts in the output.

drancid doesn't work though, do I need to make similar changes in that?

Cheers.
--
George Hills
Systems Administrator
Brightbox
http://www.brightbox.co.uk/
Josh Rogers
2009-08-15 15:07:05 UTC
Permalink
George,

Does 'show vlan' work ok with this new prompt for you? other commands seem
to work fine, but 'show vlan' hangs at the first prompt until timeout. My
prompt is the same as yours.

-Josh
Post by George Hills
Post by Jeremy Singletary
Looks like there are some invisible characters showing up in the pager
in newer Dells. Download this version of dlogin, and let us know if
it resolves the issue.
http://www.rickyninja.net/rancid/dlogin-dev
It does indeed - a "dlogin -c "show run" $device" now completes
succesfully. I can see it answering the "More" prompts in the output.
drancid doesn't work though, do I need to make similar changes in that?
Cheers.
--
George Hills
Systems Administrator
Brightbox
http://www.brightbox.co.uk/
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
George Hills
2009-08-15 17:58:37 UTC
Permalink
Hi,
Post by Josh Rogers
Does 'show vlan' work ok with this new prompt for you? other commands
seem to work fine, but 'show vlan' hangs at the first prompt until
timeout. My prompt is the same as yours.
Yes, "show vlan" works fine, but then I only have a handful of VLANs so
the output isn't long enough to reach a "More" prompt...!

If I do
dlogin -c "show version ; show vlan ; show run"
for one of the affected devices, it works fine - but running drancid
against it is failing.

Cheers
--
George Hills
Systems Administrator
Brightbox
http://www.brightbox.co.uk/
Jeremy Singletary
2009-08-15 20:10:29 UTC
Permalink
It seems like the exit that gets sent is not showing up in the dlogin
output. drancid looks for the prompt followed by the word exit to set
the clean_run variable.

It looks like this in my output:
#eConnection closed by foreign host.

the xit is missing between the e and Connection. This is my best guess
at the moment. I'll let you know if I get any closer to fixing it.
Post by George Hills
Post by Jeremy Singletary
Looks like there are some invisible characters showing up in the pager
in newer Dells. Download this version of dlogin, and let us know if
it resolves the issue.
http://www.rickyninja.net/rancid/dlogin-dev
It does indeed - a "dlogin -c "show run" $device" now completes
succesfully. I can see it answering the "More" prompts in the output.
drancid doesn't work though, do I need to make similar changes in that?
Cheers.
--
George Hills
Systems Administrator
Brightbox
http://www.brightbox.co.uk/
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Jeremy Singletary
2009-08-17 03:52:11 UTC
Permalink
I've made another change that should fix this.

Download http://www.rickyninja.net/rancid/dlogin-dev again, and let me
know if it works for you.

-jeremy
George Hills
2009-08-17 08:53:18 UTC
Permalink
Hi,

Thank you for spending so much time on this. It's much appreciated.
Post by Jeremy Singletary
I've made another change that should fix this.
Download http://www.rickyninja.net/rancid/dlogin-dev again, and let me
know if it works for you.
With this latest change, it is good for the 5324s. It fails on the 6248s
now though. I'm not quite sure exactly what's going on, but if I do a
dlogin -c "show run"
it hangs forever at the first "More" prompt.

rancid-run is producing output like the below in the log, for 6248s. All
well for 5324s though:

Cheers

starting: Mon Aug 17 09:33:55 BST 2009

cvs add: Re-adding file `SWITCHNAME' after dead revision 1.3.
cvs add: use `cvs commit' to add this file permanently
/var/lib/rancid/CVS/switches/configs/SWITCHNAME,v <-- SWITCHNAME
new revision: 1.4; previous revision: 1.3
Added SWITCHNAME



Trying to get all of the configs.
opened network stream from SWITCHNAME if () at
/usr/lib/rancid/bin/drancid line 267.
FOUND PROMPT: switch3.cl0#
FOUND PROMPT: switch3.cl0#
can't read "in_proc": no such variable
while executing
"if { $in_proc} {
return 1
} else {
continue
}"
invoked from within
"expect -nobrace -re+ { exp_continue } -re {^[^
^M *]*#} { send_user -- "$expect_out(buffer)" } -re {^[^
^M *]*#} { send_user -- "$expect_out(buffer)" ..."
invoked from within
"expect {
-re "\b+" { exp_continue }
-re "^\[^\n\r *]*$reprompt" { send_user --
"$expect_out(buffer)" }
..."
(procedure "processCommandOutput" line 2)
invoked from within
"processCommandOutput $prompt $reprompt"
invoked from within
"if [ string match "*\;*" "$command" ] {
set commands [split $command \;]
set num_commands [llength $commands]
for {set i 0} {$..."
(procedure "run_commands" line 13)
invoked from within
"run_commands $prompt $command"
("foreach" body line 146)
invoked from within
"foreach router [lrange $argv $i end] {
set router [string tolower $router]
send_user "$router\n"

# Figure out the prompt.
# autoenabl..."
--
George Hills
Systems Administrator
Brightbox
http://www.brightbox.co.uk/
Jeremy Singletary
2009-08-18 03:23:30 UTC
Permalink
I think I broke the variable scope for $in_proc when I created a new
procedure to eliminate some duplicate code. It's hard to say for
certain because I am unable to reproduce the problem on my side. Grab
dlogin-dev again and let me know how it goes. If this doesn't fix it,
any chance I can get access to one of the devices in question with a
barebones config?

-jeremy
George Hills
2009-08-18 09:16:37 UTC
Permalink
Hi,
Post by Jeremy Singletary
I think I broke the variable scope for $in_proc when I created a new
procedure to eliminate some duplicate code. It's hard to say for
certain because I am unable to reproduce the problem on my side. Grab
dlogin-dev again and let me know how it goes.
This one is exactly the same as the last. Thanks for trying.

Right. I might have been wasting your time by not reading your code.

The "old" dlogin used to have separate checks for different forms of the
"More" prompt I think? The new one looks to just have a check for
"More:"? My prompt on the 6248 looks like "--More-- or (q)uit".

Without really understanding what it does, I've put the following in and
now it runs succesfully for both types of switch - though still with the
"needs an extra 'quit'" issue on the 6248.

-re "^--More-- \[^\n\r]*" {
send_user -- "$expect_out(buffer)"
dsend " "
exp_continue
}
Post by Jeremy Singletary
If this doesn't fix it,
any chance I can get access to one of the devices in question with a
barebones config?
Just now my "dev" devices are being used for another project, but in a
few weeks time that ought to be possible if still wanted.

Cheers
--
George Hills
Systems Administrator
Brightbox
http://www.brightbox.co.uk/
Jeremy Singletary
2009-08-18 16:45:42 UTC
Permalink
I've only seen one version of a more prompt in the Dells I've had access
to. I removed the check for the other more prompts thinking they were
left over from clogin and only applicable for Cisco devices. It's ok
though, this is why I've had you downloading the dev code that isn't
linked on rickyninja.net.

Sounds like you've got it mostly working for the time being. Let me
know when the dev devices become available, and you can email me
directly so only I'll have the login info. Then I'll work on the quit
issue, and anything else we notice along the way.

-jeremy
Post by George Hills
Hi,
Post by Jeremy Singletary
I think I broke the variable scope for $in_proc when I created a new
procedure to eliminate some duplicate code. It's hard to say for
certain because I am unable to reproduce the problem on my side. Grab
dlogin-dev again and let me know how it goes.
This one is exactly the same as the last. Thanks for trying.
Right. I might have been wasting your time by not reading your code.
The "old" dlogin used to have separate checks for different forms of the
"More" prompt I think? The new one looks to just have a check for
"More:"? My prompt on the 6248 looks like "--More-- or (q)uit".
Without really understanding what it does, I've put the following in and
now it runs succesfully for both types of switch - though still with the
"needs an extra 'quit'" issue on the 6248.
-re "^--More-- \[^\n\r]*" {
send_user -- "$expect_out(buffer)"
dsend " "
exp_continue
}
Post by Jeremy Singletary
If this doesn't fix it,
any chance I can get access to one of the devices in question with a
barebones config?
Just now my "dev" devices are being used for another project, but in a
few weeks time that ought to be possible if still wanted.
Cheers
--
George Hills
Systems Administrator
Brightbox
http://www.brightbox.co.uk/
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
George Hills
2009-08-18 09:23:07 UTC
Permalink
One more thing:

Without really understanding what it does, I've put the following in and
now it runs succesfully for both types of switch - though still with the
"needs an extra 'quit'" issue on the 6248.

-re "^--More-- \[^\n\r]*" {
send_user -- "$expect_out(buffer)"
dsend " "
exp_continue
}

One set of 6248 software prompts are ^-- the other are ^ --
(ie first character is space).

aaargh.
--
George Hills
Systems Administrator
Brightbox
http://www.brightbox.co.uk/
Loading...