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

View File

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

View File

@ -50,10 +50,13 @@ sub check {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(severity => $exit,
short_msg => $message); short_msg => $message);
} }
$self->{output}->perfdata_add(label => "used_memory", unit => 'B', $self->{output}->perfdata_add(
value => $used, label => "used_memory", unit => 'B',
warning => $warn, nlabel => 'hardware.memory.usage.bytes',
critical => $crit, min => 0, total => $total); 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature is %s C", $temperature)); short_msg => sprintf("Temperature is %s C", $temperature));
} }
$self->{output}->perfdata_add(label => "temp", unit => 'C', $self->{output}->perfdata_add(
value => $temperature, label => "temp", unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.celsius',
critical => $crit); value => $temperature,
warning => $warn,
critical => $crit
);
} }
1; 1;

View File

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

View File

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

View File

@ -103,13 +103,16 @@ sub check_temperature {
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit2, $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}, $self->{output}->perfdata_add(
value => $result->{TempDegree}, label => 'temperature', unit => $result->{TempDegreeType}->{unit},
warning => $warn, nlabel => 'hardware.sensor.temperature.' . $result->{TempDegreeType}->{unit_long},
critical => $crit, instances => $result->{TempDescription},
); value => $result->{TempDegree},
warning => $warn,
critical => $crit,
);
} }
} }

View File

@ -59,10 +59,14 @@ sub check {
$self->{output}->output_add(severity => $exit2, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("humidity '%s' value is %s %s", $result->{sensName}, $result->{sensValue}, $result->{sensUnit})); 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}, $self->{output}->perfdata_add(
value => $result->{sensValue}, label => 'sensor', unit => '%',
warning => $warn, nlabel => 'hardware.sensor.humidity.percentage',
critical => $crit, min => 0, max => 100); 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, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("temperature '%s' value is %s %s", $result->{sensName}, $result->{sensValue}, $result->{sensUnit})); 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}, my $nunit = 'celsius';
warning => $warn, $nunit = 'fahrenheit' if ($result->{sensUnit} =~ /F/i);
critical => $crit); $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, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Humdity '%s' is %s %%", $result->{isDeviceMonitorHumidityName}, $result->{isDeviceMonitorHumidity})); short_msg => sprintf("Humdity '%s' is %s %%", $result->{isDeviceMonitorHumidityName}, $result->{isDeviceMonitorHumidity}));
} }
$self->{output}->perfdata_add(label => 'humidity_' . $result->{isDeviceMonitorHumidityName}, unit => '%', $self->{output}->perfdata_add(
value => $result->{isDeviceMonitorHumidity}, label => 'humidity', unit => '%',
warning => $warn, nlabel => 'hardware.humidity.percentage',
critical => $crit, instances => $result->{isDeviceMonitorHumidityName},
min => 0, max => 100); 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, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Temperature '%s' is %s %s", $result->{isDeviceMonitorTemperatureName}, $result->{isDeviceMonitorTemperature}, $self->{temperature_unit})); 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}, $self->{output}->perfdata_add(
value => $result->{isDeviceMonitorTemperature}, label => 'temperature', unit => $self->{temperature_unit},
warning => $warn, nlabel => 'hardware.temperature.' . (($self->{temperature_unit} eq 'C') ? 'celsius' : 'fahrenheit'),
critical => $crit, instances => $result->{isDeviceMonitorTemperatureName},
); value => $result->{isDeviceMonitorTemperature},
warning => $warn,
critical => $crit,
);
} }
} }
1; 1;

View File

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

View File

