WIP: new perfdata for hardware components

This commit is contained in:
garnier-quentin 2019-04-17 17:09:25 +02:00
parent 821bf32e1c
commit e9876ea9c6
87 changed files with 811 additions and 506 deletions

View File

@ -43,7 +43,7 @@ sub check {
next if ($self->check_filter(section => 'cim_numericsensor', instance => $instance));
my $status = $self->get_status(entry => $_);
if (!defined($status)) {
$self->{output}->output_add(long_msg => sprintf("skipping numeric sensor '%s' : no status", $_->{ElementName}), debug => 1);
$self->{output}->output_add(long_msg => sprintf("skipping numeric sensor '%s' : no status", $name), debug => 1);
next;
}
@ -53,14 +53,14 @@ sub check {
$value = $value * 10 ** int($_->{UnitModifier}) if (defined($value) && $value =~ /\d/);
$self->{output}->output_add(long_msg => sprintf("Numeric sensor '%s' status is '%s' [instance: %s, current value: %s].",
$_->{ElementName}, $status,
$name, $status,
$instance, defined($value) ? $value : '-'
));
my $exit = $self->get_severity(section => 'cim_numericsensor', label => 'default', value => $status);
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Numeric sensor '%s' status is '%s'",
$_->{ElementName}, $status));
$name, $status));
}
@ -96,17 +96,21 @@ sub check {
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Numeric sensor '%s' value is %s %s",
$_->{ElementName}, $value,
$name, $value,
defined($mapping_units->{$_->{BaseUnits}}) ? $mapping_units->{$_->{BaseUnits}} : '-'));
}
my $min = defined($_->{MinReadable}) && $_->{MinReadable} =~ /\d/ ? $_->{MinReadable} * 10 ** int($_->{UnitModifier}) : undef;
my $max = defined($_->{MaxReadable}) && $_->{MaxReadable} =~ /\d/ ? $_->{MaxReadable} * 10 ** int($_->{UnitModifier}) : undef;
$self->{output}->perfdata_add(label => $instance, unit => $mapping_units->{$_->{BaseUnits}},
value => $value,
warning => $warn,
critical => $crit,
min => $min, max => $max);
$self->{output}->perfdata_add(
label => $sensor_type, unit => $mapping_units->{$_->{BaseUnits}},
nlabel => 'hardware.sensor.' . lc($sensor_type) . '.' . lc($mapping_units->{$_->{BaseUnits}}),
instances => $name,
value => $value,
warning => $warn,
critical => $crit,
min => $min, max => $max
);
}
}

View File

@ -83,32 +83,32 @@ $mapping_OperationalStatus = {
$mapping_sensortype = {
0 => 'unknown',
1 => 'other',
2 => 'temp', # Temperature
3 => 'volt', # Voltage
2 => 'temperature', # Temperature
3 => 'voltage', # Voltage
4 => 'current', # Current
5 => 'tachometer',
6 => 'counter',
7 => 'switch',
8 => 'lock',
9 => 'hum', # Humidity
10 => 'smoke_detection', # Smoke Detection
9 => 'humidity', # Humidity
10 => 'smokeDetection', # Smoke Detection
11 => 'presence',
12 => 'air_flow', # Air Flow
13 => 'power_consumption', # Power Consumption
14 => 'power_production', # Power Production
15 => 'pressure_intrusion', # PressureIntrusion
12 => 'airFlow', # Air Flow
13 => 'powerConsumption', # Power Consumption
14 => 'powerProduction', # Power Production
15 => 'pressureIntrusion', # PressureIntrusion
16 => 'intrusion',
};
$mapping_units = {
0 => '',
1 => '',
2 => 'C', # Degrees C
3 => 'F', # Degrees F
4 => 'K', # Degrees K
5 => 'V', # Volts
6 => 'A', # Amps,
7 => 'W', # Watts
0 => 'unknown',
1 => 'unknown',
2 => 'celsius', # Degrees C
3 => 'fahrenheit', # Degrees F
4 => 'kelvin', # Degrees K
5 => 'volt', # Volts
6 => 'ampere', # Amps,
7 => 'watt', # Watts
8 => 'Joules',
9 => 'Coulombs',
10 => 'VA',
@ -130,11 +130,11 @@ $mapping_units = {
26 => 'Mils',
27 => 'Inches',
28 => 'Feet',
29 => 'Cubic_Inches',
30 => 'Cubic_Feet',
29 => 'CubicInches',
30 => 'CubicFeet',
31 => 'Meters',
32 => 'Cubic_Centimeters',
33 => 'Cubic_Meters',
32 => 'CubicCentimeters',
33 => 'CubicMeters',
34 => 'Liters',
35 => 'Fluid_Ounces',
36 => 'Radians',
@ -144,8 +144,8 @@ $mapping_units = {
40 => 'Gravities',
41 => 'Ounces',
42 => 'Pounds',
43 => 'Foot_Pounds',
44 => 'Ounce_Inches',
43 => 'FootPounds',
44 => 'OunceInches',
45 => 'Gauss',
46 => 'Gilberts',
47 => 'Henries',
@ -160,14 +160,14 @@ $mapping_units = {
56 => 'DbC',
57 => 'Grays',
58 => 'Sieverts',
59 => 'Color_Temperature_Degrees_K',
60 => 'b', # bits
61 => 'B', # Bytes
59 => 'ColorTemperatureDegreesKelvin',
60 => 'bits', # bits
61 => 'bytes', # Bytes
62 => 'Words',
63 => 'DoubleWords',
64 => 'QuadWords',
65 => '%', # Percentage,
65 => 'percentage', # Percentage,
66 => 'Pascals',
};
1;
1;

View File

@ -50,10 +50,13 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => $message);
}
$self->{output}->perfdata_add(label => "used_memory", unit => 'B',
value => $used,
warning => $warn,
critical => $crit, min => 0, total => $total);
$self->{output}->perfdata_add(
label => "used_memory", unit => 'B',
nlabel => 'hardware.memory.usage.bytes',
value => $used,
warning => $warn,
critical => $crit, min => 0, total => $total
);
}
1;
1;

View File

@ -41,10 +41,13 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature is %s C", $temperature));
}
$self->{output}->perfdata_add(label => "temp", unit => 'C',
value => $temperature,
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => "temp", unit => 'C',
nlabel => 'hardware.temperature.celsius',
value => $temperature,
warning => $warn,
critical => $crit
);
}
1;
1;

View File

@ -75,10 +75,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s degree centigrade", $instance, $result->{axisTemperatureCelsius}));
}
$self->{output}->perfdata_add(label => "temperature_" . $instance, unit => 'C',
value => $result->{axisTemperatureCelsius},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => "temperature", unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $instance,
value => $result->{axisTemperatureCelsius},
warning => $warn,
critical => $crit
);
}
}
}

View File

