[c-nsp] IOS, IOS-XR and RANCID

Pierfrancesco Caci p.caci at seabone.net
Thu Jan 14 02:09:35 EST 2010


:-> "Simon" == Simon Muyal <muyal at renater.fr> writes:

    > Hello all,
    > We have a network composed by Cisco equipment running IOS and IOS-XR.
    > We run RANCID to manage/backup our configurations.

    > Is anybody has experience on this software with both versions (IOS and
    > IOS-XR)? We have difficulties to integrate both versions
    > simultaneously in the same RANCID process (problem of "user" and
    > "admin" mode execution)


if you refer to rancid not being able to look at full show diag
because it requires admin mode, you can apply the following patch, the trick
being that you can use admin mode commands by using "run" and calling
the real executable (in this case "run show_diag admin"). The rest of
the patch quenches some constantly changing disk size output. 

--- rancid-original	2006-06-06 14:23:42.000000000 +0200
+++ rancid	2008-06-20 08:47:09.000000000 +0200
@@ -665,6 +665,8 @@
 	return(-1) if /(: device being squeezed|ATA_Status time out)/i; # busy
 	return(-1) if (/command authorization failed/i);
 	return(1) if /(Open device \S+ failed|Error opening \S+:)/;
+	s/\d+ bytes total \(\d+ bytes free\)/ <CRS harddisks sizes skipped> / if ($type =~ /CRS/ and $cmd =~ /(harddisk|bootflash|disk0)/);
+	s/.*(uptime|temp)_cont/! <CRS constantly changing $1_cont skipped> / if ($type =~ /CRS/ and $cmd =~ /(harddisk|bootflash|disk0)/);
 	# the pager can not be disabled per-session on the PIX
 	if (/^(<-+ More -+>)/) {
 	    my($len) = length($1);
@@ -1610,7 +1612,7 @@
 	    if (defined($ENV{'NOCOMMSTR'})) {
 		my($ip) = $1;
 		my($line) = "snmp-server host $ip";
-		my(@tokens) = split(' ', $');
+		my(@tokens) = split(' ', $');  #' (This comment fixes emacs fontification)
 		my($token);
 		while ($token = shift(@tokens)) {
 		    if ($token eq 'version') {
@@ -1753,7 +1755,7 @@
 	{'show controllers'		=> 'ShowContAll'},
 	{'show controllers cbus'	=> 'ShowContCbus'},
 	{'show diagbus'			=> 'ShowDiagbus'},
-	{'admin show diag'		=> 'ShowDiag'},
+	{'run show_diag admin'		=> 'ShowDiag'},
 	{'show diag'			=> 'ShowDiag'},
 	{'show module'			=> 'ShowModule'},	# cat 6500-ios
 	{'show spe version'		=> 'ShowSpeVersion'},



-- 


-------------------------------------------------------------------------------
 Pierfrancesco Caci | Network & System Administrator - INOC-DBA: 6762*PFC
 p.caci at seabone.net | Telecom Italia Sparkle - http://etabeta.noc.seabone.net/


More information about the cisco-nsp mailing list