[rancid] arrancid (2.3.4) - ignore bytes free in ShowFlash

heasley heas at shrubbery.net
Tue Mar 20 23:53:29 UTC 2012


Fri, Mar 16, 2012 at 11:24:53AM +0100, Stefan Jakob:
> Hi rancid list,
> 
> Is it rancid style to ignore the output of bytes free in sub ShowFlash
> of arrancid?
> 
> Versions:
> 
> arrancid: rancid 2.3.4, Debian Squeeze
> EOS: Software image version: 4.8.3, Arista DCS-7124SX-F
> 
> 
> Looks like Arista stores some ntp drift info on a regular base to the flash:
> 
> happens. Guess this is just noise?

until it gets to zero?

> - !Flash: 1779585024 bytes total (1318834176 bytes free)
> + !Flash: 1779585024 bytes total (1318830080 bytes free)
> 
> @Arista: Why not in tmpfs? This might hurt the flash. If there is ntp
> configured, this shouldn't matter to lose the drift info, after a reboot.

for XR, it summarized as follows.  does this work for arista?

Index: bin/arrancid.in
===================================================================
--- bin/arrancid.in	(revision 2431)
+++ bin/arrancid.in	(working copy)
@@ -304,6 +304,21 @@
         # persist changes constantly if you're running ntp, so
         # skip its updates.
         /\spersist$/ && next;
+
+	if (/.*\((\d+) bytes free\)/) {  
+	    my($tmp) = $1;
+	    if ($tmp >= (1024 * 1024 * 1024)) {   
+		$tmp = int($tmp / (1024 * 1024 * 1024));
+		s/$1 bytes free/$tmp GB free/;
+	    } elsif ($tmp >= (1024 * 1024)) {  
+		$tmp = int($tmp / (1024 * 1024));
+		s/$1 bytes free/$tmp MB free/;
+	    } else {
+		$tmp = int($tmp / 1024);
+		s/$1 bytes free/$tmp KB free/;
+	    }
+	}
+
 	ProcessHistory("FLASH","","","!Flash: $_");
     }
     ProcessHistory("","","","!\n");



More information about the Rancid-discuss mailing list