@ -103,11 +103,15 @@ sub check_humidity {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Humdity '%s' is %s %%", $result->{HumidityDescription}, $result->{HumidityPercent}));
}
$self->{output}->perfdata_add(label => 'humidity_' . $result->{HumidityDescription}, unit => '%',
value => $result->{HumidityPercent},
warning => $warn,
critical => $crit,
min => 0, max => 100);
$self->{output}->perfdata_add(
label => 'humidity', unit => '%',
nlabel => 'hardware.sensor.humidity.percentage',
instances => $result->{HumidityDescription},
value => $result->{HumidityPercent},
warning => $warn,
critical => $crit,
min => 0, max => 100
);
}
}

View File

@ -57,8 +57,8 @@ our @EXPORT_OK = qw(%map_default1_status %map_default2_status %map_online %map_d
);
%map_degree_type = (
0 => 'F',
1 => 'C',
0 => { unit => 'F', unit_long => 'fahrenheit' },
1 => { unit => 'C', unit_long => 'celsius' },
);
1;

View File

@ -103,13 +103,16 @@ sub check_temperature {
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Temperature '%s' is %s %s", $result->{TempDescription}, $result->{TempDegree}, $result->{TempDegreeType}));
short_msg => sprintf("Temperature '%s' is %s %s", $result->{TempDescription}, $result->{TempDegree}, $result->{TempDegreeType}->{unit}));
}
$self->{output}->perfdata_add(label => 'temperature_' . $result->{TempDescription}, unit => $result->{TempDegreeType},
value => $result->{TempDegree},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'temperature', unit => $result->{TempDegreeType}->{unit},
nlabel => 'hardware.sensor.temperature.' . $result->{TempDegreeType}->{unit_long},
instances => $result->{TempDescription},
value => $result->{TempDegree},
warning => $warn,
critical => $crit,
);
}
}

View File

@ -59,10 +59,14 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("humidity '%s' value is %s %s", $result->{sensName}, $result->{sensValue}, $result->{sensUnit}));
}
$self->{output}->perfdata_add(label => 'sensor_' . $result->{sensName}, unit => $result->{sensUnit},
value => $result->{sensValue},
warning => $warn,
critical => $crit, min => 0, max => 100);
$self->{output}->perfdata_add(
label => 'sensor', unit => '%',
nlabel => 'hardware.sensor.humidity.percentage',
instances => $result->{sensName},
value => $result->{sensValue},
warning => $warn,
critical => $crit, min => 0, max => 100
);
}
}
}

View File

@ -59,10 +59,18 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("temperature '%s' value is %s %s", $result->{sensName}, $result->{sensValue}, $result->{sensUnit}));
}
$self->{output}->perfdata_add(label => 'sensor_' . $result->{sensName}, unit => $result->{sensUnit},
value => $result->{sensValue},
warning => $warn,
critical => $crit);
my $nunit = 'celsius';
$nunit = 'fahrenheit' if ($result->{sensUnit} =~ /F/i);
$nunit = 'kelvin' if ($result->{sensUnit} =~ /K/i);
$self->{output}->perfdata_add(
label => 'sensor', unit => $result->{sensUnit},
nlabel => 'hardware.sensor.temperature.' . $nunit,
instances => $result->{sensName},
value => $result->{sensValue},
warning => $warn,
critical => $crit
);
}
}
}

View File

@ -98,12 +98,16 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Humdity '%s' is %s %%", $result->{isDeviceMonitorHumidityName}, $result->{isDeviceMonitorHumidity}));
}
$self->{output}->perfdata_add(label => 'humidity_' . $result->{isDeviceMonitorHumidityName}, unit => '%',
value => $result->{isDeviceMonitorHumidity},
warning => $warn,
critical => $crit,
min => 0, max => 100);
$self->{output}->perfdata_add(
label => 'humidity', unit => '%',
nlabel => 'hardware.humidity.percentage',
instances => $result->{isDeviceMonitorHumidityName},
value => $result->{isDeviceMonitorHumidity},
warning => $warn,
critical => $crit,
min => 0, max => 100
);
}
}
1;
1;

View File

@ -99,12 +99,15 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Temperature '%s' is %s %s", $result->{isDeviceMonitorTemperatureName}, $result->{isDeviceMonitorTemperature}, $self->{temperature_unit}));
}
$self->{output}->perfdata_add(label => 'temperature_' . $result->{isDeviceMonitorTemperatureName}, unit => $self->{temperature_unit},
value => $result->{isDeviceMonitorTemperature},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'temperature', unit => $self->{temperature_unit},
nlabel => 'hardware.temperature.' . (($self->{temperature_unit} eq 'C') ? 'celsius' : 'fahrenheit'),
instances => $result->{isDeviceMonitorTemperatureName},
value => $result->{isDeviceMonitorTemperature},
warning => $warn,
critical => $crit,
);
}
}
1;
1;

View File

@ -72,9 +72,8 @@ sub new {
bless $self, $class;
$self->{version} = '1.0';
$options{options}->add_options(arguments =>
{
});
$options{options}->add_options(arguments => {
});
return $self;
}
@ -122,4 +121,4 @@ Example: --warning='temperature,.*,50'
=back
=cut
=cut

View File

@ -72,12 +72,15 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Air flow '%s' is %s m/min", $label, $result->{airFlowSensorValue}));
}
$self->{output}->perfdata_add(label => 'airflow_' . $label, unit => 'm/min',
value => $result->{airFlowSensorValue},
warning => $warn,
critical => $crit, min => 0
);
$self->{output}->perfdata_add(
label => 'airflow', unit => 'm/min',
nlabel => 'hardware.sensor.airflow.cubicmeterperminute',
instances => $label,
value => $result->{airFlowSensorValue},
warning => $warn,
critical => $crit, min => 0
);
}
}
1;
1;

View File

@ -72,12 +72,15 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Dew point '%s' is %s C", $label, $result->{dewPointSensorValue}));
}
$self->{output}->perfdata_add(label => 'dewpoint_' . $label, unit => 'C',
value => $result->{dewPointSensorValue},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'dewpoint', unit => 'C',
nlabel => 'hardware.sensor.dewpoint.celsius',
instances => $label,
value => $result->{dewPointSensorValue},
warning => $warn,
critical => $crit,
);
}
}
1;
1;

View File

@ -72,12 +72,15 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Humidity '%s' is %s %%", $label, $result->{humiSensorValue}));
}
$self->{output}->perfdata_add(label => 'humidity_' . $label, unit => '%',
value => $result->{humiSensorValue},
warning => $warn,
critical => $crit, min => 0, max => 100
);
$self->{output}->perfdata_add(
label => 'humidity', unit => '%',
nlabel => 'hardware.sensor.humidity.percentage',
instances => $label,
value => $result->{humiSensorValue},
warning => $warn,
critical => $crit, min => 0, max => 100
);
}
}
1;
1;

View File

@ -72,12 +72,15 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Temperature '%s' is %s C", $label, $result->{tempSensorValue}));
}
$self->{output}->perfdata_add(label => 'temperature_' . $label, unit => 'C',
value => $result->{tempSensorValue},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'temperature', unit => 'C',
nlabel => 'hardware.sensor.temperature.celsius',
instances => $label,
value => $result->{tempSensorValue},
warning => $warn,
critical => $crit,
);
}
}
1;
1;

