Discussion:
[rancid] arrancid (2.3.4) - ignore bytes free in ShowFlash
Stefan Jakob
2012-03-16 10:24:53 UTC
Permalink
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:

bash-4.0# pwd
/mnt/flash/persist
bash-4.0# ls -ls -rtl
total 20
12 -rwxrwx--- 1 root eosadmin 10240 Mar 14 12:07 sys
8 -rwxrwx--- 1 root eosadmin 5120 Mar 16 08:12 local

Guess this causes arrancid to "see" a diff in ShowFlash everytime this
happens. Guess this is just noise?

- !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.


I checked 2.3.8, but can't really see, that it's parsed diffrent

So is it possible to ignore the line?

Rgds, SJ
heasley
2012-03-20 23:53:29 UTC
Permalink
Post by Stefan Jakob
Hi rancid list,
Is it rancid style to ignore the output of bytes free in sub ShowFlash
of arrancid?
arrancid: rancid 2.3.4, Debian Squeeze
EOS: Software image version: 4.8.3, Arista DCS-7124SX-F
happens. Guess this is just noise?
until it gets to zero?
Post by Stefan Jakob
- !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");
Stefan Jakob
2012-07-02 07:53:06 UTC
Permalink
Post by heasley
Post by Stefan Jakob
Hi rancid list,
Is it rancid style to ignore the output of bytes free in sub ShowFlash
of arrancid?
arrancid: rancid 2.3.4, Debian Squeeze
EOS: Software image version: 4.8.3, Arista DCS-7124SX-F
happens. Guess this is just noise?
until it gets to zero?
Post by Stefan Jakob
- !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

[***@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
Post by heasley
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)
---
Post by heasley
!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)
---
Post by heasley
!Flash: 931745792 bytes total (258 MB free)
Rgds, Stefan

Loading...