Mailing List Archive

rancid 2.2.2 Problem
Howdy all, new to the list but I"m wondering if you guys can help me
out. I'm using clogin to log into a a group of cisco access points to
enable mac authentication on a given ssid on the dot11radio0 interface.

Like I said I"m using 2.2.2 on FreeBSD 4.10-Release.

I'm using a command file, of which I can literally copy and paste when
logging into the router manually, but when I try to process the command
file it doesn't hangs when adding the following command -
aaa group server radius rad_mac . When running the command through truss
to watch the system calls I see a signal 28 which is new screen,
obviously can't be right. My hypothesis looking through the clogin.in
is that there isn't a proper regular expression for the prompt which
you're presented after entering that command (it drops to a sub menu ala
sub interface). That prompt looks like this
WM036-1230-(config-sg-radius)# ... I would think it'd be okay since it
should probably just match text before a # (showing enabled) but what
the hell do I know. Any help afforded by you guys would be great


TIA


Len
rancid 2.2.2 Problem [ In reply to ]
Thu, Aug 26, 2004 at 08:46:50PM -0700, Len:
> Howdy all, new to the list but I"m wondering if you guys can help me
> out. I'm using clogin to log into a a group of cisco access points to
> enable mac authentication on a given ssid on the dot11radio0 interface.
>
> Like I said I"m using 2.2.2 on FreeBSD 4.10-Release.
>
> I'm using a command file, of which I can literally copy and paste when
> logging into the router manually, but when I try to process the command
> file it doesn't hangs when adding the following command -
> aaa group server radius rad_mac . When running the command through truss
> to watch the system calls I see a signal 28 which is new screen,
> obviously can't be right. My hypothesis looking through the clogin.in
> is that there isn't a proper regular expression for the prompt which
> you're presented after entering that command (it drops to a sub menu ala
> sub interface). That prompt looks like this
> WM036-1230-(config-sg-radius)# ... I would think it'd be okay since it

that looks like your prompt got truncated. that was fixed in 2.3, please
try 2.3.1 with expect 5.40 or greater. i believe that'l do it for you;
iirc, it truncates the prompt to no more that 14 chars, but what you have
above is only 11.

508 # match cisco config mode prompts too, such as router(config-if)#,
509 # but catalyst does not change in this fashion.
510 regsub -all {^(.{1,14}).*([#>])$} $reprompt {\1([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?} reprompt
511 expect {

i guess that'l have to be reduced to 10 or so. please try that out and
let me know.

again, note the expect version, prior version bugger the regex.

> should probably just match text before a # (showing enabled) but what
> the hell do I know. Any help afforded by you guys would be great
>
>
> TIA
>
>
> Len
rancid 2.2.2 Problem [ In reply to ]
No go.. I've upgraded to rancid 2.3.1 (Tcl 8.4.7 + expect 5.4.2) and it
now seems like my prompt is not cut off, but the hang still occurs. Is
there a max number of characters behind the # or some combo of that and
the quantity between the ( )s ?


-lenny



john heasley wrote:

> Thu, Aug 26, 2004 at 08:46:50PM -0700, Len:
>
>>Howdy all, new to the list but I"m wondering if you guys can help me
>>out. I'm using clogin to log into a a group of cisco access points to
>>enable mac authentication on a given ssid on the dot11radio0 interface.
>>
>> Like I said I"m using 2.2.2 on FreeBSD 4.10-Release.
>>
>>I'm using a command file, of which I can literally copy and paste when
>>logging into the router manually, but when I try to process the command
>>file it doesn't hangs when adding the following command -
>>aaa group server radius rad_mac . When running the command through truss
>>to watch the system calls I see a signal 28 which is new screen,
>>obviously can't be right. My hypothesis looking through the clogin.in
>>is that there isn't a proper regular expression for the prompt which
>>you're presented after entering that command (it drops to a sub menu ala
>>sub interface). That prompt looks like this
>>WM036-1230-(config-sg-radius)# ... I would think it'd be okay since it
>
>
> that looks like your prompt got truncated. that was fixed in 2.3, please
> try 2.3.1 with expect 5.40 or greater. i believe that'l do it for you;
> iirc, it truncates the prompt to no more that 14 chars, but what you have
> above is only 11.
>
> 508 # match cisco config mode prompts too, such as router(config-if)#,
> 509 # but catalyst does not change in this fashion.
> 510 regsub -all {^(.{1,14}).*([#>])$} $reprompt {\1([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?} reprompt
> 511 expect {
>
> i guess that'l have to be reduced to 10 or so. please try that out and
> let me know.
>
> again, note the expect version, prior version bugger the regex.
>
>
>>should probably just match text before a # (showing enabled) but what
>>the hell do I know. Any help afforded by you guys would be great
>>
>>
>>TIA
>>
>>
>>Len
>
>
rancid 2.2.2 Problem [ In reply to ]
On Thu, Aug 26, 2004 at 10:18:42PM -0700, Len wrote:
> >>I'm using a command file, of which I can literally copy and paste when
> >>logging into the router manually, but when I try to process the command
> >>file it doesn't hangs when adding the following command -

You seem to be running into problems with the prompt changing (enable
prompt, config prompt, config submode prompt, ...). rancid doesn't
handle this very well.

Have you looked at the example expect script cisco-load.exp? Doing
something like that where you are matching your own prompts might
be the way to go.

Or try something like:
clogin -c 'conf t\rint lo0\rip addr 10.0.0.0/32\rend;cop run star'
- i.e.: embed the newlines in the 'command' & rancid will send the
entire multiline command at once & only wait for the enable prompt
at the end.
--asp
rancid 2.2.2 Problem [ In reply to ]
Thu, Aug 26, 2004 at 10:18:42PM -0700, Len:
> No go.. I've upgraded to rancid 2.3.1 (Tcl 8.4.7 + expect 5.4.2) and it
> now seems like my prompt is not cut off, but the hang still occurs. Is
> there a max number of characters behind the # or some combo of that and
> the quantity between the ( )s ?

what value did you use for the bound that I mentioned?

> >iirc, it truncates the prompt to no more that 14 chars, but what you have
> >above is only 11.
> >
> > 508 # match cisco config mode prompts too, such as
> > router(config-if)#, 509 # but catalyst does not change in
> > this fashion.
> > 510 regsub -all {^(.{1,14}).*([#>])$} $reprompt
> > {\1([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?} reprompt
> > 511 expect {
> >
> >i guess that'l have to be reduced to 10 or so. please try that out and
> >let me know.