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.<br>
<br>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.....<br>
<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote"><div style="margin-left: 40px;">TOP: while(<INPUT>) {<br> tr/\015//d;<br> #if (/[>#]\s?exit$/) {<br>
#if (/(closed\.)/) {<br> if (/$prompt\s?(quit|exit|Connection( to \S+)? closed)/ && $found_end) {<br> $clean_run = 1;<br> last;<br> }<br> if (/^Error:/) {<br> print STDOUT ("$host clogin error: $_");<br>
print STDERR ("$host clogin error: $_") if ($debug);<br> $clean_run = 0;<br> last;<br> }<br> while (/[>#]\s*($cmds_regexp)\s*$/) {<br> $cmd = $1;<br> if (!defined($prompt)) {<br>
$prompt = ($_ =~ /^([^#>]+[#>])/)[0];<br> $prompt =~ s/([][}{)(\\])/\\$1/g;<br> print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);<br> }<br> print STDERR ("HIT COMMAND:$_") if ($debug);<br>
if (! defined($commands{$cmd})) {<br> print STDERR "$host: found unexpected command - \"$cmd\"\n";<br> $clean_run = 0;<br> last TOP;<br> }<br> $rval = &{$commands{$cmd}};<br>
delete($commands{$cmd});<br> if ($rval == -1) {<br> $clean_run = 0;<br> last TOP;<br> }<br> }<br>}<br></div></blockquote><br>