From 1c2f8aaee9319cb30a2faaad307cedbc027249fa Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 16 Apr 2019 17:34:34 +0200 Subject: [PATCH] add new metrics qnap hardware --- .../storage/qnap/snmp/mode/components/disk.pm | 11 +++++++---- .../storage/qnap/snmp/mode/components/fan.pm | 9 ++++++--- .../qnap/snmp/mode/components/temperature.pm | 18 ++++++++++++------ 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/centreon-plugins/storage/qnap/snmp/mode/components/disk.pm b/centreon-plugins/storage/qnap/snmp/mode/components/disk.pm index 4d2acb7cf..afe041ad3 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/components/disk.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/components/disk.pm @@ -89,11 +89,14 @@ sub check { $self->{output}->output_add(severity => $exit2, short_msg => sprintf("Disk '%s' temperature is %s degree centigrade", $result->{HdDescr}, $disk_temp)); } - $self->{output}->perfdata_add(label => 'temp_disk_' . $instance, unit => 'C', - value => $disk_temp - ); + $self->{output}->perfdata_add( + label => 'temp_disk', unit => 'C', + nlabel => 'hardware.disk.temperature.celsius', + instances => $instance, + value => $disk_temp + ); } } } -1; \ No newline at end of file +1; diff --git a/centreon-plugins/storage/qnap/snmp/mode/components/fan.pm b/centreon-plugins/storage/qnap/snmp/mode/components/fan.pm index 47abdf173..d0b1638d5 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/components/fan.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/components/fan.pm @@ -61,9 +61,12 @@ sub check { $self->{output}->output_add(severity => $exit, short_msg => sprintf("Fan '%s' speed is %s rpm", $fan_descr, $fan_speed_value)); } - $self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm', - value => $fan_speed_value, min => 0 - ); + $self->{output}->perfdata_add( + label => 'fan', unit => 'rpm', + nlabel => 'hardware.fan.speed.rpm', + instances => $instance, + value => $fan_speed_value, min => 0 + ); } } } diff --git a/centreon-plugins/storage/qnap/snmp/mode/components/temperature.pm b/centreon-plugins/storage/qnap/snmp/mode/components/temperature.pm index db97d3b97..a8fed6bc1 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/components/temperature.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/components/temperature.pm @@ -54,9 +54,12 @@ sub check { $self->{output}->output_add(severity => $exit, short_msg => sprintf("CPU Temperature is '%s' degree centigrade", $value)); } - $self->{output}->perfdata_add(label => 'temp_cpu', unit => 'C', - value => $value - ); + $self->{output}->perfdata_add( + label => 'temp', unit => 'C', + nlabel => 'hardware.temperature.celsius', + instances => 'cpu', + value => $value + ); } my $system_temp = defined($self->{results}->{$oid_SystemTemperature_entry}->{$oid_SystemTemperature}) ? @@ -71,9 +74,12 @@ sub check { $self->{output}->output_add(severity => $exit, short_msg => sprintf("System Temperature is '%s' degree centigrade", $value)); } - $self->{output}->perfdata_add(label => 'temp_system', unit => 'C', - value => $value - ); + $self->{output}->perfdata_add( + label => 'temp', unit => 'C', + nlabel => 'hardware.temperature.celsius', + instances => 'system', + value => $value + ); } }