[rancid] Cisco ACS 5.5

Paweł Rzepa pawel.rzepa at gmail.com
Wed Apr 30 07:13:28 UTC 2014


Hi,
No, it doesn't hang. When I login into the device interactively it
works. When I run a command it produces unpredictable results, imho
depending on the chunks of output retrieved from the device.

This is the excerpt from clogin -d -c 'write term' output which I
suppose is relevant to the issue:

expect: does "ip domain-name my.company.com\r\n!        \r\nno ipv6
enable\r\n!        \r\ninterface GigabitEthernet 0\r\n  ip address
10.10.10.10 255.255.255.0\r\n  ipv6 address autoconfig\r\n  no ipv6
enable\r\n!        \r\ninterface GigabitEthernet 1\r\n  shutdown\r\n
ipv6 address autoconfig\r\n  no ipv6 enable\r\n!        \r\nip
name-server 10.10.10.10 10.10.10.10 \r\n!        \r\nip
default-gateway 10.10.10.10\r\n!        \r\nclock timezone
Europe/Warsaw\r\n!        \r\nntp server
10.10.10.10\r\n!\u0008\nusername root password hash
$1$p4MxVbAdp$asdfasdfasdfasd role admin \r\n!\u0008\nno
max-ssh-sessions\r\n!\u0008\n" (spawn_id exp6) match regular
expression "\u0008+"? yes
expect: set expect_out(0,string) "\u0008"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "ip domain-name my.company.com\r\n!
   \r\nno ipv6 enable\r\n!        \r\ninterface GigabitEthernet 0\r\n
ip address 10.10.10.10 255.255.255.0\r\n  ipv6 address autoconfig\r\n
no ipv6 enable\r\n!        \r\ninterface GigabitEthernet 1\r\n
shutdown\r\n  ipv6 address autoconfig\r\n  no ipv6 enable\r\n!
\r\nip name-server 10.10.10.10 10.10.10.10 \r\n!        \r\nip
default-gateway 10.10.10.10\r\n!        \r\nclock timezone
Europe/Warsaw\r\n!        \r\nntp server 10.10.10.10\r\n!\u0008"
expect: continuing expect

expect: does "\nusername root password hash
$1$p4MxVbAdp$asdfasdfasdfasd role admin \r\n!\u0008\nno
max-ssh-sessions\r\n!\u0008\n" (spawn_id exp6) match regular
expression "\u0008+"? yes
expect: set expect_out(0,string) "\u0008"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "\nusername root password hash
$1$p4MxVbAdp$asdfasdfasdfasd role admin \r\n!\u0008"
expect: continuing expect

expect version 5.43.0
rancid 2.3.8

Regards,
Pawel Rzepa

2014-04-29 15:54 GMT+02:00 heasley <heas at shrubbery.net>:
> Tue, Apr 29, 2014 at 01:57:57PM +0200, Pawe?? Rzepa:
>> Hi,
>> I use rancid to download configuration from Cisco ACS. I have adopted
>> rancid a little and finally got it working. After recent upgrade to
>> 5.5 it stopped gathering configuration.
>> Investigation showed that the reason was exp_continue in proc
>> run_commands for -re "\b+" :
>> proc run_commands { prompt command } {
>>     global do_saveconfig in_proc platform
>> ...
>>     for {set i 0} {$i < $num_commands} { incr i} {
>>     send -- "[subst -nocommands [lindex $commands $i]]\r"
>>     expect {
>> #       -re "\b+"               { exp_continue }       --------------
>> MUST HAVE DISABLED IT
>>         -re "^\[^\n\r *]*$reprompt"     { send_user -- "$expect_out(buffer)"
>>                         }
>>         -re "^\[^\n\r]*$reprompt."      { send_user -- "$expect_out(buffer)"
>>                           exp_continue
>>                         }
>>     ...........
>>
>>
>> Now I got all the configuration lines, but '\b' is here. How can I
>> remove all occurrences of '\b' from the buffer before it is printed
>> out?
>
> the line that you have commented should have consumed the backspaces.
> what is the behavior when it fails (hangs, simply fails)?  what version
> of expect do you have?  what version of rancid?


More information about the Rancid-discuss mailing list