[rancid] Working with an HP Procurve 2900-48G and 2910al-48G

Jeff B jeffb.list at gmail.com
Wed Sep 8 13:05:04 UTC 2010


Hello I'm new to rancid and I'm trying to set up these two HP Procurve Switches:

ProCurve J9050A Switch 2900-48G, revision T.13.71, ROM K.12.12
(/sw/code/build/mbm(t3a))
ProCurve J9147A 2910al-48G Switch, revision W.14.50, ROM W.14.04

I'm having several different problems which I'll describe,  at first I
was unsure if I should be using hlogin or flogin but now I'm pretty
sure that I need to be using hlogin because the foundry command to
turn off paging is not understood.  Ironically I get farther with
flogin than I'm able to with hlogin.

When I use hlogin I get to 2 different points depending on if I'm
using telnet or ssh to connect to it.  When using telnet I get the
following error

Command:
 hlogin -c "show version" hpswitch-telnet.example.com

Result:
After it sends the 'no page' command it errors on this:

===
couldn't compile regular expression pattern: parentheses () not balanced
    while executing
"expect {
        -re $reprompt   {}
        -re "\[\n\r]+"  { exp_continue }
    }"
    (procedure "run_commands" line 9)
    invoked from within
"run_commands $prompt $command"
    ("foreach" body line 161)
    invoked from within
"foreach router [lrange $argv $i end] {
    set router [string tolower $router]
    send_user "$router\n"

    # device timeout
    set timeout [find t..."
    (file "/usr/local/rancid/bin/hlogin" line 607)
===

I've tried 'fixing' the regex but I don't know enough expect to get
it.  Here are the two lines of regex that populate $reprompt:

    regsub -all {[)(]} $prompt {\\&} reprompt
    regsub -all {^(.{1,11}).*([#>])$} $reprompt
{\1([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?} reprompt
    expect {
        -re $reprompt   {}
        -re "\[\n\r]+"  { exp_continue }
    }


When I use SSH to connect to the switch I have a problem with the
hpuifilter not working right and dropping characters so expect never
finds what it's looking for.

Command:
 hlogin -c "show version" hpswitch-ssh.example.com

Result:
<ssh and banner output>
ranciduser at hpswitch-ssh.example.com's passwor :

And since it's missing the d on password expect never matches and it times out.

I've tried tinkering with the regex above and looked at hpuifilter.c
but my novice understanding of expect and the behavior of hpuifilter
wasn't able to resolve these problems.  any help would be appreciated.
Thank You.

-JeffB


More information about the Rancid-discuss mailing list