[rancid] Enterasys C-Series

Jethro R Binks jethro.binks at strath.ac.uk
Tue Feb 22 15:06:34 UTC 2011


On Tue, 22 Feb 2011, Rob Yamry wrote:

> 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;
> >     }

(I've not been closely following this thread)

So if $found_end is true, then /$prompt\s?(quit|exit|Connection( to \S+)? 
closed)/ must not be, for $clean_run not to be true.

What does the end of "show config" look like?

Jethro.



> >     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;
> >         }
> >     }
> > }
> >
> 

.  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
Jethro R Binks, Network Manager,
Information Services Directorate, University Of Strathclyde, Glasgow, UK

The University of Strathclyde is a charitable body, registered in
Scotland, number SC015263.


More information about the Rancid-discuss mailing list