Mailing List Archive

Trouble with alogin
Hey!

I'm finally trying to get our Alteon's incorporated into rancid.
When I run alogin against one of them, I get this output:

------------------------------------------------------------
[Main Menu]
info - Information Menu
stats - Statistics Menu
cfg - Configuration Menu
oper - Operations Command Menu
boot - Boot Options Menu
maint - Maintenance Menu
diff - Show pending config changes [global command]
apply - Apply pending config changes [global command]
save - Save updated config to FLASH [global command]
revert - Revert pending or applied changes [global command]
exit - Exit [global command, always available]

>> Main# expected boolean value but got ""
while executing
"if {[login $router $ruser $userpswd $passwd $prompt $cmethod $cyphertype]} {
continue
}"
("foreach" body line 59)
invoked from within
"foreach router [lrange $argv $i end] {
set router [string tolower $router]
send_user "$router\n"

# Figure out prompt.
set prompt ">> ..."
(file "/home/rancid/bin/alogin" line 421)

It successfully logs in, but then it seems to croak. Any ideas? I don't
speak expect, so use small words. :)

Thanks!

-David



--
David Williamson | "Wine is light, held
Certainty Solutions, Inc. | together by water."
davidw at certaintysolutions.com | -Galileo
Trouble with alogin [ In reply to ]
Wed, Feb 13, 2002 at 03:16:31PM -0800, David Williamson:
> Hey!
>
> I'm finally trying to get our Alteon's incorporated into rancid.
> When I run alogin against one of them, I get this output:
>
> ------------------------------------------------------------
> [Main Menu]
> info - Information Menu
> stats - Statistics Menu
> cfg - Configuration Menu
> oper - Operations Command Menu
> boot - Boot Options Menu
> maint - Maintenance Menu
> diff - Show pending config changes [global command]
> apply - Apply pending config changes [global command]
> save - Save updated config to FLASH [global command]
> revert - Revert pending or applied changes [global command]
> exit - Exit [global command, always available]
>
> >> Main# expected boolean value but got ""
> while executing
> "if {[login $router $ruser $userpswd $passwd $prompt $cmethod $cyphertype]} {
> continue
> }"
> ("foreach" body line 59)
> invoked from within
> "foreach router [lrange $argv $i end] {
> set router [string tolower $router]
> send_user "$router\n"
>
> # Figure out prompt.
> set prompt ">> ..."
> (file "/home/rancid/bin/alogin" line 421)
>
> It successfully logs in, but then it seems to croak. Any ideas? I don't

i suspect that there is a return statement in the login procedure that
doesnt return a number value or it's an implicit return perhaps due to
an empty $cmethod variable.

what version of rancid?

> speak expect, so use small words. :)

do more crack. that'l help you understand expect.
Trouble with alogin [ In reply to ]
On Wed, Feb 13, 2002 at 03:38:49PM -0800, john heasley wrote:
> i suspect that there is a return statement in the login procedure that
> doesnt return a number value or it's an implicit return perhaps due to
> an empty $cmethod variable.
>
> what version of rancid?

2.2. Downloaded it today. Hmm...

-David

--
David Williamson | "Wine is light, held
Certainty Solutions, Inc. | together by water."
davidw at certaintysolutions.com | -Galileo
Trouble with alogin [ In reply to ]
Wed, Feb 13, 2002 at 04:51:24PM -0800, David Williamson:
> On Wed, Feb 13, 2002 at 03:38:49PM -0800, john heasley wrote:
> > i suspect that there is a return statement in the login procedure that
> > doesnt return a number value or it's an implicit return perhaps due to
> > an empty $cmethod variable.
> >
> > what version of rancid?
>
> 2.2. Downloaded it today. Hmm...
>
> -David

try the attached patch

cd rancid-2.2/bin
patch < file

if it fixes the problem expect bomb-out, then i;m slightly confused as to
how it manages to login but ends up here.
-------------- next part --------------
*** alogin.in.FCS Sat Dec 8 01:04:37 2001
--- alogin.in Thu Feb 14 00:59:29 2002
***************
*** 365,371 ****
}
set in_proc 0
return 0
! }
}

# Run commands given on the command line.
--- 365,372 ----
}
set in_proc 0
return 0
! }
! return 1
}

# Run commands given on the command line.
Trouble with alogin [ In reply to ]
On Wed, Feb 13, 2002 at 05:05:15PM -0800, john heasley wrote:
> try the attached patch
>
> cd rancid-2.2/bin
> patch < file
>
> if it fixes the problem expect bomb-out, then i;m slightly confused as to
> how it manages to login but ends up here.

It no longer gives the error, but it doesn't stay logged in:

revert - Revert pending or applied changes [global command]
exit - Exit [global command, always available]

>> Main# bash-2.02$
bash-2.02$

That doesn't seem good, since you can't go on to execute commands.
By the way, the switch is running WebOS 9.0.38-SSH. Don't know if that
will matter. Oh, and I'm not using ssh to get to it...just telnet.
My .cloginrc is pretty simple...it just has 'add password <alteon>
<password>'. Nothing exciting there.

-David
Trouble with alogin [ In reply to ]
Wed, Feb 13, 2002 at 09:44:07PM -0800, David Williamson:
> On Wed, Feb 13, 2002 at 05:30:05PM -0800, john heasley wrote:
> > i think i see...that patch i sent should have been 'return 0' for
> > line 369. we see the prompt, break out of the loop. so, if you
> > mv alogin.in.FCS to alogin.in (ie: start over) and apply the
> > attached patch, i think that'l do it.
>
> That does the trick. When I run alogin by hand, I get onto the box, and
> then I sit there, waiting for the next input. That sounds about right.
>
> Oh, and do-diffs now works correctly. Whee!
>
> Thanks very much!
>
> -David

thanks. patch is appended for the edification of other lurkers.
-------------- next part --------------
*** alogin.in.FCS Sat Dec 8 01:04:37 2001
--- alogin.in Thu Feb 14 01:28:44 2002
***************
*** 363,371 ****
}
"\r\n" { exp_continue; }
}
set in_proc 0
return 0
- }
}

# Run commands given on the command line.
--- 363,371 ----
}
"\r\n" { exp_continue; }
}
+ }
set in_proc 0
return 0
}

# Run commands given on the command line.