View File

@ -104,14 +104,17 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Humidity sensor '%s' is %s %%", $result->{sensorProbeHumidityDescription}, $result->{sensorProbeHumidityPercent}));
}
$self->{output}->perfdata_add(label => 'humdity_' . $instance, unit => '%',
value => $result->{sensorProbeHumidityPercent},
warning => $warn,
critical => $crit,
min => 0, max => 100
);
$self->{output}->perfdata_add(
label => 'humdity', unit => '%',
nlabel => 'hardware.sensor.humidity.percentage',
instances => $instance,
value => $result->{sensorProbeHumidityPercent},
warning => $warn,
critical => $crit,
min => 0, max => 100
);
}
}
}
1;
1;

View File

@ -104,13 +104,16 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature sensor '%s' is %s degree centigrade", $result->{sensorProbeTempDescription}, $result->{sensorProbeTempDegree}));
}
$self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C',
value => $result->{sensorProbeTempDegree},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.sensor.temperature.celsius',
instances => $instance,
value => $result->{sensorProbeTempDegree},
warning => $warn,
critical => $crit,
);
}
}
}
1;
1;

View File

@ -88,12 +88,15 @@ sub check_fan {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' speed is %s rpm", $result->{$options{name}}, $result->{$options{speed}}));
}
$self->{output}->perfdata_add(label => 'fan_' . $result->{$options{name}}, unit => 'rpm',
value => $result->{$options{speed}},
warning => $warn,
critical => $crit,
min => 0
);
$self->{output}->perfdata_add(
label => 'fan', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => $result->{$options{name}},
value => $result->{$options{speed}},
warning => $warn,
critical => $crit,
min => 0
);
}
}

View File

@ -81,12 +81,15 @@ sub check_psu {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Power supply '%s' is %s W", $result->{$options{name}}, $result->{$options{current}}));
}
$self->{output}->perfdata_add(label => 'power_' . $result->{$options{name}}, unit => 'W',
value => $result->{$options{current}},
warning => $warn,
critical => $crit,
min => 0
);
$self->{output}->perfdata_add(
label => 'power', unit => 'W',
nlabel => 'hardware.powersupply.power.watt',
instances => $result->{$options{name}},
value => $result->{$options{current}},
warning => $warn,
critical => $crit,
min => 0
);
}
}

View File

@ -87,11 +87,14 @@ sub check_temperature {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s V", $result->{$options{name}}, $result->{$options{current}}));
}
$self->{output}->perfdata_add(label => 'temperature_' . $result->{$options{name}}, unit => 'C',
value => $result->{$options{current}},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'temperature', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $result->{$options{name}},
value => $result->{$options{current}},
warning => $warn,
critical => $crit,
);
}
}

View File

@ -89,11 +89,14 @@ sub check_voltage {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Voltage '%s' is %s V", $result->{$options{name}}, $result->{$options{current}}));
}
$self->{output}->perfdata_add(label => 'voltage_' . $result->{$options{name}}, unit => 'V',
value => $result->{$options{current}},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'voltage', unit => 'V',
nlabel => 'hardware.voltage.volt',
instances => $result->{$options{name}},
value => $result->{$options{current}},
warning => $warn,
critical => $crit,
);
}
}

View File

@ -79,11 +79,15 @@ sub check {
short_msg => sprintf("ambient '%s' is %s degree centigrade",
$temp, $value));
}
$self->{output}->perfdata_add(label => 'temp_' . $temp, unit => 'C',
value => $value,
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.ambient.temperature.celsius',
instances => $temp,
value => $value,
warning => $warn,
critical => $crit
);
}
}
1;
1;

View File

@ -76,11 +76,15 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Blower speed '%s' is %s %%", $instance, $blower_speed));
}
$self->{output}->perfdata_add(label => "blower_speed_" . $instance, unit => '%',
value => $blower_speed,
warning => $warn,
critical => $crit,
min => 0, max => 100);
$self->{output}->perfdata_add(
label => "blower_speed", unit => '%',
nlabel => 'hardware.blower.speed.percentage',
instances => $instance,
value => $blower_speed,
warning => $warn,
critical => $crit,
min => 0, max => 100
);
}
$self->{output}->output_add(long_msg => sprintf("Blower '%s' state is %s (%d %%).",
@ -108,4 +112,4 @@ sub check {
}
}
1;
1;

View File

@ -74,13 +74,17 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Chassis fan '%s' speed is %s rpm", $instance, $result->{chassisFanSpeedRPM}));
}
$self->{output}->perfdata_add(label => "chassisfan_" . $instance, unit => 'rpm',
value => $result->{chassisFanSpeedRPM},
warning => $warn,
critical => $crit,
min => 0);
$self->{output}->perfdata_add(
label => "chassisfan", unit => 'rpm',
nlabel => 'hardware.chassis.fan.speed.rpm',
instances => $instance,
value => $result->{chassisFanSpeedRPM},
warning => $warn,
critical => $crit,
min => 0
);
}
}
}
1;
1;

View File

@ -83,13 +83,17 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Fanpack '%s' speed is %s rpm", $instance, $result->{fanPackAverageSpeedRPM}));
}
$self->{output}->perfdata_add(label => "fanpack_" . $instance, unit => 'rpm',
value => $result->{fanPackAverageSpeedRPM},
warning => $warn,
critical => $crit,
min => 0);
$self->{output}->perfdata_add(
label => "fanpack", unit => 'rpm',
nlabel => 'hardware.fanpack.speed.rpm',
instances => $instance,
value => $result->{fanPackAverageSpeedRPM},
warning => $warn,
critical => $crit,
min => 0
);
}
}
}
1;
1;

View File

@ -71,11 +71,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' is '%s' %%", $result->{fanDescr}, $fan_speed));
}
$self->{output}->perfdata_add(label => 'fan_' . $result->{fanDescr}, unit => '%',
value => $fan_speed,
warning => $warn,
critical => $crit, min => 0, max => 100
);
$self->{output}->perfdata_add(
label => 'fan', unit => '%',
nlabel => 'hardware.fan.speed.percentage',
instances => $result->{fanDescr},
value => $fan_speed,
warning => $warn,
critical => $crit, min => 0, max => 100
);
}
}

View File

@ -78,10 +78,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s C", $result->{tempDescr}, $result->{tempReading}));
}
$self->{output}->perfdata_add(label => "temp_" . $result->{tempDescr}, unit => 'C',
value => $result->{tempReading},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => "temp", unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $result->{tempDescr},
value => $result->{tempReading},
warning => $warn,
critical => $crit
);
}
}
}

View File

@ -78,10 +78,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Voltage '%s' is %s", $result->{voltDescr}, $result->{voltReading}));
}
$self->{output}->perfdata_add(label => "volt_" . $result->{voltDescr},
value => $result->{voltReading},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => "volt",
nlabel => 'hardware.voltage.volt',
instances => $result->{voltDescr},
value => $result->{voltReading},
warning => $warn,
critical => $crit
);
}
}
}

