[rancid] Enterasys C-Series

Rob Yamry ryamry at kimberly.k12.wi.us
Tue Feb 22 14:31:13 UTC 2011


I think Im getting close on this.  I edited the rancid script and change the
"write term" command to "show config".  I putzed around with it and got it
to where I can run "rancid.mod -d sw_enterasys" and itll create a .new file
with an output of the config but I still get the "end of run not found".
>From what I can find, its not setting $clean_run to 1. I printed out
$clean_run and $found_end just before the end and they come out as 0 and 1,
respectively.

The only place I can find where $clean_run would be set to 1 would be in
this chunk of below.  You can see that tried different things for lines 3-5
to match the final string and set clean run to 1.  I ran across a thread
where the xtremes have a problem doing this as well.  But, I cant seem to
get it working.  Also, Im not 100% sure that this is where it could be as
$clean_run could get set to 0 after that.  Id appreciated any help anybody
could pass my way.  So close.....

TOP: while(<INPUT>) {
>     tr/\015//d;
>     #if (/[>#]\s?exit$/) {
>     #if (/(closed\.)/) {
>     if (/$prompt\s?(quit|exit|Connection( to \S+)? closed)/ && $found_end)
> {
>         $clean_run = 1;
>         last;
>     }
>     if (/^Error:/) {
>         print STDOUT ("$host clogin error: $_");
>         print STDERR ("$host clogin error: $_") if ($debug);
>         $clean_run = 0;
>         last;
>     }
>     while (/[>#]\s*($cmds_regexp)\s*$/) {
>         $cmd = $1;
>         if (!defined($prompt)) {
>             $prompt = ($_ =~ /^([^#>]+[#>])/)[0];
>             $prompt =~ s/([][}{)(\\])/\\$1/g;
>             print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
>         }
>         print STDERR ("HIT COMMAND:$_") if ($debug);
>         if (! defined($commands{$cmd})) {
>             print STDERR "$host: found unexpected command - \"$cmd\"\n";
>             $clean_run = 0;
>             last TOP;
>         }
>         $rval = &{$commands{$cmd}};
>         delete($commands{$cmd});
>         if ($rval == -1) {
>             $clean_run = 0;
>             last TOP;
>         }
>     }
> }
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20110222/aa135586/attachment.html>


More information about the Rancid-discuss mailing list