@ -72,12 +72,15 @@ sub check {
$self->{output}->output_add(severity => $exit2, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Air flow '%s' is %s m/min", $label, $result->{airFlowSensorValue})); short_msg => sprintf("Air flow '%s' is %s m/min", $label, $result->{airFlowSensorValue}));
} }
$self->{output}->perfdata_add(label => 'airflow_' . $label, unit => 'm/min', $self->{output}->perfdata_add(
value => $result->{airFlowSensorValue}, label => 'airflow', unit => 'm/min',
warning => $warn, nlabel => 'hardware.sensor.airflow.cubicmeterperminute',
critical => $crit, min => 0 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, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Dew point '%s' is %s C", $label, $result->{dewPointSensorValue})); short_msg => sprintf("Dew point '%s' is %s C", $label, $result->{dewPointSensorValue}));
} }
$self->{output}->perfdata_add(label => 'dewpoint_' . $label, unit => 'C', $self->{output}->perfdata_add(
value => $result->{dewPointSensorValue}, label => 'dewpoint', unit => 'C',
warning => $warn, nlabel => 'hardware.sensor.dewpoint.celsius',
critical => $crit, 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, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Humidity '%s' is %s %%", $label, $result->{humiSensorValue})); short_msg => sprintf("Humidity '%s' is %s %%", $label, $result->{humiSensorValue}));
} }
$self->{output}->perfdata_add(label => 'humidity_' . $label, unit => '%', $self->{output}->perfdata_add(
value => $result->{humiSensorValue}, label => 'humidity', unit => '%',
warning => $warn, nlabel => 'hardware.sensor.humidity.percentage',
critical => $crit, min => 0, max => 100 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, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Temperature '%s' is %s C", $label, $result->{tempSensorValue})); short_msg => sprintf("Temperature '%s' is %s C", $label, $result->{tempSensorValue}));
} }
$self->{output}->perfdata_add(label => 'temperature_' . $label, unit => 'C', $self->{output}->perfdata_add(
value => $result->{tempSensorValue}, label => 'temperature', unit => 'C',
warning => $warn, nlabel => 'hardware.sensor.temperature.celsius',
critical => $crit, 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Humidity sensor '%s' is %s %%", $result->{sensorProbeHumidityDescription}, $result->{sensorProbeHumidityPercent})); short_msg => sprintf("Humidity sensor '%s' is %s %%", $result->{sensorProbeHumidityDescription}, $result->{sensorProbeHumidityPercent}));
} }
$self->{output}->perfdata_add(label => 'humdity_' . $instance, unit => '%', $self->{output}->perfdata_add(
value => $result->{sensorProbeHumidityPercent}, label => 'humdity', unit => '%',
warning => $warn, nlabel => 'hardware.sensor.humidity.percentage',
critical => $crit, instances => $instance,
min => 0, max => 100 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature sensor '%s' is %s degree centigrade", $result->{sensorProbeTempDescription}, $result->{sensorProbeTempDegree})); short_msg => sprintf("Temperature sensor '%s' is %s degree centigrade", $result->{sensorProbeTempDescription}, $result->{sensorProbeTempDegree}));
} }
$self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C', $self->{output}->perfdata_add(
value => $result->{sensorProbeTempDegree}, label => 'temp', unit => 'C',
warning => $warn, nlabel => 'hardware.sensor.temperature.celsius',
critical => $crit, 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' speed is %s rpm", $result->{$options{name}}, $result->{$options{speed}})); 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', $self->{output}->perfdata_add(
value => $result->{$options{speed}}, label => 'fan', unit => 'rpm',
warning => $warn, nlabel => 'hardware.fan.speed.rpm',
critical => $crit, instances => $result->{$options{name}},
min => 0 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Power supply '%s' is %s W", $result->{$options{name}}, $result->{$options{current}})); 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', $self->{output}->perfdata_add(
value => $result->{$options{current}}, label => 'power', unit => 'W',
warning => $warn, nlabel => 'hardware.powersupply.power.watt',
critical => $crit, instances => $result->{$options{name}},
min => 0 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s V", $result->{$options{name}}, $result->{$options{current}})); 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', $self->{output}->perfdata_add(
value => $result->{$options{current}}, label => 'temperature', unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.celsius',
critical => $crit, 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Voltage '%s' is %s V", $result->{$options{name}}, $result->{$options{current}})); 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', $self->{output}->perfdata_add(
value => $result->{$options{current}}, label => 'voltage', unit => 'V',
warning => $warn, nlabel => 'hardware.voltage.volt',
critical => $crit, 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", short_msg => sprintf("ambient '%s' is %s degree centigrade",
$temp, $value)); $temp, $value));
} }
$self->{output}->perfdata_add(label => 'temp_' . $temp, unit => 'C', $self->{output}->perfdata_add(
value => $value, label => 'temp', unit => 'C',
warning => $warn, nlabel => 'hardware.ambient.temperature.celsius',
critical => $crit); instances => $temp,
value => $value,
warning => $warn,
critical => $crit
);
} }
} }
1; 1;

