[rancid] [patch] fluctuating data from cisco-nx

Pavel Korovin p at tristero.se
Fri Aug 17 19:16:51 UTC 2018


Dear all,

There are several issues with fluctuating data received from Cisco Nexus
platform (55xx, 77xx):

* accounting logs filenames are named as accounting_log,
  accounting_log.0, etc. These filenames are not filtered out from the
  output

* "show interface transceiver" command introduced in v3.8 produces huge
  (temperature, current, power & voltage); imagine how much output produces
  N5596 with 96 ports/transceivers. I propose to filter out this output
  if FILTER_OSC != NO

* if PAR_COUNT is > 1 (by default, it's 5) and rancid simultaneously runs
  "show version" in multiple VDCs on the same device, bootflash size
  values hop between 0 and actual size, with each invocation producing cvs
  commits and change notifications. To reproduce, run "show ver"
  simultaneously on multiple VDCs. It seems that NX-OS requires exclusive
  access to hardware to determine the size of bootflash and fails during
  concurrent access. I cannot offer any better solution than just
  providing a knob to filter out bootflash size fluctuations by setting
  FILTER_OSC = ALL.

Please see the diff attached.

-- 
With best regards,
Pavel Korovin
-------------- next part --------------
$OpenBSD$

Index: lib/nxos.pm.in
--- lib/nxos.pm.in.orig
+++ lib/nxos.pm.in
@@ -186,7 +186,7 @@ EndSoftware:
 	    }
 	}
 EndHardware:
-	if (/^\s+(bootflash|slot0):\s+(\d+) kB(.*)$/) {
+	if (/^\s+(bootflash|slot0):\s+(\d+) kB(.*)$/ && ($filter_osc < 2)) {
 	    my($tmp) = int($2 / 1024);
 	    ProcessHistory("COMMENTS","keysort","B1",
 			   "!Memory: $1: $tmp MB$3\n");
@@ -496,8 +496,8 @@ sub DirSlotN {
 	# Drop bootvar_debug log files
 	/\s+bootvar_debug\./ && next;
 
-	# Drop accounting.log
-	/\s+accounting\.log$/ && next;
+	# Drop accounting logs
+	/\s+accounting.log.*/ && next;
 
 	# Drop vtp_debug.log and vtp_debug_old.log CDETS bug CSCuy87611
 	/\s+vtp_debug(_old)?\.log$/ && next;
@@ -574,6 +574,9 @@ sub ShowIntTransceiver {
 	return(-1) if (/No token match at /);	# 1000v
 	return(-1) if (/\% Permission denied/);
 	return(-1) if (/command authorization failed/i);
+	
+	# filter out oscillating data from transceivers if FILTER_OSC != NO
+	next if (/(Temperature|Current|Power|Voltage)\s+:/ && ($filter_osc >= 1));
 
 	ProcessHistory("COMMENTS","","","!$_");
     }


More information about the Rancid-discuss mailing list