[rancid] Prompt issue on Alcatel using alulogin : Stop after the first command

Mathieu Poussin mathieu.poussin at netyxia.net
Mon Jan 13 14:50:22 UTC 2014


Hello,

I need to setup rancid to backup many Alcatel Omniswitch.

It looks like alulogin is wrote for old version of alcatel Omniswitch,

I did modifications about prompts and "no more" commands to make it compatible.

Everything run fine until I run the first command :

rancid at RSFRGUY-TESTMON:~/bin$ ./alulogin -c "show cmm" SW-ALCATEL-TEST1
sw-alcatel-test1
spawn telnet sw-alcatel-test1
Trying 30.0.0.3...
Connected to SW-ALCATEL-TEST1.
Escape character is '^]'.
login : admin
password :

Welcome to the Alcatel-Lucent OmniSwitch 6000
Software Version 6.4.4.343.R01 GA, June 23, 2011.

Copyright(c), 1994-2011 Alcatel-Lucent. All Rights reserved.

OmniSwitch(TM) is a trademark of Alcatel-Lucent registered
in the United States Patent and Trademark Office.

->
-> no more
-> show cmm
CMM in slot 1
  Model Name:                    OS6850-48X,
  Description:                   CMM,
  Part Number:                   902462-90,
  Hardware Revision:             07,
  Serial Number:                 M4381085,
  Manufacture Date:              OCT 21 2011,
  Firmware Version:              ,
  Admin Status:                  POWER ON,
  Operational Status:            UP,
  Power Consumption:             115,
  Power Control Checksum:        0xb87e,
  CPU Model Type   :             Motorola MPC8248,
  MAC Address:                   e8:e7:32:26:fd:18,




Error: TIMEOUT reached

Here is what I get from debug for the same command:

expect: does "  MAC Address:
e8:e7:32:26:fd:18,\r\n\r\n\r\n\r\n-> " (spawn_id exp6) match regular
expression "\u0008+"? (No Gate, RE only) gate=yes re=no
"^[^\n\r *]*\r\n-> "? Gate "*\r\n-> "? gate=yes re=no
"^[^\n\r]*\r\n-> ."? Gate "*\r\n-> ?"? gate=no
"^--More--[\r\n]+"? Gate "--More--*"? gate=no
"[\n\r]+"? (No Gate, RE only) gate=yes re=yes
expect: set expect_out(0,string) "\r\n\r\n\r\n\r\n"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "  MAC Address:
e8:e7:32:26:fd:18,\r\n\r\n\r\n\r\n"
expect: continuing expect

expect: does "-> " (spawn_id exp6) match regular expression "\u0008+"?
(No Gate, RE only) gate=yes re=no
"^[^\n\r *]*\r\n-> "? Gate "*\r\n-> "? gate=no
"^[^\n\r]*\r\n-> ."? Gate "*\r\n-> ?"? gate=no
"^--More--[\r\n]+"? Gate "--More--*"? gate=no
"[\n\r]+"? (No Gate, RE only) gate=yes re=no
"[^\r\n]*Press <SPACE> to cont[^\r\n]*"? Gate "*Press <SPACE> to cont*"? gate=no
"Press any key to continue (Q to quit)[^\r\n]*"? Gate "Press any key
to continue Q to quit*"? gate=no
"^ *--More--[^\n\r]*"? Gate "*--More--*"? gate=no
"^<-+ More -+>[^\n\r]*"? (No Gate, RE only) gate=yes re=no
expect: timed out

The prompt is always "-> ", I've done modifications on the alulogin file.

Here are the modifications I made :

398a399
>
645c646
<     send "environment no more\r"
---
>     send "no more\r"
868c869
<       set u_prompt "(Username|Login|login|user name|User):"
---
>       set u_prompt "(Username|Login|login|user name|User) :"
874c875
<       set p_prompt "(\[Pp]assword|passwd|Enter password for \[^ :]+):"
---
>       set p_prompt "(\[Pp]assword|passwd|Enter password for \[^ :]+) :"
880c881
<       set e_prompt "\[Pp]assword:"
---
>       set e_prompt "\[Pp]assword :"
884a886,889
>     set prompt [find prompt $router]
>     if { "$prompt" == "" } {
>         set prompt "-> "
>     }
920c925,926
<       -re "\[\r\n]+"          { exp_continue; }
---
>       #-re "\[\r\n]+"         { exp_continue; }
>         -re "^.$prompt" { exp_continue }

I can't find what can be the problem, i'm new to rancid and not an
expert in Perl.

Can you help me ?

Thank you.

Best regards,
Mathieu


More information about the Rancid-discuss mailing list