View File

@ -76,11 +76,15 @@ sub check {
$self->{output}->output_add(severity => $exit2, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Blower speed '%s' is %s %%", $instance, $blower_speed)); short_msg => sprintf("Blower speed '%s' is %s %%", $instance, $blower_speed));
} }
$self->{output}->perfdata_add(label => "blower_speed_" . $instance, unit => '%', $self->{output}->perfdata_add(
value => $blower_speed, label => "blower_speed", unit => '%',
warning => $warn, nlabel => 'hardware.blower.speed.percentage',
critical => $crit, instances => $instance,
min => 0, max => 100); value => $blower_speed,
warning => $warn,
critical => $crit,
min => 0, max => 100
);
} }
$self->{output}->output_add(long_msg => sprintf("Blower '%s' state is %s (%d %%).", $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, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Chassis fan '%s' speed is %s rpm", $instance, $result->{chassisFanSpeedRPM})); short_msg => sprintf("Chassis fan '%s' speed is %s rpm", $instance, $result->{chassisFanSpeedRPM}));
} }
$self->{output}->perfdata_add(label => "chassisfan_" . $instance, unit => 'rpm', $self->{output}->perfdata_add(
value => $result->{chassisFanSpeedRPM}, label => "chassisfan", unit => 'rpm',
warning => $warn, nlabel => 'hardware.chassis.fan.speed.rpm',
critical => $crit, instances => $instance,
min => 0); 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, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Fanpack '%s' speed is %s rpm", $instance, $result->{fanPackAverageSpeedRPM})); short_msg => sprintf("Fanpack '%s' speed is %s rpm", $instance, $result->{fanPackAverageSpeedRPM}));
} }
$self->{output}->perfdata_add(label => "fanpack_" . $instance, unit => 'rpm', $self->{output}->perfdata_add(
value => $result->{fanPackAverageSpeedRPM}, label => "fanpack", unit => 'rpm',
warning => $warn, nlabel => 'hardware.fanpack.speed.rpm',
critical => $crit, instances => $instance,
min => 0); 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' is '%s' %%", $result->{fanDescr}, $fan_speed)); short_msg => sprintf("Fan '%s' is '%s' %%", $result->{fanDescr}, $fan_speed));
} }
$self->{output}->perfdata_add(label => 'fan_' . $result->{fanDescr}, unit => '%', $self->{output}->perfdata_add(
value => $fan_speed, label => 'fan', unit => '%',
warning => $warn, nlabel => 'hardware.fan.speed.percentage',
critical => $crit, min => 0, max => 100 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s C", $result->{tempDescr}, $result->{tempReading})); short_msg => sprintf("Temperature '%s' is %s C", $result->{tempDescr}, $result->{tempReading}));
} }
$self->{output}->perfdata_add(label => "temp_" . $result->{tempDescr}, unit => 'C', $self->{output}->perfdata_add(
value => $result->{tempReading}, label => "temp", unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.celsius',
critical => $crit); instances => $result->{tempDescr},
value => $result->{tempReading},
warning => $warn,
critical => $crit
);
} }
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,9 +55,13 @@ sub check {
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result->{chasEntPhysPower}, label => "power", unit => 'W',
min => 0); 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}); 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) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result->{chasEntPhysPower}, label => "power", unit => 'W',
min => 0); 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}); 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) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result->{chasEntPhysPower}, label => "power", unit => 'W',
min => 0); 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}); 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) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result->{chasEntPhysPower}, label => "power", unit => 'W',
min => 0); 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}); 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) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result->{chasEntPhysPower}, label => "power", unit => 'W',
min => 0); 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}); 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) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result->{chasEntPhysPower}, label => "power", unit => 'W',
min => 0); 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}); 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) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result->{chasEntPhysPower}, label => "power", unit => 'W',
min => 0); 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}); 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) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result->{chasEntPhysPower}, label => "power", unit => 'W',
min => 0); 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}); 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) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result->{chasEntPhysPower}, label => "power", unit => 'W',
min => 0); 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}); 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) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result->{chasEntPhysPower}, label => "power", unit => 'W',
min => 0); 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}); 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) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add(label => "power_" . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result->{chasEntPhysPower}, label => "power", unit => 'W',
min => 0); 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}); 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' speed is '%s' RPM", $result->{hwSensorName}, $result->{hwSensorValue})); short_msg => sprintf("Fan '%s' speed is '%s' RPM", $result->{hwSensorName}, $result->{hwSensorValue}));
} }
my $perf_label = $result->{hwSensorName}; $self->{output}->perfdata_add(
$perf_label =~ s/ /_/g; label => 'speed', unit => 'rpm',
$self->{output}->perfdata_add(label => 'speed_' . $perf_label, unit => 'rpm', nlabel => 'hardware.fan.speed.rpm',
value => $result->{hwSensorValue}, instances => $result->{hwSensorName},
warning => $warn, value => $result->{hwSensorValue},
critical => $crit warning => $warn,
); critical => $crit
);
} }
} }
1; 1;

