<div dir="ltr"><div>Yeah, sorry Alan I wasn't thinking.<br><br></div><div>I like the looks of 3.0 also but here is workaround for 2.3 that should work for you if the hostnames of your GSRs are unique - able to be matched by a regular expression. I think the only way to do this is with the hostname since no other information is passed to rancid. If you can't match your GSR hostnames by regexp, you could enter them all together.<br>
</div><div><br></div>--- rancid.20130620 2013-06-20 09:53:03.344845839 -0400<br>+++ rancid 2013-06-20 10:00:50.874896393 -0400<br>@@ -2333,6 +2333,18 @@<br> {'write term' => 'WriteTerm'},<br>
);<br> <br>+my @commandtable2;<br>+if ( $host =~ /gsr/ ){ #replace 'gsr' with GSR hostname regexp<br>+ foreach my $command ( @commandtable ) {<br>+ foreach my $key ( keys %$command ) {<br>+ unless ( $key =~ /running-config/ ){ #replace 'running-config' with a pipe-separated list of commands/command regexps to NOT run<br>
+ push ( @commandtable2 ,( { $key => $command->{$key} } ));<br>+ }<br>+ }<br>+ }<br>+ @commandtable = @commandtable2;<br>+}<br>+<br> # Use an array to preserve the order of the commands and a hash for mapping<br>
# commands to the subroutine and track commands that have been completed.<br> @commands = map(keys(%$_), @commandtable);<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 20, 2013 at 3:28 AM, Alan McKinnon <span dir="ltr"><<a href="mailto:alan.mckinnon@gmail.com" target="_blank">alan.mckinnon@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 18/06/2013 03:42, Peter Jackson wrote:<br>
> Check out some of the other command sections that are skipped for<br>
> certain 'types'. Figure out the type that rancid sets for the GSRs and<br>
> use the line below (formatted for the correct type) in the command<br>
> sections you don't want to run for them.<br>
><br>
> I assume the following would skip 12006, 12010, 12404, 12410, etc.:<br>
><br>
> return(1) if ($type !~ /^12[40]/);<br>
<br>
<br>
<br>
</div>I think I missed replying to this one, sorry about that.<br>
<br>
I don't think that approach will work for me - I don't need to prevent<br>
rancid parsing the output, I need some commands to not be run on the<br>
device at all.<br>
<br>
That means I'd have to modify @commandtable based on chassis type so<br>
that clogin doesn't issue certain commands. But I don't know the chassis<br>
type until clogin has already run and minimally ShowVersion has already<br>
been parsed. By then it's too late.<br>
<br>
3.0alpha looks like it might be moving in a direction that solves my<br>
problem quite nicely<br>
<div class="im"><br>
<br>
><br>
><br>
><br>
><br>
> On Mon, Jun 17, 2013 at 3:21 PM, Alan McKinnon <<a href="mailto:alan.mckinnon@gmail.com">alan.mckinnon@gmail.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:alan.mckinnon@gmail.com">alan.mckinnon@gmail.com</a>>> wrote:<br>
><br>
> Hi,<br>
><br>
> Our provider edge runs on GSR 12's and they carry a hefty config. NetOps<br>
> complain that rancid noticeably spikes the cpu load [1] when it runs<br>
> these 4 (essentially the same) commands.<br>
><br>
> {'more system:running-config' => 'WriteTerm'}, # ASA/PIX<br>
> { running-config view full'=> 'WriteTerm'}, # workaround for<br>
> {'show running-config' => 'WriteTerm'},<br>
> {'write term' => 'WriteTerm'},<br>
><br>
> I got it under control easily by forking rancid to a gsrrancid script<br>
> and removing the bits I don't want from @commandtable.<br>
><br>
> I'd rather not do it this way, I'd like to have this in the rancid<br>
> parser. But I can't figure a way to modify @commandtable at runtime<br>
> based on chassis/OS type.<br>
><br>
> Ideas?<br>
><br>
><br>
> [1] It's a legit complaint, not a fiction of a NetOps engineer's<br>
> imagination. On every other chassis I can ignore the effects rancid<br>
> causes, but not these ones. We do things with the 12k most folks think<br>
> should not be possible :-)<br>
><br>
> --<br>
> Alan McKinnon<br>
</div>> <a href="mailto:alan.mckinnon@gmail.com">alan.mckinnon@gmail.com</a> <mailto:<a href="mailto:alan.mckinnon@gmail.com">alan.mckinnon@gmail.com</a>><br>
><br>
> _______________________________________________<br>
> Rancid-discuss mailing list<br>
> <a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a> <mailto:<a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a>><br>
> <a href="http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss" target="_blank">http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss</a><br>
<div class="HOEnZb"><div class="h5">><br>
><br>
<br>
<br>
--<br>
Alan McKinnon<br>
<a href="mailto:alan.mckinnon@gmail.com">alan.mckinnon@gmail.com</a><br>
<br>
_______________________________________________<br>
Rancid-discuss mailing list<br>
<a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a><br>
<a href="http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss" target="_blank">http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss</a><br>
</div></div></blockquote></div><br></div>