[rancid] Re: Monitoring Route Table with RANCID.

Shekhar Basnet shekhar at mos.com.np
Fri Jul 21 11:08:28 UTC 2006


Thanks for the patch. One thing I am not clear is how to apply it? Do I
just append these config lines to the rancid file? 

Thanks
Shekhar.

On Thu, 2006-07-20 at 18:25, David LaPorte wrote:
> My diff against 2.3.1 is attached.  We only run one instance of RANCID,
> but this is just one of several patches we apply to customize it.
> 
> Dave
> 
> Shekhar Basnet wrote:
> > How does one do it? I would love to do that kind of thing too. Would I
> > have to run a different instance of RANCID and tweak the software too?
> > Can you also post your diffs?
> > 
> > Thanks
> > Shekhar.
> 
> 
> ______________________________________________________________________
> *** rancid-2.3.1/bin/rancid	Thu Oct  6 22:40:22 2005
> --- /usr/local/rancid/bin/rancid	Sat Oct  8 22:23:41 2005
> ***************
> *** 578,583 ****
> --- 578,698 ----
>       return;
>   }
>   
> + # Local modification - 02/18/03 - dlp
> + # This routine prints the IP routing table on core, non-border routers
> + sub ShowIPRouteConnected {
> +     print STDERR "    In ShowIPRouteConnected: $_" if ($debug);
> +     while (<INPUT>) {
> +         tr/\015//d;
> +         last if(/^$prompt/);
> +         next if (/^\s*$/);
> +         return(1) if /(Invalid input detected|Type help or )/;
> +         return(-1) if (/command authorization failed/i);   
> +         if ($_ =~ /^C|^\s+\[/) {
> +           #$_ = (split(",",$_,2))[0]."\n";               
> +         } else {
> +           next;
> +         }           
> +         ProcessHistory("ROUTES","numsort","","!Connected Routes: $_");
> +     }
> +     ProcessHistory("","","","!\n");
> +     return(0);
> + }
> + 
> + sub ShowIPRouteStatic {
> +     print STDERR "    In ShowIPRouteStatic: $_" if ($debug);
> +     while (<INPUT>) {
> +         tr/\015//d;
> +         last if(/^$prompt/);
> +         next if (/^\s*$/);
> +         return(1) if /(Invalid input detected|Type help or )/;
> +         return(-1) if (/command authorization failed/i);
> +         if ($_ =~ /^S|^\s+\[/) {
> +           #$_ = (split(",",$_,2))[0]."\n";
> +         } else {
> +           next;
> +         }
> +         ProcessHistory("ROUTES","numsort","","!Static Routes: $_");
> +     }
> +     ProcessHistory("","","","!\n");
> +     return(0);
> + }
> + 
> + sub ShowIPRouteRIP {
> +     print STDERR "    In ShowIPRouteRIP: $_" if ($debug);
> +     while (<INPUT>) {
> +         tr/\015//d;
> +         last if(/^$prompt/);
> +         next if (/^\s*$/);
> +         return(1) if /(Invalid input detected|Type help or )/;
> +         return(-1) if (/command authorization failed/i);
> +         if ($_ =~ /^R|^\s+\[/) {
> +           $_ = (split(",",$_,2))[0]."\n";
> +         } else {
> +           next;
> +         }
> +         ProcessHistory("ROUTES","numsort","","!RIP Routes: $_");
> +     }
> +     ProcessHistory("","","","!\n");
> +     return(0);
> + }
> + 
> + sub ShowIPRouteIGRP {
> +     print STDERR "    In ShowIPRouteIGRP: $_" if ($debug);
> +     while (<INPUT>) {
> +         tr/\015//d;
> +         last if(/^$prompt/);
> +         next if (/^\s*$/);
> +         return(1) if /(Invalid input detected|Type help or )/;
> +         return(-1) if (/command authorization failed/i);
> +         if ($_ =~ /^I|^\s+\[/) {
> +           $_ = (split(",",$_,2))[0]."\n";
> +         } else {
> +           next;
> +         }
> +         ProcessHistory("ROUTES","keysort","","!IGRP Routes: $_");
> +     }
> +     ProcessHistory("","","","!\n");
> +     return(0);
> + }
> + sub ShowIPRouteEIGRP {
> +     print STDERR "    In ShowIPRouteEIGRP: $_" if ($debug);
> +     while (<INPUT>) {
> +         tr/\015//d;
> +         last if(/^$prompt/);
> +         next if (/^\s*$/);
> +         return(1) if /(Invalid input detected|Type help or )/;
> +         return(-1) if (/command authorization failed/i);
> +         if ($_ =~ /^D|^\s+\[/) {
> +           $_ = (split(",",$_,2))[0]."\n";
> +         } else {
> +           next;
> +         }
> +         ProcessHistory("ROUTES","numsort","","!EIGRP Routes: $_");
> +     }
> +     ProcessHistory("","","","!\n");
> +     return(0);
> + }
> + 
> + sub ShowIPRouteOSPF {
> +     print STDERR "    In ShowIPRouteOSPF: $_" if ($debug);
> +     while (<INPUT>) {
> +         tr/\015//d;
> +         last if(/^$prompt/);
> +         next if (/^\s*$/);
> +         return(1) if /(Invalid input detected|Type help or )/;
> +         return(-1) if (/command authorization failed/i);
> +         if ($_ =~ /^O|^\s+\[/) {
> +           $_ = (split(",",$_,2))[0]."\n";
> +         } else {
> +           next;
> +         }
> +         ProcessHistory("ROUTES","numsort","","!OSPF Routes: $_");
> +     }
> +     ProcessHistory("","","","!\n");
> +     return(0);
> + }
> + 
>   # This routine parses "dir /all ((disk|slot)N|bootflash|nvram):"
>   sub DirSlotN {
>       # Skip if this is not a 3600, 7000, 7200, 7500, or 12000.
> ***************
> *** 1465,1470 ****
> --- 1580,1591 ----
>   	'show controllers cbus'	=> "ShowContCbus",
>   	'show diagbus'		=> "ShowDiagbus",
>   	'show diag'		=> "ShowDiag",
> +         'show ip route connected' => "ShowIPRouteConnected", 
> +         'show ip route static'  => "ShowIPRouteStatic",
> +         'show ip route rip'     => "ShowIPRouteRIP",     
> +         'show ip route igrp'    => "ShowIPRouteIGRP",        
> +         'show ip route eigrp'   => "ShowIPRouteEIGRP",
> +         'show ip route ospf'    => "ShowIPRouteOSPF",
>   	'show module'		=> "ShowModule",	# cat 6500-ios
>   	'show spe version'	=> "ShowSpeVersion",
>   	'show c7200'		=> "ShowC7200",
> ***************
> *** 1521,1526 ****
> --- 1642,1653 ----
>   	"show controllers cbus",
>   	"show diagbus",
>   	"show diag",
> +         "show ip route connected",
> +         "show ip route static",
> +         "show ip route rip",
> +         "show ip route igrp",
> +         "show ip route eigrp",
> +         "show ip route ospf",
>   	"show module",
>   	"show spe version",
>   	"show c7200",




More information about the Rancid-discuss mailing list