From c4003ae923f30fe248e9bb5d5fbc75621ba5a7f5 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 9 Oct 2015 15:31:52 +0200 Subject: [PATCH] + fix problem with predective failure --- .../snmp/mode/components/cachebattery.pm | 1 + .../openmanage/snmp/mode/components/connector.pm | 3 ++- .../dell/openmanage/snmp/mode/components/cpu.pm | 3 ++- .../snmp/mode/components/physicaldisk.pm | 15 +++++++++------ .../dell/openmanage/snmp/mode/components/psu.pm | 3 ++- .../network/f5/bigip/mode/virtualserverstatus.pm | 1 - 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cachebattery.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cachebattery.pm index 0b74c11ca..a453fda48 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cachebattery.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cachebattery.pm @@ -93,6 +93,7 @@ sub check { my $result3 = $self->{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{$mapping3->{batteryPredictedCapicity}->{oid}}, instance => $instance); my $result4 = $self->{snmp}->map_instance(mapping => $mapping4, results => $self->{results}->{$mapping4->{batteryLearnState}->{oid}}, instance => $instance); $result4->{batteryLearnState} = defined($result4->{batteryLearnState}) ? $result4->{batteryLearnState} : '-'; + $result3->{batteryPredictedCapicity} = defined($result3->{batteryPredictedCapicity}) ? $result3->{batteryPredictedCapicity} : '-'; next if ($self->check_exclude(section => 'cachebattery', instance => $instance)); diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/connector.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/connector.pm index 9a56d7d27..34eede51f 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/connector.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/connector.pm @@ -83,7 +83,8 @@ sub check { my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_channelEntry}, instance => $instance); my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{channelComponentStatus}->{oid}}, instance => $instance); my $result3 = $self->{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{$mapping3->{channelBusType}->{oid}}, instance => $instance); - + $result3->{channelBusType} = defined($result3->{channelBusType}) ? $result3->{channelBusType} : '-'; + next if ($self->check_exclude(section => 'connector', instance => $instance)); $self->{components}->{connector}->{total}++; diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cpu.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cpu.pm index 2a8bce470..28dc2eb23 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cpu.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cpu.pm @@ -85,7 +85,8 @@ sub check { $self->{output}->output_add(long_msg => sprintf("Cpu '%s' status is '%s' [instance: %s, manufacturer name: %s, brand name: %s, state: %s, speed: %s]", $instance, $result->{processorDeviceStatus}, $instance, - $result2->{processorDeviceManufacturerName}, $result4->{processorDeviceBrandName}, + $result2->{processorDeviceManufacturerName}, + defined($result4->{processorDeviceBrandName}) ? $result4->{processorDeviceBrandName} : '-', $result2->{processorDeviceStatusState}, $result3->{processorDeviceCurrentSpeed} )); my $exit = $self->get_severity(section => 'cpu', value => $result->{processorDeviceStatus}); diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/physicaldisk.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/physicaldisk.pm index b956ae89a..f5a812909 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/physicaldisk.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/physicaldisk.pm @@ -107,7 +107,8 @@ sub check { $self->{output}->output_add(long_msg => sprintf("Physical Disk '%s' status is '%s' [instance: %s, state: %s, spare state: %s, smart alert: %s]", $result->{arrayDiskName}, $result4->{arrayDiskComponentStatus}, $instance, - $result2->{arrayDiskState}, $result3->{arrayDiskSpareState}, $result5->{arrayDiskSmartAlertIndication} + $result2->{arrayDiskState}, $result3->{arrayDiskSpareState}, + defined($result5->{arrayDiskSmartAlertIndication}) ? $result5->{arrayDiskSmartAlertIndication} : '-' )); my $exit = $self->get_severity(section => 'physicaldisk', value => $result4->{arrayDiskComponentStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { @@ -116,11 +117,13 @@ sub check { $result->{arrayDiskName}, $result4->{arrayDiskComponentStatus})); } - $exit = $self->get_severity(section => 'physicaldisk_smartalert', value => $result5->{arrayDiskSmartAlertIndication}); - if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("physical disk '%s' has received a predictive failure alert", - $result->{arrayDiskName})); + if (defined($result5->{arrayDiskSmartAlertIndication})) { + $exit = $self->get_severity(section => 'physicaldisk_smartalert', value => $result5->{arrayDiskSmartAlertIndication}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("physical disk '%s' has received a predictive failure alert", + $result->{arrayDiskName})); + } } } } diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/psu.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/psu.pm index 276d22528..18aaf5856 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/psu.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/psu.pm @@ -100,7 +100,8 @@ sub check { $self->{output}->output_add(long_msg => sprintf("Power supply '%s' status is '%s' [instance: %s, location: %s, type: %s, output watts: %s, state: %s, configuration error: %s]", $instance, $result->{powerSupplyStatus}, $instance, - $result->{powerSupplyLocationName}, $result->{powerSupplyType}, $result->{powerSupplyOutputWatts}, + $result->{powerSupplyLocationName}, $result->{powerSupplyType}, + defined($result->{powerSupplyOutputWatts}) ? $result->{powerSupplyOutputWatts} : '-', $result2->{powerSupplySensorState}, $result2->{powerSupplyConfigurationErrorType} )); my $exit = $self->get_severity(section => 'psu', value => $result->{powerSupplyStatus}); diff --git a/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm b/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm index 86c5116fd..390af87c1 100644 --- a/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm +++ b/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm @@ -52,7 +52,6 @@ my $maps_counters = { }, }; - sub custom_threshold_output { my ($self, %options) = @_;