View File

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

View File

@ -46,22 +46,22 @@ my %map_code = (
15 => 'fanStopped', 15 => 'fanStopped',
); );
my %map_units = ( my %map_units = (
1 => '', # other 1 => { unit => '', nunit => '' }, # other
2 => '', # truthvalue 2 => { unit => '', nunit => '' }, # truthvalue
3 => '', # specialEnum 3 => { unit => '', nunit => '' }, # specialEnum
4 => 'V', # volts 4 => { unit => 'V', nunit => 'voltage.volt' }, # volts
5 => 'C', # celsius 5 => { unit => 'C', nunit => 'temperature.celsius' }, # celsius
6 => 'rpm' 6 => { unit => 'rpm', nunit => 'speed.rpm' },
); );
# In MIB 'BLUECOAT-SG-SENSOR-MIB' # In MIB 'BLUECOAT-SG-SENSOR-MIB'
my $mapping = { my $mapping = {
deviceSensorUnits => { oid => '.1.3.6.1.4.1.3417.2.1.1.1.1.1.3', map => \%map_units }, 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' }, 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' }, 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 }, 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 }, 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' }, 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'; 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->{output}->output_add(long_msg => "Checking sensors");
$self->{components}->{sensor} = {name => 'sensors', total => 0, skip => 0}; $self->{components}->{sensor} = {name => 'sensors', total => 0, skip => 0};
return if ($self->check_filter(section => 'sensor')); return if ($self->check_filter(section => 'sensor'));
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_deviceSensorValueEntry}})) { foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_deviceSensorValueEntry}})) {
next if ($oid !~ /^$mapping->{deviceSensorStatus}->{oid}\.(.*)$/); next if ($oid !~ /^$mapping->{deviceSensorStatus}->{oid}\.(.*)$/);
my $instance = $1; 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]", $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}, $result->{deviceSensorName}, $result->{deviceSensorCode},
$instance, $result->{deviceSensorStatus}, $result->{deviceSensorValue}, $result->{deviceSensorScale}, $instance, $result->{deviceSensorStatus}, $result->{deviceSensorValue}, $result->{deviceSensorScale},
$result->{deviceSensorUnits})); $result->{deviceSensorUnits}->{unit}));
my $exit = $self->get_severity(section => 'sensor_opstatus', value => $result->{deviceSensorStatus}); my $exit = $self->get_severity(section => 'sensor_opstatus', value => $result->{deviceSensorStatus});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(severity => $exit,
@ -103,19 +103,24 @@ sub check {
$result->{deviceSensorName}, $result->{deviceSensorCode})); $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 $value = ($result->{deviceSensorValue} * (10 ** $result->{deviceSensorScale}));
my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'sensor', instance => $instance, value => $value); 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)) { if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit2, $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, $self->{output}->perfdata_add(
warning => $warn, label => 'sensor', unit => $result->{deviceSensorUnits}->{unit},
critical => $crit); 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\.]+$/) { if (defined($result->{fanSpeedSensorValue}) && $result->{fanSpeedSensorValue} =~ /^[0-9\.]+$/) {
$self->{output}->perfdata_add(label => $result->{fanSpeedSensorName}, unit => 'rpm', $self->{output}->perfdata_add(
value => sprintf("%d", $result->{fanSpeedSensorValue})); 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\.]+$/) { if (defined($result->{tempertureSensorValue}) && $result->{tempertureSensorValue} =~ /^[0-9\.]+$/) {
$self->{output}->perfdata_add(label => 'temp_' . $result->{tempertureSensorName} . '_' . $instance , unit => 'C', $self->{output}->perfdata_add(
value => sprintf("%.2f", $result->{tempertureSensorValue})); 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\.]+$/) { if (defined($result->{voltageSensorValue}) && $result->{voltageSensorValue} =~ /^[0-9\.]+$/) {
$self->{output}->perfdata_add(label => 'volt_' . $result->{voltageSensorName} . '_' . $instance, unit => 'V', $self->{output}->perfdata_add(
value => sprintf("%.2f", $result->{voltageSensorValue})); 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' is '%s' rpm", $result->{fanName}, $result->{fanRPMs})); short_msg => sprintf("Fan '%s' is '%s' rpm", $result->{fanName}, $result->{fanRPMs}));
} }
$self->{output}->perfdata_add(label => 'fan_' . $result->{fanName}, unit => 'rpm', $self->{output}->perfdata_add(
value => $result->{fanRPMs}, label => 'fan', unit => 'rpm',
warning => $warn, nlabel => 'hardware.fan.speed.rpm',
critical => $crit, min => 0 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s degree centigrade", $result->{temperatureName}, $result->{degreesCelsius})); short_msg => sprintf("Temperature '%s' is %s degree centigrade", $result->{temperatureName}, $result->{degreesCelsius}));
} }
$self->{output}->perfdata_add(label => 'temp_' . $result->{temperatureName}, unit => 'C', $self->{output}->perfdata_add(
value => $result->{degreesCelsius}, label => 'temp', unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.celsius',
critical => $crit, 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' speed is %s rpm", $result->{sysHealthCounterName}, $result->{sysHealthCounterValue})); short_msg => sprintf("Fan '%s' speed is %s rpm", $result->{sysHealthCounterName}, $result->{sysHealthCounterValue}));
} }
$self->{output}->perfdata_add(label => 'speed_' . $result->{sysHealthCounterName}, unit => 'rpm', $self->{output}->perfdata_add(
value => $result->{sysHealthCounterValue}, label => 'speed', unit => 'rpm',
warning => $warn, nlabel => 'hardware.fan.speed.rpm',
critical => $crit, min => 0 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s C", $result->{sysHealthCounterName}, $result->{sysHealthCounterValue})); short_msg => sprintf("Temperature '%s' is %s C", $result->{sysHealthCounterName}, $result->{sysHealthCounterValue}));
} }
$self->{output}->perfdata_add(label => 'temp_' . $result->{sysHealthCounterName}, unit => 'C', $self->{output}->perfdata_add(
value => $result->{sysHealthCounterValue}, label => 'temp', unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.celsius',
critical => $crit, min => 0 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Voltage '%s' is %s V", $result->{sysHealthCounterName}, $result->{sysHealthCounterValue})); short_msg => sprintf("Voltage '%s' is %s V", $result->{sysHealthCounterName}, $result->{sysHealthCounterValue}));
} }
$self->{output}->perfdata_add(label => 'volt_' . $result->{sysHealthCounterName}, unit => 'V', $self->{output}->perfdata_add(
value => $result->{sysHealthCounterValue}, label => 'volt', unit => 'V',
warning => $warn, nlabel => 'hardware.voltage.volt',
critical => $crit, min => 0 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, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("fan '%s' speed is %s rpm", $instance, $result->{swFanSpeed})); short_msg => sprintf("fan '%s' speed is %s rpm", $instance, $result->{swFanSpeed}));
} }
$self->{output}->perfdata_add(label => "fan_" . $instance, unit => 'rpm', $self->{output}->perfdata_add(
value => $result->{swFanSpeed}, label => "fan", unit => 'rpm',
warning => $warn, nlabel => 'hardware.fan.speed.rpm',
critical => $crit, min => 0); 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s degree centigrade", $instance, $result->{swTemperatureCurrent})); short_msg => sprintf("Temperature '%s' is %s degree centigrade", $instance, $result->{swTemperatureCurrent}));
} }
$self->{output}->perfdata_add(label => "temp_" . $instance, unit => 'C', $self->{output}->perfdata_add(
value => $result->{swTemperatureCurrent}, label => "temp", unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.celsius',
critical => $crit); 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' is '%s' rpm", $instance, $result->{extremeFanSpeed})); short_msg => sprintf("Fan '%s' is '%s' rpm", $instance, $result->{extremeFanSpeed}));
} }
$self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm', $self->{output}->perfdata_add(
value => $result->{extremeFanSpeed}, label => 'fan', unit => 'rpm',
warning => $warn, nlabel => 'hardware.fan.speed.rpm',
critical => $crit, min => 0 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Poe '%s' is '%s' W", $instance, $result2->{extremePethSlotMeasuredPower})); short_msg => sprintf("Poe '%s' is '%s' W", $instance, $result2->{extremePethSlotMeasuredPower}));
} }
$self->{output}->perfdata_add(label => 'poe_power_' . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $result2->{extremePethSlotMeasuredPower}, label => 'poe_power', unit => 'W',
warning => $warn, nlabel => 'hardware.poe.power.watt',
critical => $crit, min => 0 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Power supply '%s' power is '%s' W", $instance, $power)); short_msg => sprintf("Power supply '%s' power is '%s' W", $instance, $power));
} }
$self->{output}->perfdata_add(label => 'psu_power_' . $instance, unit => 'W', $self->{output}->perfdata_add(
value => $power, label => 'psu_power', unit => 'W',
warning => $warn, nlabel => 'hardware.powersupply.power.watt',
critical => $crit, min => 0 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature is %s degree centigrade", $result->{extremeCurrentTemperature})); short_msg => sprintf("Temperature is %s degree centigrade", $result->{extremeCurrentTemperature}));
} }
$self->{output}->perfdata_add(label => "temp", unit => 'C', $self->{output}->perfdata_add(
value => $result->{extremeCurrentTemperature}, label => "temp", unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.celsius',
critical => $crit); value => $result->{extremeCurrentTemperature},
warning => $warn,
critical => $crit
);
} }
1; 1;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -75,11 +75,14 @@ sub check {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' is '%s' rpm", $instance, $result->{boxServicesFanSpeed})); short_msg => sprintf("Fan '%s' is '%s' rpm", $instance, $result->{boxServicesFanSpeed}));
} }
$self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm', $self->{output}->perfdata_add(
value => $result->{boxServicesFanSpeed}, label => 'fan', unit => 'rpm',
warning => $warn, nlabel => 'hardware.fan.speed.rpm',
critical => $crit, min => 0 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is '%s' rpm", $instance, $result->{boxServicesTempSensorTemperature})); short_msg => sprintf("Temperature '%s' is '%s' rpm", $instance, $result->{boxServicesTempSensorTemperature}));
} }
$self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C', $self->{output}->perfdata_add(
value => $result->{boxServicesTempSensorTemperature}, label => 'temp', unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.celsius',
critical => $crit, instances => $instance,
); value => $result->{boxServicesTempSensorTemperature},
warning => $warn,
critical => $crit,
);
} }
} }