View File

@ -68,11 +68,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' is '%s' %%", $result->{apEnvMonFanStatusDescr}, $result->{apEnvMonFanStatusValue}));
}
$self->{output}->perfdata_add(label => 'fan_' . $result->{apEnvMonFanStatusDescr}, unit => '%',
value => $result->{apEnvMonFanStatusValue},
warning => $warn,
critical => $crit, min => 0, max => 100
);
$self->{output}->perfdata_add(
label => 'fan', unit => '%',
nlabel => 'hardware.fan.speed.percentage',
instances => $result->{apEnvMonFanStatusDescr},
value => $result->{apEnvMonFanStatusValue},
warning => $warn,
critical => $crit, min => 0, max => 100
);
}
}

View File

@ -69,11 +69,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is '%s' C", $result->{apEnvMonTemperatureStatusDescr}, $result->{apEnvMonTemperatureStatusValue}));
}
$self->{output}->perfdata_add(label => 'temperature_' . $result->{apEnvMonTemperatureStatusDescr}, unit => 'C',
value => $result->{apEnvMonTemperatureStatusValue},
warning => $warn,
critical => $crit
);
$self->{output}->perfdata_add(
label => 'temperature', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $result->{apEnvMonTemperatureStatusDescr},
value => $result->{apEnvMonTemperatureStatusValue},
warning => $warn,
critical => $crit
);
}
}

View File

@ -70,11 +70,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Voltage '%s' is '%s' V", $result->{apEnvMonVoltageStatusDescr}, $result->{apEnvMonVoltageStatusValue}));
}
$self->{output}->perfdata_add(label => 'voltage_' . $result->{apEnvMonVoltageStatusDescr}, unit => 'V',
value => $result->{apEnvMonVoltageStatusValue},
warning => $warn,
critical => $crit
);
$self->{output}->perfdata_add(
label => 'voltage', unit => 'V',
nlabel => 'hardware.voltage.volt',
instances => $result->{apEnvMonVoltageStatusDescr},
value => $result->{apEnvMonVoltageStatusValue},
warning => $warn,
critical => $crit
);
}
}

View File

@ -59,13 +59,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Card '%s' temperature is %s C", $name, $temperature));
}
$self->{output}->perfdata_add(label => 'cardtemperature_' . $name,
unit => 'C',
value => $temperature,
warning => $warn,
critical => $crit
);
$self->{output}->perfdata_add(
label => 'cardtemperature', unit => 'C',
nlabel => 'hardware.card.temperature.celsius',
instances => $name,
value => $temperature,
warning => $warn,
critical => $crit
);
}
}
1;
1;

View File

@ -84,12 +84,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Sfp '%s' voltage is %s VDC", $name, $value));
}
$self->{output}->perfdata_add(label => 'sfp_voltage_' . $name,
unit => 'VDC',
value => $value,
warning => $warn,
critical => $crit
);
$self->{output}->perfdata_add(
label => 'sfp_voltage', unit => 'vdc',
nlabel => 'hardware.sfp.voltage.voltdc',
instances => $name,
value => $value,
warning => $warn,
critical => $crit
);
}
if ($result2->{sfpDiagTemperature} =~ /(\S+)\s+degrees Celsius/i) {
@ -99,12 +101,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Sfp '%s' temperature is %s C", $name, $value));
}
$self->{output}->perfdata_add(label => 'sfp_temperature_' . $name,
unit => 'C',
value => $value,
warning => $warn,
critical => $crit
);
$self->{output}->perfdata_add(
label => 'sfp_temperature', unit => 'C',
nlabel => 'hardware.sfp.temperature.celsius',
instances => $name,
value => $value,
warning => $warn,
critical => $crit
);
}
if ($result2->{sfpDiagTxPower} =~ /(\S+)\s+dBm/i) {
@ -114,12 +118,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Sfp '%s' tx power is %s dBm", $name, $value));
}
$self->{output}->perfdata_add(label => 'sfp_txpower_' . $name,
unit => 'dBm',
value => $value,
warning => $warn,
critical => $crit
);
$self->{output}->perfdata_add(
label => 'sfp_txpower', unit => 'dBm',
nlabel => 'hardware.sfp.txpower.dbm',
instances => $name,
value => $value,
warning => $warn,
critical => $crit
);
}
if ($result2->{sfpDiagRxPower} =~ /(\S+)\s+dBm/i) {
@ -129,12 +135,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Sfp '%s' rx power is %s dBm", $name, $value));
}
$self->{output}->perfdata_add(label => 'sfp_rxpower_' . $name,
unit => 'dBm',
value => $value,
warning => $warn,
critical => $crit
);
$self->{output}->perfdata_add(
label => 'sfp_rxpower', unit => 'dBm',
nlabel => 'hardware.sfp.rxpower.dbm',
instances => $name,
value => $value,
warning => $warn,
critical => $crit
);
}
if ($result2->{sfpDiagTxBiasCurrent} =~ /(\S+)\s+mA/i) {
@ -144,12 +152,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Sfp '%s' current is %s mA", $name, $value));
}
$self->{output}->perfdata_add(label => 'sfp_current_' . $name,
unit => 'mA',
value => $value,
warning => $warn,
critical => $crit
);
$self->{output}->perfdata_add(
label => 'sfp_current', unit => 'mA',
nlabel => 'hardware.sfp.current.milliampere',
instances => $name,
value => $value,
warning => $warn,
critical => $crit
);
}
}
}

View File

@ -55,9 +55,13 @@ sub check {
);
if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W',
value => $result->{chasEntPhysPower},
min => 0);
$self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.backplane.power.watt',
instances => $instance,
value => $result->{chasEntPhysPower},
min => 0
);
}
my $exit = $self->get_severity(label => 'admin', section => 'backplane.admin', value => $result->{chasEntPhysAdminStatus});

View File

@ -55,9 +55,13 @@ sub check {
);
if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W',
value => $result->{chasEntPhysPower},
min => 0);
$self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.chassis.power.watt',
instances => $instance,
value => $result->{chasEntPhysPower},
min => 0
);
}
my $exit = $self->get_severity(label => 'admin', section => 'chassis.admin', value => $result->{chasEntPhysAdminStatus});

View File

@ -55,9 +55,13 @@ sub check {
);
if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W',
value => $result->{chasEntPhysPower},
min => 0);
$self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.container.power.watt',
instances => $instance,
value => $result->{chasEntPhysPower},
min => 0
);
}
my $exit = $self->get_severity(label => 'admin', section => 'container.admin', value => $result->{chasEntPhysAdminStatus});

View File

@ -61,9 +61,13 @@ sub check {
);
if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W',
value => $result->{chasEntPhysPower},
min => 0);
$self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.fan.power.watt',
instances => $instance,
value => $result->{chasEntPhysPower},
min => 0
);
}
my $exit = $self->get_severity(label => 'admin', section => 'fan.admin', value => $result->{chasEntPhysAdminStatus});

