From 590388ad263836dc345b7a4237cba8948d685123 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 15 Apr 2019 16:19:24 +0200 Subject: [PATCH] change perfdata hardware ibmc huawei --- centreon/plugins/templates/hardware.pm | 11 +++++++---- .../huawei/ibmc/snmp/mode/components/fan.pm | 17 ++++++++++------- .../ibmc/snmp/mode/components/harddisk.pm | 17 ++++++++++------- .../ibmc/snmp/mode/components/temperature.pm | 15 +++++++++------ 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/centreon/plugins/templates/hardware.pm b/centreon/plugins/templates/hardware.pm index b5341683a..16f6689ba 100644 --- a/centreon/plugins/templates/hardware.pm +++ b/centreon/plugins/templates/hardware.pm @@ -291,10 +291,13 @@ sub display { $self->{components}->{$comp}->{total}, $comp)); } - $self->{output}->perfdata_add(label => 'count_' . $comp, - value => $self->{components}->{$comp}->{total}, - warning => $warn, - critical => $crit); + $self->{output}->perfdata_add( + label => 'count_' . $comp, + nlabel => 'hardware.' . $comp . '.count', + value => $self->{components}->{$comp}->{total}, + warning => $warn, + critical => $crit + ); push @{$exits}, $exit; } diff --git a/hardware/server/huawei/ibmc/snmp/mode/components/fan.pm b/hardware/server/huawei/ibmc/snmp/mode/components/fan.pm index a352a164b..3f021b43a 100644 --- a/hardware/server/huawei/ibmc/snmp/mode/components/fan.pm +++ b/hardware/server/huawei/ibmc/snmp/mode/components/fan.pm @@ -77,12 +77,15 @@ sub check { } my $perf_label = $result->{fanDevicename}; $perf_label =~ s/ /_/g; - $self->{output}->perfdata_add(label => 'speed_' . $perf_label, unit => 'rpm', - value => $result->{fanSpeed}, - warning => $warn, - critical => $crit, - min => 0 - ); + $self->{output}->perfdata_add( + label => 'speed', unit => 'rpm', + nlabel => 'hardware.fan.speed.rpm', + instances => $perf_label, + value => $result->{fanSpeed}, + warning => $warn, + critical => $crit, + min => 0 + ); } $self->{output}->output_add(long_msg => sprintf("Fan '%s' status is '%s' [instance = %s]", @@ -97,4 +100,4 @@ sub check { } } -1; \ No newline at end of file +1; diff --git a/hardware/server/huawei/ibmc/snmp/mode/components/harddisk.pm b/hardware/server/huawei/ibmc/snmp/mode/components/harddisk.pm index fd43983d6..7f51c4389 100644 --- a/hardware/server/huawei/ibmc/snmp/mode/components/harddisk.pm +++ b/hardware/server/huawei/ibmc/snmp/mode/components/harddisk.pm @@ -77,12 +77,15 @@ sub check { } my $perf_label = $result->{hardDiskDevicename}; $perf_label =~ s/ /_/g; - $self->{output}->perfdata_add(label => 'temperature_' . $perf_label, unit => 'C', - value => $result->{hardDiskTemperature}, - warning => $warn, - critical => $crit, - min => 0 - ); + $self->{output}->perfdata_add( + label => 'temperature', unit => 'C', + nlabel => 'hardware.harddisk.temperature.celsius', + instances => $perf_label, + value => $result->{hardDiskTemperature}, + warning => $warn, + critical => $crit, + min => 0 + ); } $self->{output}->output_add(long_msg => sprintf("Hard disk '%s' status is '%s' [instance = %s]", @@ -97,4 +100,4 @@ sub check { } } -1; \ No newline at end of file +1; diff --git a/hardware/server/huawei/ibmc/snmp/mode/components/temperature.pm b/hardware/server/huawei/ibmc/snmp/mode/components/temperature.pm index 4dc9e5a7f..3a3ac26b0 100644 --- a/hardware/server/huawei/ibmc/snmp/mode/components/temperature.pm +++ b/hardware/server/huawei/ibmc/snmp/mode/components/temperature.pm @@ -60,12 +60,15 @@ sub check { short_msg => sprintf("Temperature of '%s' is '%s' celsius degrees", $result->{temperatureObject}, $result->{temperatureReading} / 10)); } - $self->{output}->perfdata_add(label => 'temperature_' . $result->{temperatureObject}, unit => 'C', - value => $result->{temperatureReading} / 10, - warning => $warn, - critical => $crit - ); + $self->{output}->perfdata_add( + label => 'temperature', unit => 'C', + nlabel => 'hardware.temperature.celsius', + instances => $result->{temperatureObject}, + value => $result->{temperatureReading} / 10, + warning => $warn, + critical => $crit + ); } } -1; \ No newline at end of file +1;