[rancid] Rancid submits random characters after logon - causes config read failure

Per-Olof Olsson peo at chalmers.se
Tue Sep 16 20:47:28 UTC 2014


Sorry.
Worked from home. Tested again from office and 3s sleep was not to any help at all.
I see ^[[__;__R almost every login.


But first, restart from the beginning:
---------------------------------------
 > I can see this by running /bin/clogin 10.100.20.149 and seeing that I get
 > dropped to the following:
 >
 > HP_SWITCH_1# ^[[46;148R
 > HP_SWITCH_1#
 >
 > So Rancid is issuing the manager username and password and then issuing
 > ^[[46;148R which the switch doesn't understand, Rancid, having not received
 > the config, disconnects and moves on. I can Telnet into these switches from
 > Rancid just fine using the manager logon so I know it's not an issue there.
 > I just can't understand why Rancid seems to be issuing this random string
 > of characters after it logs onto these particular switches.

Please check that you have added
   "add autoenable <switch_name|ip> 1"
in your .cloginrc, for your 3 new switches.
I think you try to login directly to manager level.
If missing "autoenable" login will hang on first prompter and time out.
test hlogin with hlogin...
----------------------------------


Back to ^[[__;__R characters.

I will say it's a timing problem in some new HP-switches (2910,2920).
The switch don't turn of echo, when waiting for window size answer, in a safe way.
Have talked to HP-support in Sweden about this so they know about this.

clogin can't be used for HP's. It's not using any filter at all.

hpuifilter will block window size request "ESC[6n" so I think it's not a problem in batch mode.
It's just interactive mode that shows this extra characters because it not using hpuifilter.

Yes I have added some fixes to my hlogin, but have't seen any problem running backup on switches that
show extra character in interactive mode. We don't use to run hlogin in interactive mode often, but if,
just ignore extra characters.

My ideas what to do:
1. Add hpuifilter in interactive mode and lose some nice terminal settings.
    As it was in some previous versions of hlogin.

2. Create new version of hpuifilter (or option switch to hpuifilter) that just remove
        "\x1B\\[[0-9]+;[0-9]+R", and use it in interactive mode.

3. Add hlogin option, to hide login and banner part, up to interactive prompt.
    Just don't show those characters.

4. Or simple, just ignore it and wait until HP do some fixes.



Neil Arnold wrote 2014-09-16 12:02:
> I should have mentioned that I tried clogin after changing the sleep time to 3 as I use clogin for all my other HP switches and
> have had the most success with clogin. I have just tried the hlogin script with the amended sleep entry. The script will log onto
> the switch and then output terminal garbage, if I then press any keys like the arrow keys, etc, more garbage is echoed back to the
> screen. This tells me that it has entered a terminal mode but one which the switch doesn't recognise. As I say, clogin is much
> more successful and despite issuing a random terminal letter/symbol/number sequence as soon as it logs on, I am still left with a
> logged in and responsive terminal.
>
>
> On 12 September 2014 21:03, Per-Olof Olsson <peo at chalmers.se <mailto:peo at chalmers.se>> wrote:
>
>     Hello
>
>     Have someone tested to extend the time, device and tty driver have to negotiate
>     window size at login, before expect start to analyze text?
>
>     Seems to work if I use "sleep 3"
>
>     *** hlogin_ORG  2014-09-12 21:38:09.543395741 +0200
>     --- hlogin      2014-09-12 21:39:58.679120629 +0200
>     ...
>     ***************
>     *** 361,367 ****
>                  send_user "\nError: unknown connection method: $prog\n"
>                  return 1
>              }
>     !       sleep 0.3
>
>              # This helps cleanup each expect clause.
>              expect_after {
>     --- 404,410 ----
>                  send_user "\nError: unknown connection method: $prog\n"
>                  return 1
>              }
>     !       sleep 3
>
>              # This helps cleanup each expect clause.
>              expect_after {
>     ***************
>     ...
>
>     clogin to HP-switches...
>     Anyhow, tests using "sleep 3" seems to eliminate window size echo, even for clogin to HPs.
>
>
>     /Peo
>
...

/Peo
----------------------------------------------------------
Per-Olof Olsson               Email: peo at chalmers.se
Chalmers tekniska högskola    IT-service
Arvid Hedvalls backe 6        412 96 Göteborg
Tel: 031/772 6738  Fax: 031/772 8680
----------------------------------------------------------


More information about the Rancid-discuss mailing list