From f369f6c36267947c7b64724be698270154de2f3f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 10 Feb 2016 10:58:48 +0100 Subject: [PATCH] + Fix #245 --- centreon/common/cisco/standard/snmp/mode/components/fan.pm | 2 +- .../common/cisco/standard/snmp/mode/components/module.pm | 3 ++- .../common/cisco/standard/snmp/mode/components/physical.pm | 3 ++- centreon/common/cisco/standard/snmp/mode/components/psu.pm | 2 +- .../common/cisco/standard/snmp/mode/components/sensor.pm | 6 +++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/centreon/common/cisco/standard/snmp/mode/components/fan.pm b/centreon/common/cisco/standard/snmp/mode/components/fan.pm index d34d81215..a869a541b 100644 --- a/centreon/common/cisco/standard/snmp/mode/components/fan.pm +++ b/centreon/common/cisco/standard/snmp/mode/components/fan.pm @@ -103,7 +103,7 @@ sub check_fan_entity { my $exit = $self->get_severity(section => 'fan', value => $result->{cefcFanTrayOperStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Fan '%s' status is %s.", $fan_descr, $result->{cefcFanTrayOperStatus})); + short_msg => sprintf("Fan '%s/%s' status is %s", $fan_descr, $instance, $result->{cefcFanTrayOperStatus})); } } } diff --git a/centreon/common/cisco/standard/snmp/mode/components/module.pm b/centreon/common/cisco/standard/snmp/mode/components/module.pm index ba77b43c2..36987ed71 100644 --- a/centreon/common/cisco/standard/snmp/mode/components/module.pm +++ b/centreon/common/cisco/standard/snmp/mode/components/module.pm @@ -87,7 +87,8 @@ sub check { my $exit = $self->get_severity(section => 'module', value => $result->{cefcModuleOperStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Module '%s' status is %s", $module_descr, $result->{cefcModuleOperStatus})); + short_msg => sprintf("Module '%s/%s' status is %s", $module_descr, + $instance, $result->{cefcModuleOperStatus})); } } } diff --git a/centreon/common/cisco/standard/snmp/mode/components/physical.pm b/centreon/common/cisco/standard/snmp/mode/components/physical.pm index 605779c82..debfd9d0f 100644 --- a/centreon/common/cisco/standard/snmp/mode/components/physical.pm +++ b/centreon/common/cisco/standard/snmp/mode/components/physical.pm @@ -69,7 +69,8 @@ sub check { my $exit = $self->get_severity(section => 'physical', value => $result->{cefcPhysicalStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Physical '%s' status is %s", $physical_descr, $result->{cefcPhysicalStatus})); + short_msg => sprintf("Physical '%s/%s' status is %s", $physical_descr, + $instance, $result->{cefcPhysicalStatus})); } } } diff --git a/centreon/common/cisco/standard/snmp/mode/components/psu.pm b/centreon/common/cisco/standard/snmp/mode/components/psu.pm index 9903a4a54..f92712a58 100644 --- a/centreon/common/cisco/standard/snmp/mode/components/psu.pm +++ b/centreon/common/cisco/standard/snmp/mode/components/psu.pm @@ -119,7 +119,7 @@ sub check_psu_entity { my $exit = $self->get_severity(section => 'psu', value => $result->{cefcFRUPowerOperStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Power supply '%s' status is %s.", $psu_descr, $result->{cefcFRUPowerOperStatus})); + short_msg => sprintf("Power supply '%s/%s' status is %s", $psu_descr, $instance, $result->{cefcFRUPowerOperStatus})); } } } diff --git a/centreon/common/cisco/standard/snmp/mode/components/sensor.pm b/centreon/common/cisco/standard/snmp/mode/components/sensor.pm index 4aa241d87..8b0c93814 100644 --- a/centreon/common/cisco/standard/snmp/mode/components/sensor.pm +++ b/centreon/common/cisco/standard/snmp/mode/components/sensor.pm @@ -202,8 +202,8 @@ sub check { my $exit = $self->get_severity(section => $result->{entSensorType}, label => 'sensor', value => $result->{entSensorStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Sensor '%s' status is '%s'", - $sensor_descr, $result->{entSensorStatus})); + short_msg => sprintf("Sensor '%s/%s' status is '%s'", + $sensor_descr, $instance, $result->{entSensorStatus})); } next if (!defined($result->{entSensorValue}) || $result->{entSensorValue} !~ /[0-9]/); @@ -222,7 +222,7 @@ sub check { } if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit2, - short_msg => sprintf("Sensor '%s' is %s %s", $sensor_descr, $result->{entSensorValue}, $perfdata_unit{$result->{entSensorType}})); + short_msg => sprintf("Sensor '%s/%s' is %s %s", $sensor_descr, $instance, $result->{entSensorValue}, $perfdata_unit{$result->{entSensorType}})); } $self->{output}->perfdata_add(label => $component . '_' . $sensor_descr, unit => $perfdata_unit{$result->{entSensorType}}, value => $result->{entSensorValue},