View File

@ -67,12 +67,15 @@ sub check {
$self->{output}->output_add(severity => $exit2, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Fan temperature '%s' is %s degree centigrade", $instance, $result->{rcChasFanAmbientTemperature})); short_msg => sprintf("Fan temperature '%s' is %s degree centigrade", $instance, $result->{rcChasFanAmbientTemperature}));
} }
$self->{output}->perfdata_add(label => 'fan_temp_' . $instance, unit => 'C', $self->{output}->perfdata_add(
value => $result->{rcChasFanAmbientTemperature}, label => 'fan_temp', unit => 'C',
warning => $warn, nlabel => 'hardware.fan.temperature.celsius',
critical => $crit, 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s degree centigrade", $result->{slHdwTempSensorName}, $result->{s5ChasTmpSnrTmpValue})); short_msg => sprintf("Temperature '%s' is %s degree centigrade", $result->{slHdwTempSensorName}, $result->{s5ChasTmpSnrTmpValue}));
} }
$self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C', $self->{output}->perfdata_add(
value => $result->{s5ChasTmpSnrTmpValue}, label => 'temp', unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.celsius',
critical => $crit, 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})); short_msg => sprintf("Fan speed '%s' is %s rpm", $instance, $result->{raisecomFanSpeedValue}));
} }
$self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm', $self->{output}->perfdata_add(
value => $result->{raisecomFanSpeedValue}, label => 'fan', unit => 'rpm',
warning => $warn, nlabel => 'hardware.fan.speed.rpm',
critical => $crit, instances => $instance,
min => 0); value => $result->{raisecomFanSpeedValue},
warning => $warn,
critical => $crit,
min => 0
);
} }
} }