View File

@ -55,9 +55,13 @@ sub check {
);
if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W',
value => $result->{chasEntPhysPower},
min => 0);
$self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.module.power.watt',
instances => $instance,
value => $result->{chasEntPhysPower},
min => 0
);
}
my $exit = $self->get_severity(label => 'admin', section => 'module.admin', value => $result->{chasEntPhysAdminStatus});

View File

@ -55,9 +55,13 @@ sub check {
);
if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W',
value => $result->{chasEntPhysPower},
min => 0);
$self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.other.power.watt',
instances => $instance,
value => $result->{chasEntPhysPower},
min => 0
);
}
my $exit = $self->get_severity(label => 'admin', section => 'other.admin', value => $result->{chasEntPhysAdminStatus});

View File

@ -55,9 +55,13 @@ sub check {
);
if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W',
value => $result->{chasEntPhysPower},
min => 0);
$self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.port.power.watt',
instances => $instance,
value => $result->{chasEntPhysPower},
min => 0
);
}
my $exit = $self->get_severity(label => 'admin', section => 'port.admin', value => $result->{chasEntPhysAdminStatus});

View File

@ -55,9 +55,13 @@ sub check {
);
if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W',
value => $result->{chasEntPhysPower},
min => 0);
$self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.powersupply.power.watt',
instances => $instance,
value => $result->{chasEntPhysPower},
min => 0
);
}
my $exit = $self->get_severity(label => 'admin', section => 'psu.admin', value => $result->{chasEntPhysAdminStatus});

View File

@ -55,9 +55,13 @@ sub check {
);
if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W',
value => $result->{chasEntPhysPower},
min => 0);
$self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.sensor.power.watt',
instances => $instance,
value => $result->{chasEntPhysPower},
min => 0
);
}
my $exit = $self->get_severity(label => 'admin', section => 'sensor.admin', value => $result->{chasEntPhysAdminStatus});

View File

@ -55,9 +55,13 @@ sub check {
);
if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W',
value => $result->{chasEntPhysPower},
min => 0);
$self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.stack.power.watt',
instances => $instance,
value => $result->{chasEntPhysPower},
min => 0
);
}
my $exit = $self->get_severity(label => 'admin', section => 'stack.admin', value => $result->{chasEntPhysAdminStatus});

View File

@ -55,9 +55,13 @@ sub check {
);
if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W',
value => $result->{chasEntPhysPower},
min => 0);
$self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.unknown.power.watt',
instances => $instance,
value => $result->{chasEntPhysPower},
min => 0
);
}
my $exit = $self->get_severity(label => 'admin', section => 'unknown.admin', value => $result->{chasEntPhysAdminStatus});

View File

@ -60,15 +60,16 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' speed is '%s' RPM", $result->{hwSensorName}, $result->{hwSensorValue}));
}
my $perf_label = $result->{hwSensorName};
$perf_label =~ s/ /_/g;
$self->{output}->perfdata_add(label => 'speed_' . $perf_label, unit => 'rpm',
value => $result->{hwSensorValue},
warning => $warn,
critical => $crit
);
$self->{output}->perfdata_add(
label => 'speed', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => $result->{hwSensorName},
value => $result->{hwSensorValue},
warning => $warn,
critical => $crit
);
}
}
1;
1;

View File

@ -60,15 +60,16 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is '%s' celsius degrees", $result->{hwSensorName}, $result->{hwSensorValue} / 1000));
}
my $perf_label = $result->{hwSensorName};
$perf_label =~ s/ /_/g;
$self->{output}->perfdata_add(label => 'temperature_' . $perf_label, unit => 'C',
value => $result->{hwSensorValue} / 1000,
warning => $warn,
critical => $crit
);
$self->{output}->perfdata_add(
label => 'temperature', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $result->{hwSensorName},
value => $result->{hwSensorValue} / 1000,
warning => $warn,
critical => $crit
);
}
}
1;
1;

View File

@ -61,14 +61,15 @@ sub check {
short_msg => sprintf("Voltage '%s' is '%s' mV", $result->{hwSensorName}, $result->{hwSensorValue}));
}
my $perf_label = $result->{hwSensorName};
$perf_label =~ s/ /_/g;
$self->{output}->perfdata_add(label => 'voltage_' . $perf_label, unit => 'mV',
value => $result->{hwSensorValue},
warning => $warn,
critical => $crit
);
$self->{output}->perfdata_add(
label => 'voltage', unit => 'mV',
nlabel => 'hardware.voltage.millivolt',
instances => $result->{hwSensorName},
value => $result->{hwSensorValue},
warning => $warn,
critical => $crit
);
}
}
1;
1;

View File

@ -46,22 +46,22 @@ my %map_code = (
15 => 'fanStopped',
);
my %map_units = (
1 => '', # other
2 => '', # truthvalue
3 => '', # specialEnum
4 => 'V', # volts
5 => 'C', # celsius
6 => 'rpm'
1 => { unit => '', nunit => '' }, # other
2 => { unit => '', nunit => '' }, # truthvalue
3 => { unit => '', nunit => '' }, # specialEnum
4 => { unit => 'V', nunit => 'voltage.volt' }, # volts
5 => { unit => 'C', nunit => 'temperature.celsius' }, # celsius
6 => { unit => 'rpm', nunit => 'speed.rpm' },
);
# In MIB 'BLUECOAT-SG-SENSOR-MIB'
my $mapping = {
deviceSensorUnits => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.3', map => \%map_units },
deviceSensorScale => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.4' },
deviceSensorValue => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.5' },
deviceSensorCode => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.6', map => \%map_code },
deviceSensorStatus => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.7', map => \%map_status },
deviceSensorName => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.9' },
deviceSensorUnits => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.3', map => \%map_units },
deviceSensorScale => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.4' },
deviceSensorValue => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.5' },
deviceSensorCode => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.6', map => \%map_code },
deviceSensorStatus => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.7', map => \%map_status },
deviceSensorName => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.9' },
};
my $oid_deviceSensorValueEntry = '.1.3.6.1.4.1.3417.2.1.1.1.1.1';
@ -77,7 +77,7 @@ sub check {
$self->{output}->output_add(long_msg => "Checking sensors");
$self->{components}->{sensor} = {name => 'sensors', total => 0, skip => 0};
return if ($self->check_filter(section => 'sensor'));
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_deviceSensorValueEntry}})) {
next if ($oid !~ /^$mapping->{deviceSensorStatus}->{oid}\.(.*)$/);
my $instance = $1;
@ -89,7 +89,7 @@ sub check {
$self->{output}->output_add(long_msg => sprintf("Sensor '%s' status is '%s' [instance: %s, operational status: %s, value: %s, scale: %s, unit: %s]",
$result->{deviceSensorName}, $result->{deviceSensorCode},
$instance, $result->{deviceSensorStatus}, $result->{deviceSensorValue}, $result->{deviceSensorScale},
$result->{deviceSensorUnits}));
$result->{deviceSensorUnits}->{unit}));
my $exit = $self->get_severity(section => 'sensor_opstatus', value => $result->{deviceSensorStatus});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit,
@ -103,19 +103,24 @@ sub check {
$result->{deviceSensorName}, $result->{deviceSensorCode}));
}
if (defined($result->{deviceSensorValue}) && $result->{deviceSensorValue} =~ /[0-9]/ && $result->{deviceSensorUnits} ne '') {
if (defined($result->{deviceSensorValue}) && $result->{deviceSensorValue} =~ /[0-9]/ && $result->{deviceSensorUnits}->{unit} ne '') {
my $value = ($result->{deviceSensorValue} * (10 ** $result->{deviceSensorScale}));
my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'sensor', instance => $instance, value => $value);
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Sensor '%s' value is %s %s", $result->{deviceSensorName}, $value, $result->{deviceSensorUnits}));
short_msg => sprintf("Sensor '%s' value is %s %s", $result->{deviceSensorName}, $value, $result->{deviceSensorUnits}->{unit}));
}
$self->{output}->perfdata_add(label => $result->{deviceSensorName}, unit => $result->{deviceSensorUnits},
value => $value,
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => 'sensor', unit => $result->{deviceSensorUnits}->{unit},
nlabel => 'hardware.sensor.' . $result->{deviceSensorUnits}->{nunit},
instances => $result->{deviceSensorName},
value => $value,
warning => $warn,
critical => $crit
);
}
}
}
1;
1;

