Discussion:
[rancid] NX-OS 6.1.4/Fan Zone Speed
Dino Panagiotopoulos
2013-12-13 20:36:53 UTC
Permalink
Hi Everyone,

Since upgrading to NX-OS 6.1(4), fan module speed changes are written to
the startup config which in turn is creating a diff for each time the fan
speed changes. As you could imagine, this is causing a lot of false
positive emails to be sent each time Rancid and CVS run. Please see the
example below:

retrieving revision 1.1356
diff -U 4 -r1.1356 10.111.100.151
@@ -77,9 +77,9 @@
!Env: Fan4(fab_fan2) N7K-C7010-FAN-F 1.1 Ok
!Env: Fan_in_PS1 -- -- Ok
!Env: Fan_in_PS2 -- -- Ok
!Env: Fan_in_PS3 -- -- Ok
- !Env: Fan Zone Speed: Zone 1: 0x70 Zone 2: 0x50
+ !Env: Fan Zone Speed: Zone 1: 0x60 Zone 2: 0x48
!Env: Fan Air Filter : Present

This will flip back and forth with each fan change. Has anyone on 6.X NX-OS
code experienced anything like this? We are on RANCID 2.3.4 and if this not
resolved in the newest release, is it possible to just remove 'sh env' from
the nxrancid.in file?

Thanks,
Dino Panagiotopoulos
Alan McKinnon
2013-12-15 17:32:01 UTC
Permalink
Post by Dino Panagiotopoulos
Hi Everyone,
Since upgrading to NX-OS 6.1(4), fan module speed changes are written to
the startup config which in turn is creating a diff for each time the
fan speed changes. As you could imagine, this is causing a lot of false
positive emails to be sent each time Rancid and CVS run. Please see the
retrieving revision 1.1356
diff -U 4 -r1.1356 10.111.100.151
@@ -77,9 +77,9 @@
!Env: Fan4(fab_fan2) N7K-C7010-FAN-F 1.1 Ok
!Env: Fan_in_PS1 -- -- Ok
!Env: Fan_in_PS2 -- -- Ok
!Env: Fan_in_PS3 -- -- Ok
- !Env: Fan Zone Speed: Zone 1: 0x70 Zone 2: 0x50
+ !Env: Fan Zone Speed: Zone 1: 0x60 Zone 2: 0x48
!Env: Fan Air Filter : Present
This will flip back and forth with each fan change. Has anyone on 6.X
NX-OS code experienced anything like this? We are on RANCID 2.3.4 and if
this not resolved in the newest release, is it possible to just remove
'sh env' from the nxrancid.in file?
Removing "sh env" from nxrancid for everyone is not a good idea, I would
be most upset if an update shipped with that change.

Rather just modify your local copy of nxrancid. Add a regex check to
detect a line starting with "!Env: Fan Zone Speed:" ans skip that line.
The rancid code has many examples of doing this (it's one of rancid's
primary functions), just copy the existing style.

The function to modify is ShowEnv()
--
Alan McKinnon
***@gmail.com
heasley
2013-12-16 18:02:32 UTC
Permalink
Post by Alan McKinnon
Removing "sh env" from nxrancid for everyone is not a good idea, I would
be most upset if an update shipped with that change.
Rather just modify your local copy of nxrancid. Add a regex check to
detect a line starting with "!Env: Fan Zone Speed:" ans skip that line.
The rancid code has many examples of doing this (it's one of rancid's
primary functions), just copy the existing style.
The function to modify is ShowEnv()
against 2.3.8

Index: bin/nxrancid.in
===================================================================
--- bin/nxrancid.in (revision 2712)
+++ bin/nxrancid.in (working copy)
@@ -312,6 +312,7 @@
return(-1) if (/command authorization failed/i);

s/ +$//; # Drop trailing ' '
+ next if (/Fan Zone Speed:/);
ProcessHistory("COMMENTS","","","!Env: $_");
}
ProcessHistory("COMMENTS","","","!\n");
Dino Panagiotopoulos
2013-12-16 18:26:38 UTC
Permalink
Thank you to Mark & Doug for their suggestions which resolved my issue. The
solution is to add the following line to the nxrancid file under "sh
environment" subroutine:

next if (/^Fan Zone Speed:/);

The final config for the subroutine should look like this:

# This routine parses "show environment"

sub ShowEnv {

print STDERR " In ShowEnv: $_" if ($debug);



while (<INPUT>) {

tr/\015//d;

last if (/^$prompt/);

next if (/^(\s*|\s*$cmd\s*)$/);

next if (/^\s*\^\s*$/);

next if (/^Fan Zone Speed:/);

return(1) if /Line has invalid autocommand /;

return(1) if /(Invalid input detected|Type help or )/;

return(1) if (/\% Invalid command at /);

return(-1) if (/\% Permission denied/);

return(-1) if (/command authorization failed/i);



s/ +$//; # Drop trailing ' '

ProcessHistory("COMMENTS","","","!Env: $_");

}

ProcessHistory("COMMENTS","","","!\n");

return(0);

}
Post by Dino Panagiotopoulos
Hi Everyone,
Since upgrading to NX-OS 6.1(4), fan module speed changes are written to
the startup config which in turn is creating a diff for each time the fan
speed changes. As you could imagine, this is causing a lot of false
positive emails to be sent each time Rancid and CVS run. Please see the
retrieving revision 1.1356
diff -U 4 -r1.1356 10.111.100.151
@@ -77,9 +77,9 @@
!Env: Fan4(fab_fan2) N7K-C7010-FAN-F 1.1 Ok
!Env: Fan_in_PS1 -- -- Ok
!Env: Fan_in_PS2 -- -- Ok
!Env: Fan_in_PS3 -- -- Ok
- !Env: Fan Zone Speed: Zone 1: 0x70 Zone 2: 0x50
+ !Env: Fan Zone Speed: Zone 1: 0x60 Zone 2: 0x48
!Env: Fan Air Filter : Present
This will flip back and forth with each fan change. Has anyone on 6.X
NX-OS code experienced anything like this? We are on RANCID 2.3.4 and if
this not resolved in the newest release, is it possible to just remove 'sh
env' from the nxrancid.in file?
Thanks,
Dino Panagiotopoulos
Loading...