View File

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

View File

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

View File

@ -60,11 +60,15 @@ sub check {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %sC", $result->{rbnEntityTempDescr}, $result->{rbnEntityTempCurrent})); short_msg => sprintf("Temperature '%s' is %sC", $result->{rbnEntityTempDescr}, $result->{rbnEntityTempCurrent}));
} }
$self->{output}->perfdata_add(label => "temp_" . $instance, unit => 'C', $self->{output}->perfdata_add(
value => $result->{rbnEntityTempCurrent}, label => "temp", unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.celsius',
critical => $crit); 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Voltage '%s' is %s mV", $result->{rbnVoltageDescr}, $result->{rbnVoltageCurrent})); short_msg => sprintf("Voltage '%s' is %s mV", $result->{rbnVoltageDescr}, $result->{rbnVoltageCurrent}));
} }
$self->{output}->perfdata_add(label => "volt_" . $instance, unit => 'mV', $self->{output}->perfdata_add(
value => $result->{rbnVoltageCurrent}, label => "volt", unit => 'mV',
warning => $warn, nlabel => 'hardware.voltage.millivolt',
critical => $crit); 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, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Fan '%s' is %s rpm", $instance, $result->{speed})); short_msg => sprintf("Fan '%s' is %s rpm", $instance, $result->{speed}));
} }
$self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm', $self->{output}->perfdata_add(
value => $result->{speed}, label => 'fan_' . $instance, unit => 'rpm',
warning => $warn, nlabel => 'hardware.fan.controller.speed.rpm',
critical => $crit, instances => $instance,
min => 0 value => $result->{speed},
); warning => $warn,
critical => $crit,
min => 0
);
} }
} }
} }