View File

@ -68,8 +68,12 @@ sub check {
}
if (defined($result->{fanSpeedSensorValue}) && $result->{fanSpeedSensorValue} =~ /^[0-9\.]+$/) {
$self->{output}->perfdata_add(label => $result->{fanSpeedSensorName}, unit => 'rpm',
value => sprintf("%d", $result->{fanSpeedSensorValue}));
$self->{output}->perfdata_add(
label => 'fan_speed', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => [$result->{fanSpeedSensorName}, $instance],
value => sprintf("%d", $result->{fanSpeedSensorValue})
);
}
}
}

View File

@ -67,8 +67,12 @@ sub check {
}
if (defined($result->{tempertureSensorValue}) && $result->{tempertureSensorValue} =~ /^[0-9\.]+$/) {
$self->{output}->perfdata_add(label => 'temp_' . $result->{tempertureSensorName} . '_' . $instance , unit => 'C',
value => sprintf("%.2f", $result->{tempertureSensorValue}));
$self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => [$result->{tempertureSensorName}, $instance],
value => sprintf("%.2f", $result->{tempertureSensorValue})
);
}
}
}

View File

@ -67,8 +67,12 @@ sub check {
}
if (defined($result->{voltageSensorValue}) && $result->{voltageSensorValue} =~ /^[0-9\.]+$/) {
$self->{output}->perfdata_add(label => 'volt_' . $result->{voltageSensorName} . '_' . $instance, unit => 'V',
value => sprintf("%.2f", $result->{voltageSensorValue}));
$self->{output}->perfdata_add(
label => 'volt', unit => 'V',
nlabel => 'hardware.voltage.volt',
instances => [$result->{voltageSensorName}, $instance],
value => sprintf("%.2f", $result->{voltageSensorValue})
);
}
}
}

View File

@ -58,12 +58,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' is '%s' rpm", $result->{fanName}, $result->{fanRPMs}));
}
$self->{output}->perfdata_add(label => 'fan_' . $result->{fanName}, unit => 'rpm',
value => $result->{fanRPMs},
warning => $warn,
critical => $crit, min => 0
);
$self->{output}->perfdata_add(
label => 'fan', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => $result->{fanName},
value => $result->{fanRPMs},
warning => $warn,
critical => $crit, min => 0
);
}
}
1;
1;

View File

@ -72,12 +72,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s degree centigrade", $result->{temperatureName}, $result->{degreesCelsius}));
}
$self->{output}->perfdata_add(label => 'temp_' . $result->{temperatureName}, unit => 'C',
value => $result->{degreesCelsius},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $result->{temperatureName},
value => $result->{degreesCelsius},
warning => $warn,
critical => $crit,
);
}
}
1;
1;

View File

@ -60,12 +60,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' speed is %s rpm", $result->{sysHealthCounterName}, $result->{sysHealthCounterValue}));
}
$self->{output}->perfdata_add(label => 'speed_' . $result->{sysHealthCounterName}, unit => 'rpm',
value => $result->{sysHealthCounterValue},
warning => $warn,
critical => $crit, min => 0
);
$self->{output}->perfdata_add(
label => 'speed', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => $result->{sysHealthCounterName},
value => $result->{sysHealthCounterValue},
warning => $warn,
critical => $crit, min => 0
);
}
}
1;
1;

View File

@ -60,12 +60,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s C", $result->{sysHealthCounterName}, $result->{sysHealthCounterValue}));
}
$self->{output}->perfdata_add(label => 'temp_' . $result->{sysHealthCounterName}, unit => 'C',
value => $result->{sysHealthCounterValue},
warning => $warn,
critical => $crit, min => 0
);
$self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $result->{sysHealthCounterName},
value => $result->{sysHealthCounterValue},
warning => $warn,
critical => $crit, min => 0
);
}
}
1;
1;

View File

@ -61,12 +61,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Voltage '%s' is %s V", $result->{sysHealthCounterName}, $result->{sysHealthCounterValue}));
}
$self->{output}->perfdata_add(label => 'volt_' . $result->{sysHealthCounterName}, unit => 'V',
value => $result->{sysHealthCounterValue},
warning => $warn,
critical => $crit, min => 0
);
$self->{output}->perfdata_add(
label => 'volt', unit => 'V',
nlabel => 'hardware.voltage.volt',
instances => $result->{sysHealthCounterName},
value => $result->{sysHealthCounterValue},
warning => $warn,
critical => $crit, min => 0
);
}
}
1;
1;

View File

@ -77,12 +77,16 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("fan '%s' speed is %s rpm", $instance, $result->{swFanSpeed}));
}
$self->{output}->perfdata_add(label => "fan_" . $instance, unit => 'rpm',
value => $result->{swFanSpeed},
warning => $warn,
critical => $crit, min => 0);
$self->{output}->perfdata_add(
label => "fan", unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => $instance,
value => $result->{swFanSpeed},
warning => $warn,
critical => $crit, min => 0
);
}
}
}
1;
1;

View File

@ -58,11 +58,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s degree centigrade", $instance, $result->{swTemperatureCurrent}));
}
$self->{output}->perfdata_add(label => "temp_" . $instance, unit => 'C',
value => $result->{swTemperatureCurrent},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => "temp", unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $instance,
value => $result->{swTemperatureCurrent},
warning => $warn,
critical => $crit
);
}
}
1;
1;

View File

