[rancid] Problem with custom device script

Brian Talley b225ccc at gmail.com
Fri Apr 8 20:25:07 UTC 2011


I'm creating a custom login script for a Crescendo load balancer device.  I
can log in to the device and get to interactive mode ok using the script,
but when I try to run commands with something like:

crescendologin -d -t 30 -c"show running" host

it appears that expect is trying to match on every character with output
like:

...
send: sending "show running\r" to { exp6 }

expect: does "" (spawn_id exp6) match regular expression "^[^\n\r]*root> "?
no
"^[^\n\r ]*>>.*root> "? no
"[\n\r]+"? no

expect: does "s" (spawn_id exp6) match regular expression "^[^\n\r]*root> "?
no
"^[^\n\r ]*>>.*root> "? no
"[\n\r]+"? no
expect: timed out

Error: TIMEOUT reached

I feel like I'm missing something obvious.  The pertinent section of
run_commands looks like:

    for {set i 0} {$i < $num_commands} { incr i} {
        send -- "[subst -nocommands [lindex $commands $i]]\r"
        expect {
                -re "^\[^\n\r]*$reprompt"      { exp_continue }
                -re "^\[^\n\r *]*$reprompt"     {}
                -re "\[\n\r]"                   { exp_continue }
        }
    }

And the actual prompt is "root> "

Thanks for any help.

BT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20110408/72ee16ab/attachment.html>


More information about the Rancid-discuss mailing list