[rancid] diff to make rancid work with HP 2810-24G and tacacs+ authentication

heasley heas at shrubbery.net
Fri Jul 27 18:35:53 UTC 2012


Fri, Jul 13, 2012 at 10:59:45AM +0200, Johan Ryberg:
> Hi.
> 
> I where having big problems when I enabled tacacs authentication for
> HP 2810-24G switches and I found two issues that made rancid
> (hpuifilder) to consume 100% cpu and it hang there forever.
> 
> First problem, the enable prompt
> The switch are using "Login:" and I think this could be changed in the
> default userprompt from "(Username|login|user name):" to
> "(Username|[Ll]ogin|user name):"
> --- /usr/local/bin/hlogin       Fri Jul 13 10:12:12 2012
> +++ hlogin      Fri Jul 13 10:58:19 2012
> @@ -697,7 +697,7 @@
>       # Figure out prompts
>       set u_prompt [find userprompt $router]
>       if { "$u_prompt" == "" } {
> -       set u_prompt "(Username|login|user name):"
> +       set u_prompt "(Username|[Ll]ogin|user name):"
>       } else {
>          set u_prompt [join [lindex $u_prompt 0] ""]
>       }

committed.

> Second problem, hlogin was to fast to enter the enable command after
> login. The only letters that where written to the console was "nable".
> I could reproduce this every time. The fix was to add a sleep in
> hlogin after the "welcome prompt"
> 
> --- /usr/local/bin/hlogin  Fri Jul 13 10:40:23 2012
> +++ /usr/local/bin/hlogin       Fri Jul 13 10:12:12 2012
> @@ -394,6 +394,7 @@
>       expect {
>          "Press any key to continue" {
>              send " "
> +            sleep 1
>              exp_continue
>          }
>          "Enter switch number to connect to or <CR>:" {
> 
> For the record. I'm using rancid 2.3.8 on OpenBSD 5.1

Are you sure?  usually when behavior like occurs, its more likely that it
matched something in the preceeding output.  i asked because this kind of
usually just moves the problem elsewhere.  it might just be better to deal
with recovering from the error and re-enter 'enable'.


More information about the Rancid-discuss mailing list