@ -70,12 +70,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' is '%s' rpm", $instance, $result->{extremeFanSpeed}));
}
$self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm',
value => $result->{extremeFanSpeed},
warning => $warn,
critical => $crit, min => 0
);
$self->{output}->perfdata_add(
label => 'fan', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => $instance,
value => $result->{extremeFanSpeed},
warning => $warn,
critical => $crit, min => 0
);
}
}
1;
1;

View File

@ -87,12 +87,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Poe '%s' is '%s' W", $instance, $result2->{extremePethSlotMeasuredPower}));
}
$self->{output}->perfdata_add(label => 'poe_power_' . $instance, unit => 'W',
value => $result2->{extremePethSlotMeasuredPower},
warning => $warn,
critical => $crit, min => 0
);
$self->{output}->perfdata_add(
label => 'poe_power', unit => 'W',
nlabel => 'hardware.poe.power.watt',
instances => $instance,
value => $result2->{extremePethSlotMeasuredPower},
warning => $warn,
critical => $crit, min => 0
);
}
}
1;
1;

View File

@ -103,13 +103,16 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Power supply '%s' power is '%s' W", $instance, $power));
}
$self->{output}->perfdata_add(label => 'psu_power_' . $instance, unit => 'W',
value => $power,
warning => $warn,
critical => $crit, min => 0
);
$self->{output}->perfdata_add(
label => 'psu_power', unit => 'W',
nlabel => 'hardware.powersupply.power.watt',
instances => $instance,
value => $power,
warning => $warn,
critical => $crit, min => 0
);
}
}
}
1;
1;

View File

@ -55,10 +55,13 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature is %s degree centigrade", $result->{extremeCurrentTemperature}));
}
$self->{output}->perfdata_add(label => "temp", unit => 'C',
value => $result->{extremeCurrentTemperature},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => "temp", unit => 'C',
nlabel => 'hardware.temperature.celsius',
value => $result->{extremeCurrentTemperature},
warning => $warn,
critical => $crit
);
}
1;
1;

View File

@ -75,11 +75,15 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("fan speed '%s' is %s rpm", $instance, $result->{sysChassisFanSpeed}));
}
$self->{output}->perfdata_add(label => "fan_" . $instance, unit => 'rpm',
value => $result->{sysChassisFanSpeed},
warning => $warn,
critical => $crit,
min => 0);
$self->{output}->perfdata_add(
label => "fan", unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => $instance,
value => $result->{sysChassisFanSpeed},
warning => $warn,
critical => $crit,
min => 0
);
}
}
}

View File

@ -58,10 +58,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %.2f C", $instance, $result->{sysChassisTempTemperature}));
}
$self->{output}->perfdata_add(label => "temp_" . $instance, unit => 'C',
value => sprintf("%.2f", $result->{sysChassisTempTemperature}),
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => "temp", unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $instance,
value => sprintf("%.2f", $result->{sysChassisTempTemperature}),
warning => $warn,
critical => $crit
);
}
}
}

View File

@ -67,10 +67,13 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature is %s degree centigrade", $result->{hmTemperature}));
}
$self->{output}->perfdata_add(label => "temp", unit => 'C',
value => $result->{hmTemperature},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => "temp", unit => 'C',
nlabel => 'hardware.temperature.celsius',
value => $result->{hmTemperature},
warning => $warn,
critical => $crit
);
}
1;
1;

View File

@ -106,12 +106,16 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Fru '%s' temperature is %s degree centigrade", $name, $result->{jnxFruTemp}));
}
$self->{output}->perfdata_add(label => "temp_" . $name, unit => 'C',
value => $result->{jnxFruTemp},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => "temp", unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $name,
value => $result->{jnxFruTemp},
warning => $warn,
critical => $crit
);
}
}
}
1;
1;

View File

@ -59,10 +59,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s C", $result->{nsTemperatureDesc}, $result->{nsTemperatureCur}));
}
$self->{output}->perfdata_add(label => $result->{nsTemperatureDesc}, unit => 'C',
value => $result->{nsTemperatureCur},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $result->{nsTemperatureDesc},
value => $result->{nsTemperatureCur},
warning => $warn,
critical => $crit
);
}
}

View File

@ -49,10 +49,13 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Current is '%s' A", $result->{mtxrHlCurrent} / 100));
}
$self->{output}->perfdata_add(label => 'current', unit => 'A',
value => $result->{mtxrHlCurrent} / 100,
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => 'current', unit => 'A',
nlabel => 'hardware.current.ampere',
value => $result->{mtxrHlCurrent} / 100,
warning => $warn,
critical => $crit
);
$self->{components}->{current}->{total}++;
}
}

View File

@ -50,10 +50,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '1' speed is '%s' RPM", $result->{mtxrHlFanSpeed1}));
}
$self->{output}->perfdata_add(label => 'fan_speed_1', unit => 'RPM',
value => $result->{mtxrHlFanSpeed1},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => 'fan_speed', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => '1',
value => $result->{mtxrHlFanSpeed1},
warning => $warn,
critical => $crit
);
$self->{components}->{fan}->{total}++;
}
if (defined($result->{mtxrHlFanSpeed2}) && $result->{mtxrHlFanSpeed2} =~ /[0-9]+/) {
@ -65,10 +69,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '2' speed is '%s' RPM", $result->{mtxrHlFanSpeed2}));
}
$self->{output}->perfdata_add(label => 'fan_speed_2', unit => 'RPM',
value => $result->{mtxrHlFanSpeed2},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => 'fan_speed', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => '2',
value => $result->{mtxrHlFanSpeed2},
warning => $warn,
critical => $crit
);
$self->{components}->{fan}->{total}++;
}
}

View File

@ -76,10 +76,13 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Power is '%s' W", $result->{mtxrHlPower} / 10));
}
$self->{output}->perfdata_add(label => 'power', unit => 'W',
value => $result->{mtxrHlPower} / 10,
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => 'power', unit => 'W',
nlabel => 'hardware.power.watt',
value => $result->{mtxrHlPower} / 10,
warning => $warn,
critical => $crit
);
$self->{components}->{psu}->{total}++;
}
}

View File

@ -50,10 +50,13 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature is '%s' C", $result->{mtxrHlTemperature} / 10));
}
$self->{output}->perfdata_add(label => 'temperature', unit => 'C',
value => $result->{mtxrHlTemperature} / 10,
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => 'temperature', unit => 'C',
nlabel => 'hardware.temperature.celsius',
value => $result->{mtxrHlTemperature} / 10,
warning => $warn,
critical => $crit
);
$self->{components}->{temperature}->{total}++;
}
if (defined($result->{mtxrHlProcessorTemperature}) && $result->{mtxrHlProcessorTemperature} =~ /[0-9]+/) {
@ -65,10 +68,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Processor temperature is '%s' C", $result->{mtxrHlProcessorTemperature} / 10));
}
$self->{output}->perfdata_add(label => 'temperature_processor', unit => 'C',
value => $result->{mtxrHlProcessorTemperature} / 10,
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => 'temperature', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => 'processor',
value => $result->{mtxrHlProcessorTemperature} / 10,
warning => $warn,
critical => $crit
);
$self->{components}->{temperature}->{total}++;
}
}

