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

Stefan Jakob stefan.jakob at de-cix.net
Mon Jul 2 07:53:06 UTC 2012


Am 21.03.12 00:53, schrieb heasley:
> 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.

This byte drift only occures for the first couple of days and is caused
by the automatic rotation of the tech support logs:

/mnt/flash/schedule/tech-support

[admin at localhost tech-support]$ ls -rtl
total 240
-rwxrwx--- 1 root eosadmin 17998 Jul  2 05:03
tech-support_2012-07-02.0503.log.gz
-rwxrwx--- 1 root eosadmin 17997 Jul  2 05:18
tech-support_2012-07-02.0518.log.gz
-rwxrwx--- 1 root eosadmin 17998 Jul  2 05:33
tech-support_2012-07-02.0533.log.gz
-rwxrwx--- 1 root eosadmin 17996 Jul  2 05:48
tech-support_2012-07-02.0548.log.gz
-rwxrwx--- 1 root eosadmin 18024 Jul  2 06:03
tech-support_2012-07-02.0603.log.gz
-rwxrwx--- 1 root eosadmin 18005 Jul  2 06:18
tech-support_2012-07-02.0618.log.gz
-rwxrwx--- 1 root eosadmin 18034 Jul  2 06:33
tech-support_2012-07-02.0633.log.gz
-rwxrwx--- 1 root eosadmin 18026 Jul  2 06:48
tech-support_2012-07-02.0648.log.gz
-rwxrwx--- 1 root eosadmin 18040 Jul  2 07:03
tech-support_2012-07-02.0703.log.gz
-rwxrwx--- 1 root eosadmin 18035 Jul  2 07:18
tech-support_2012-07-02.0718.log.gz
-rwxrwx--- 1 root eosadmin 17999 Jul  2 07:33
tech-support_2012-07-02.0733.log.gz
-rwxrwx--- 1 root eosadmin 17999 Jul  2 07:48
tech-support_2012-07-02.0748.log.gz




> 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");

As discussed off list, this patch is working, with special thx to my
colleague Petr.

# cvs diff -r 1.118 -r 1.117 /var/lib/rancid/arista/configs/10.254.0.200
Index: /var/lib/rancid/arista/configs/10.254.0.200
===================================================================
RCS file: /var/lib/rancid/CVS/arista/configs/10.254.0.200,v
retrieving revision 1.118
retrieving revision 1.117
diff -r1.118 -r1.117
37c37
< !Flash: 931745792 bytes total (268541952 bytes free)
---
> !Flash: 931745792 bytes total (268562432 bytes free)


And here's the one with the patch applied to arrancid:

# cvs diff -r 1.122 -r 1.121 /var/lib/rancid/arista/configs/10.254.0.200
Index: /var/lib/rancid/arista/configs/10.254.0.200
===================================================================
RCS file: /var/lib/rancid/CVS/arista/configs/10.254.0.200,v
retrieving revision 1.122
retrieving revision 1.121
diff -r1.122 -r1.121
37c37
< !Flash: 931745792 bytes total (257 MB free)
---
> !Flash: 931745792 bytes total (258 MB free)


Rgds, Stefan




More information about the Rancid-discuss mailing list