1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-25 03:43:46 +01:00
This commit is contained in:
Pall Sigurdsson 2012-10-23 10:30:10 +00:00
commit 5b7f683227

View File

@ -14,6 +14,7 @@ use vars qw/ %opt /;
use strict; use strict;
sub getmasked_values ($$); sub getmasked_values ($$);
sub f2c ($);
if ($ARGV[0] =~ /(--help|-h|help)/ || !defined$ARGV[0]) { if ($ARGV[0] =~ /(--help|-h|help)/ || !defined$ARGV[0]) {
&usage; &usage;
@ -40,11 +41,11 @@ my %rpduamps;
my %oids = ( my %oids = (
'nbmstemp' => { 'nbmstemp' => {
'label' => 'Temp', 'label' => 'Temp',
'unit' => ($metric ? 'degC' : 'degF'), 'unit' => 'degF',
'oidbase' => '.1.3.6.1.4.1.5528.100.4.1.1.1', 'oidbase' => '.1.3.6.1.4.1.5528.100.4.1.1.1',
'sensor_key' => 5, 'sensor_key' => 5,
'sensor_val' => 2, 'sensor_val' => 9,
'cdef' => ($metric ? '$val * 0.1' : '($val * .18) + 32') #'cdef' => '$val * 0.1'
}, },
'nbmshum' => { 'nbmshum' => {
'label' => 'Humidity', 'label' => 'Humidity',
@ -94,13 +95,13 @@ my %oids = (
}, },
'acscsupair' => { 'acscsupair' => {
'label' => 'Supply Air', 'label' => 'Supply Air',
'unit' => 'F', 'unit' => 'degF',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.8.0', 'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.8.0',
'cdef' => '$val * .10' 'cdef' => '$val * .10'
}, },
'acscretair' => { 'acscretair' => {
'label' => 'Return Air', 'label' => 'Return Air',
'unit' => 'F', 'unit' => 'degF',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.10.0', 'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.10.0',
'cdef' => '$val * .10' 'cdef' => '$val * .10'
}, },
@ -111,19 +112,19 @@ my %oids = (
}, },
'acscracktemp' => { 'acscracktemp' => {
'label' => 'Rack Inlet Temp', 'label' => 'Rack Inlet Temp',
'unit' => 'F', 'unit' => 'degF',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.6.0', 'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.6.0',
'cdef' => '$val * .10' 'cdef' => '$val * .10'
}, },
'acsccondin' => { 'acsccondin' => {
'label' => 'Cond Inlet Temp', 'label' => 'Cond Inlet Temp',
'unit' => 'F', 'unit' => 'degF',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.30.0', 'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.30.0',
'cdef' => '$val * .10' 'cdef' => '$val * .10'
}, },
'acsccondout' => { 'acsccondout' => {
'label' => 'Cond Outlet Temp', 'label' => 'Cond Outlet Temp',
'unit' => 'F', 'unit' => 'degF',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.28.0', 'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.28.0',
'cdef' => '$val * .10' 'cdef' => '$val * .10'
}, },
@ -151,19 +152,19 @@ my %oids = (
}, },
'acrcracktemp' => { 'acrcracktemp' => {
'label' => 'Rack Inlet Temp', 'label' => 'Rack Inlet Temp',
'unit' => 'F', 'unit' => 'degF',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.6.0', 'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.6.0',
'cdef' => '$val * .10' 'cdef' => '$val * .10'
}, },
'acrcsupair' => { 'acrcsupair' => {
'label' => 'Supply Air', 'label' => 'Supply Air',
'unit' => 'F', 'unit' => 'degF',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.8.0', 'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.8.0',
'cdef' => '$val * .10' 'cdef' => '$val * .10'
}, },
'acrcretair' => { 'acrcretair' => {
'label' => 'Return Air', 'label' => 'Return Air',
'unit' => 'F', 'unit' => 'degF',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.10.0', 'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.10.0',
'cdef' => '$val * .10' 'cdef' => '$val * .10'
}, },
@ -182,13 +183,13 @@ my %oids = (
}, },
'acrcflenttemp' => { 'acrcflenttemp' => {
'label' => 'Entering Fluid Temp', 'label' => 'Entering Fluid Temp',
'unit' => 'F', 'unit' => 'degF',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.23.0', 'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.23.0',
'cdef' => '$val * .10' 'cdef' => '$val * .10'
}, },
'acrcflrettemp' => { 'acrcflrettemp' => {
'label' => 'Returning Fluid Temp', 'label' => 'Returning Fluid Temp',
'unit' => 'F', 'unit' => 'degF',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.25.0', 'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.25.0',
'cdef' => '$val * .10' 'cdef' => '$val * .10'
}, },
@ -367,6 +368,11 @@ if ($param eq "rpduamps") {
$fval = $val; $fval = $val;
} }
if ($metric and $oids{$param}->{unit} eq 'degF') {
$oids{$param}->{unit} = 'degC';
$fval = sprintf("%.1f", f2c($fval));
}
if ($fval > $crit) { if ($fval > $crit) {
$retval = 2; $retval = 2;
$outmsg = "CRITICAL"; $outmsg = "CRITICAL";
@ -417,6 +423,12 @@ APC ACRC In-Row
} }
sub f2c($) {
my $f = shift;
return ($f - 32) * (5/9);
}
sub getmasked_values ($$) { sub getmasked_values ($$) {
my ($baseoid, $values) = @_; my ($baseoid, $values) = @_;