View File

@ -49,10 +49,13 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Voltage is '%s' V", $result->{mtxrHlVoltage} / 10));
}
$self->{output}->perfdata_add(label => 'voltage', unit => 'V',
value => $result->{mtxrHlVoltage} / 10,
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => 'voltage', unit => 'V',
nlabel => 'hardware.voltage.volt',
value => $result->{mtxrHlVoltage} / 10,
warning => $warn,
critical => $crit
);
$self->{components}->{voltage}->{total}++;
}
}

View File

@ -75,11 +75,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' is '%s' rpm", $instance, $result->{boxServicesFanSpeed}));
}
$self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm',
value => $result->{boxServicesFanSpeed},
warning => $warn,
critical => $crit, min => 0
);
$self->{output}->perfdata_add(
label => 'fan', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => $instance,
value => $result->{boxServicesFanSpeed},
warning => $warn,
critical => $crit, min => 0
);
}
}

View File

@ -75,11 +75,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is '%s' rpm", $instance, $result->{boxServicesTempSensorTemperature}));
}
$self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C',
value => $result->{boxServicesTempSensorTemperature},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $instance,
value => $result->{boxServicesTempSensorTemperature},
warning => $warn,
critical => $crit,
);
}
}

View File

@ -67,12 +67,15 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Fan temperature '%s' is %s degree centigrade", $instance, $result->{rcChasFanAmbientTemperature}));
}
$self->{output}->perfdata_add(label => 'fan_temp_' . $instance, unit => 'C',
value => $result->{rcChasFanAmbientTemperature},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'fan_temp', unit => 'C',
nlabel => 'hardware.fan.temperature.celsius',
instances => $instance,
value => $result->{rcChasFanAmbientTemperature},
warning => $warn,
critical => $crit,
);
}
}
1;
1;

View File

@ -59,12 +59,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s degree centigrade", $result->{slHdwTempSensorName}, $result->{s5ChasTmpSnrTmpValue}));
}
$self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C',
value => $result->{s5ChasTmpSnrTmpValue},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $instance,
value => $result->{s5ChasTmpSnrTmpValue},
warning => $warn,
critical => $crit,
);
}
}
1;
1;

View File

@ -69,11 +69,15 @@ sub check {
short_msg => sprintf("Fan speed '%s' is %s rpm", $instance, $result->{raisecomFanSpeedValue}));
}
$self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm',
value => $result->{raisecomFanSpeedValue},
warning => $warn,
critical => $crit,
min => 0);
$self->{output}->perfdata_add(
label => 'fan', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => $instance,
value => $result->{raisecomFanSpeedValue},
warning => $warn,
critical => $crit,
min => 0
);
}
}

View File

@ -72,11 +72,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %.2f C", $instance, $result->{raisecomTemperatureValue}));
}
$self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C',
value => $result->{raisecomTemperatureValue},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $instance,
value => $result->{raisecomTemperatureValue},
warning => $warn,
critical => $crit,
);
}
}

View File

@ -72,11 +72,14 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Voltage '%s' is %.2f mV", $instance, $result->{raisecomVoltValue}));
}
$self->{output}->perfdata_add(label => 'volt_' . $instance, unit => 'mV',
value => $result->{raisecomVoltValue},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'volt', unit => 'mV',
nlabel => 'hardware.voltage.volt',
instances => $instance,
value => $result->{raisecomVoltValue},
warning => $warn,
critical => $crit,
);
}
}

View File

@ -60,11 +60,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %sC", $result->{rbnEntityTempDescr}, $result->{rbnEntityTempCurrent}));
}
$self->{output}->perfdata_add(label => "temp_" . $instance, unit => 'C',
value => $result->{rbnEntityTempCurrent},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => "temp", unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => $instance,
value => $result->{rbnEntityTempCurrent},
warning => $warn,
critical => $crit
);
}
}
1;
1;

View File

@ -60,11 +60,15 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Voltage '%s' is %s mV", $result->{rbnVoltageDescr}, $result->{rbnVoltageCurrent}));
}
$self->{output}->perfdata_add(label => "volt_" . $instance, unit => 'mV',
value => $result->{rbnVoltageCurrent},
warning => $warn,
critical => $crit);
$self->{output}->perfdata_add(
label => "volt", unit => 'mV',
nlabel => 'hardware.voltage.millivolt',
instances => $instance,
value => $result->{rbnVoltageCurrent},
warning => $warn,
critical => $crit
);
}
}
1;
1;

View File

@ -71,12 +71,15 @@ sub fan_ctrl {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Fan '%s' is %s rpm", $instance, $result->{speed}));
}
$self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm',
value => $result->{speed},
warning => $warn,
critical => $crit,
min => 0
);
$self->{output}->perfdata_add(
label => 'fan_' . $instance, unit => 'rpm',
nlabel => 'hardware.fan.controller.speed.rpm',
instances => $instance,
value => $result->{speed},
warning => $warn,
critical => $crit,
min => 0
);
}
}
}

View File

@ -122,11 +122,14 @@ sub psu_diskshelf {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Power supply '%s' is %s V", $instance, $voltage->{current}));
}
$self->{output}->perfdata_add(label => 'voltage_' . $instance . '/' . $voltage->{type}, unit => 'V',
value => $voltage->{current},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'voltage', unit => 'V',
nlabel => 'hardware.powersupply.diskshelf.voltage.volt',
instances => [$instance, $voltage->{type}],
value => $voltage->{current},
warning => $warn,
critical => $crit,
);
}
}
}

View File

@ -64,11 +64,14 @@ sub temp_ctrl {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s C", $instance, $result->{tempc}));
}
$self->{output}->perfdata_add(label => 'temperature_' . $instance, unit => 'C',
value => $result->{tempc},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'temperature', unit => 'C',
nlabel => 'hardware.temperature.controller.celsius',
instances => $instance,
value => $result->{tempc},
warning => $warn,
critical => $crit,
);
}
}
}
@ -118,11 +121,14 @@ sub temp_diskshelf {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Temperature '%s' is %s C", $instance, $result->{tempc}));
}
$self->{output}->perfdata_add(label => 'temperature_' . $instance, unit => 'C',
value => $result->{tempc},
warning => $warn,
critical => $crit,
);
$self->{output}->perfdata_add(
label => 'temperature', unit => 'C',
nlabel => 'hardware.temperature.diskshelf.celsius',
instances => $instance,
value => $result->{tempc},
warning => $warn,
critical => $crit,
);
}
}
}

View File

@ -82,10 +82,14 @@ sub check {
last;
}
}
$self->{output}->perfdata_add(label => $sensor_id, unit => $unit,
value => $value) if (defined($value));
if (defined($value)) {
$self->{output}->perfdata_add(
label => $sensor_id, unit => $unit,
value => $value
);
}
}
}
1;
1;