[rancid] Re: Small issue with drancid and old Dell PowerConnect 3324
John Jetmore
jj33 at pobox.com
Thu Mar 25 14:36:04 UTC 2010
Aaand I'm an idiot. I just saw this same issue addressed at
http://www.rickyninja.net/rancid/patches/echo-newline-final-exit-3324.txt
ahem.
That patch is dated 3/10/2010, I thought I would have seen something
on this list but I guess not. Sorry for the noise.
--John
On Thu, Mar 25, 2010 at 10:27 AM, John Jetmore <jj33 at pobox.com> wrote:
> I have the dlogin/drancid scripts from rickyninja.net working well(*)
> for a PowerConnect M6220, thanks much for the package. After getting
> it working I decided to try it on some older 3324s I have deployed.
> They are close to working just as well, I have only one oddity. The
> end of the config that gets committed to CVS looks like this:
>
> (...)
> plv-sw-02#exitConnection closed by foreign host.
> end
>
> In the output from the run I have this:
>
> FOUND PROMPT: plv-sw-02#
> found_end = 1, clean_run = 0
> plv-sw-02: End of run not found
> end
> All routers sucessfully completed.
>
> I've confirmed that the final "end" gets added statically, so that's
> not as odd as I thought it was at first. The line which should be
> getting rid of that prompt is in drancid:WriteTerm():
>
> if (/$prompt\s?exit$/) { warn "left WriteTerm on: $_"; $clean_run=1;last; }
>
> It seems I could make this go away by changing the regexp like so:
>
> if (/$prompt\s?exit(?:Connection closed by foreign host.\s*)?$/) {
> warn "left WriteTerm on: $_"; $clean_run=1;last; }
>
> My question then is whether this seems like the appropriate change
> (and possibly something that could go back into the rickyninja
> scripts) or if this is a sign of some issue with my switch config or
> some other item that I would be better off addressing externally to
> rancid.
>
> Thanks
> --John
>
> (*) For posterity, the rickyninja page lists the last release as
> 11/14/2009, but the package was actually last updated on 11/20/2009.
> I just happened to grab it on 11/19/2009, and though I only
> implemented it in the last couple of weeks I would have saved a bunch
> of diagnosing if I had realized I didn't have the most recent version.
> Here's the diff between the 20091114 and 20091120 versions:
>
> --- rancid-dell-extension-20091114/drancid 2009-11-14
> 13:02:14.000000000 -0600
> +++ rancid-dell-extension-20091120/drancid 2009-11-20
> 00:28:19.000000000 -0600
> @@ -154,8 +154,9 @@
> return(1) if /^% Unrecognized command/;
> return(0) if ($found_version); # Only do this
> routine once
> # the pager can not be disabled per-session on the dell
> - s/^More: <space>.+<return>.*//sg;
> - s/^\s*--More-- or \\(q\\)uit.*//sg;
> + s/^More: <space>.+<return> \033\[\K//;
> + s/^More: <space>.+<return>\s*//;
> + s/^\s*--More-- or \(q\)uit\s*//;
> ProcessHistory("","","","$_");
> }
> ProcessHistory("","","","!\n");
> @@ -173,8 +174,9 @@
> next if (/^(\s*|\s*$cmd\s*)$/);
> return(1) if /^% Unrecognized command/;
> # the pager can not be disabled per-session on the dell
> - s/^More: <space>.+<return>.*//sg;
> - s/^\s*--More-- or \\(q\\)uit.*//sg;
> + s/^More: <space>.+<return> \033\[\K//;
> + s/^More: <space>.+<return>\s*//;
> + s/^\s*--More-- or \(q\)uit\s*//;
> ProcessHistory("","","","$_");
> }
> ProcessHistory("","","","!\n");
> @@ -191,8 +193,9 @@
> next if (/^(\s*|\s*$cmd\s*)$/);
> return(1) if /^% Unrecognized command/;
> # the pager can not be disabled per-session on the dell
> - s/^More: <space>.+<return>.*//sg;
> - s/^\s*--More-- or \\(q\\)uit.*//sg;
> + s/^More: <space>.+<return> \033\[\K//;
> + s/^More: <space>.+<return>\s*//;
> + s/^\s*--More-- or \(q\)uit\s*//;
>
> if (/^(enable )?(password|passwd)( level \d+)? / &&
> $filter_pwds >= 1) {
> ProcessHistory("ENABLE","","","!$1$2$3 <removed>\n");
>
More information about the Rancid-discuss
mailing list