View File

@ -122,11 +122,14 @@ sub psu_diskshelf {
$self->{output}->output_add(severity => $exit2, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Power supply '%s' is %s V", $instance, $voltage->{current})); short_msg => sprintf("Power supply '%s' is %s V", $instance, $voltage->{current}));
} }
$self->{output}->perfdata_add(label => 'voltage_' . $instance . '/' . $voltage->{type}, unit => 'V', $self->{output}->perfdata_add(
value => $voltage->{current}, label => 'voltage', unit => 'V',
warning => $warn, nlabel => 'hardware.powersupply.diskshelf.voltage.volt',
critical => $crit, 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, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %s C", $instance, $result->{tempc})); short_msg => sprintf("Temperature '%s' is %s C", $instance, $result->{tempc}));
} }
$self->{output}->perfdata_add(label => 'temperature_' . $instance, unit => 'C', $self->{output}->perfdata_add(
value => $result->{tempc}, label => 'temperature', unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.controller.celsius',
critical => $crit, instances => $instance,
); value => $result->{tempc},
warning => $warn,
critical => $crit,
);
} }
} }
} }
@ -118,11 +121,14 @@ sub temp_diskshelf {
$self->{output}->output_add(severity => $exit2, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Temperature '%s' is %s C", $instance, $result->{tempc})); short_msg => sprintf("Temperature '%s' is %s C", $instance, $result->{tempc}));
} }
$self->{output}->perfdata_add(label => 'temperature_' . $instance, unit => 'C', $self->{output}->perfdata_add(
value => $result->{tempc}, label => 'temperature', unit => 'C',
warning => $warn, nlabel => 'hardware.temperature.diskshelf.celsius',
critical => $crit, instances => $instance,
); value => $result->{tempc},
warning => $warn,
critical => $crit,
);
} }
} }
} }

View File

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