add new metrics qnap hardware

This commit is contained in:
garnier-quentin 2019-04-16 17:34:34 +02:00
parent f73e5825b4
commit c5137e77e8
3 changed files with 25 additions and 13 deletions

View File

@ -89,7 +89,10 @@ sub check {
$self->{output}->output_add(severity => $exit2, $self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Disk '%s' temperature is %s degree centigrade", $result->{HdDescr}, $disk_temp)); short_msg => sprintf("Disk '%s' temperature is %s degree centigrade", $result->{HdDescr}, $disk_temp));
} }
$self->{output}->perfdata_add(label => 'temp_disk_' . $instance, unit => 'C', $self->{output}->perfdata_add(
label => 'temp_disk', unit => 'C',
nlabel => 'hardware.disk.temperature.celsius',
instances => $instance,
value => $disk_temp value => $disk_temp
); );
} }

View File

@ -61,7 +61,10 @@ sub check {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' speed is %s rpm", $fan_descr, $fan_speed_value)); short_msg => sprintf("Fan '%s' speed is %s rpm", $fan_descr, $fan_speed_value));
} }
$self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm', $self->{output}->perfdata_add(
label => 'fan', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => $instance,
value => $fan_speed_value, min => 0 value => $fan_speed_value, min => 0
); );
} }

View File

@ -54,7 +54,10 @@ sub check {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("CPU Temperature is '%s' degree centigrade", $value)); short_msg => sprintf("CPU Temperature is '%s' degree centigrade", $value));
} }
$self->{output}->perfdata_add(label => 'temp_cpu', unit => 'C', $self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => 'cpu',
value => $value value => $value
); );
} }
@ -71,7 +74,10 @@ sub check {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("System Temperature is '%s' degree centigrade", $value)); short_msg => sprintf("System Temperature is '%s' degree centigrade", $value));
} }
$self->{output}->perfdata_add(label => 'temp_system', unit => 'C', $self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => 'system',
value => $value value => $value
); );
} }