[rancid] Rancid not collecting VLAN info on Cisco ME-3600
Hagen, Skye
skyeh at uidaho.edu
Thu Aug 8 16:37:56 UTC 2013
I agree, reversing the logic makes more sense. I knew there was a better answer than mine. For right now, I'll leave that to you for a future release.
Thanks, Skye.
________________________________________
From: heasley <heas at shrubbery.net>
Sent: Thursday, August 08, 2013 8:17 AM
To: Hagen, Skye
Cc: rancid-discuss at shrubbery.net
Subject: Re: [rancid] Rancid not collecting VLAN info on Cisco ME-3600
Wed, Aug 07, 2013 at 06:49:27PM +0000, Hagen, Skye:
> Rancid 2.3.6 does not collect VLAN information on a Cisco ME-3600 switch.
> This is because the ME-3600 does not support VTP, and returns 'Invalid
> command'. Rancid will only collect VLAN info on switches if the VTP mode
> is transparent or server. The ShowVTP subroutine sets a flag
> ($DO_SHOW_VLAN) if the VTP mode is server or transparent. The ShowVLAN
> routine immediately returns if this flag is not set, bypassing the VLAN
> info.
>
> My quick and dirty change was to set the flag in ShowVTP, if the type is
> ME-3600. I do this before entering the while loop, so that the flag is set
> before the subroutine exits because of the invalid command test. I'm not
> sure that this is the best way to correct this, but it works in my
> environment.
should the check really be the reversed? if it _is_ a vtp client, skip
show vlan.
> # This routine parses "show vtp status"
> sub ShowVTP {
> print STDERR " In ShowVTP: $_" if ($debug);
>
> $DO_SHOW_VLAN = 1 if ($type =~ /^ME-3600X/); # ME-3600 doesn't support
> VTP
> while (<INPUT>) {
> tr/\015//d;
> last if (/^$prompt/);
> next if (/^(\s*|\s*$cmd\s*)$/);
> return(1) if /^\s*\^\s*$/;
> return(1) if (/Line has invalid autocommand /);
> return(1) if (/(Invalid (input|command) detected|Type help or )/i);
> #return(1) if ($type !~ /^(2900XL|3500XL|6000)$/);
> return(-1) if (/command authorization failed/i);
> next if (/^Configuration last modified by/);
> # the pager can not be disabled per-session on the PIX
> if (/^(<-+ More -+>)/) {
> my($len) = length($1);
> s/^$1\s{$len}//;
> }
>
> if (/^VTP Operating Mode\s+:\s+(Transparent|Server)/) {
> $DO_SHOW_VLAN = 1;
> }
> ProcessHistory("COMMENTS","keysort","I0","!VTP: $_");
> }
> ProcessHistory("COMMENTS","keysort","I0","!\n");
> return(0);
> }
>
>
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
More information about the Rancid-discuss
mailing list