[rancid] How to remove fan speed from f5rancid output?
Matt Almgren
matta at surveymonkey.com
Tue Jul 7 23:14:39 UTC 2015
Well, I had thought I had fixed this, but it was just not running for our f5s for a while. Oopps.
Anyway, my perl-fu isn’t very good. Can someone quickly tell me what I need to change in this code to remove the fan speed(rpm) values from the output below:
## $Id: f5rancid.in 2279 2011-01-31 22:41:00Z heas $
sub ShowHardware {
print STDERR " In ShowHardware: $_" if ($debug);
while (<INPUT>) {
tr/\015//d;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if /^\s*\^\s*$/;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
s/\d+rpm//ig;
s/^\|//;
s/^\ \ ([0-9]+)(\ +).*up.*[0-9]/ $1$2up REMOVED/i;
s/^\ \ ([0-9]+)(\ +).*Air\ Inlet/ $1$2REMOVED Air Inlet/i;
s/^\ \ ([0-9]+)(\ +).*HSBe/ $1$2REMOVED HSBe/i;
s/^\ \ ([0-9]+)(\ +).*TMP421 on die/ $1$2REMOVED TMP421 on die/i;
s/^\ \ ([0-9]+)(\ +)[0-9]+\ +[0-9]+ +[0-9]+/ $1$2REMOVED REMOVED REMOVED/;
/Type: / && ProcessHistory("COMMENTS","keysort","A0",
"#Chassis type: $'");
ProcessHistory("COMMENTS","keysort","B1","#$_") && next;
}
return(0);
}
[user at mt-lb03:Active:In Sync] ~ # tmsh show sys hardware
Sys::Hardware
Chassis Fan Status
Index Status Low Limit(rpm) Fan Speed(rpm)
1 up 3000 10227
2 up 3000 10887
3 up 3000 10546
Chassis Information
Maximum MAC Count 2
Registration Key -
Chassis Power Supply Status
Index Status Current
1 up NA
2 not-present NA
Chassis Temperature Status
Index Lo Limit(C) Temp(degC) Hi Limit(C) Location
1 5 22 55 Air Inlet
<snip>
If there’s a more updated f5rancid that fully supports TMSH on 11.6.0 HF3, I’d love to have a copy.
Thanks, Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20150707/39750784/attachment.html>
More information about the Rancid-discuss
mailing list