diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm index 05e693042..5f8213ade 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm @@ -59,7 +59,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_amperageProbeTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'amperage', instance => $instance)); + next if ($self->check_filter(section => 'amperage', instance => $instance, name => $result->{amperageProbeLocationName})); $self->{components}->{amperage}->{total}++; my ($divisor, $unit) = (1000, 'A'); @@ -99,7 +99,12 @@ sub check { next if ($result->{amperageProbeType} =~ /amperageProbeTypeIsDiscrete/); if (defined($result->{amperageProbeReading}) && $result->{amperageProbeReading} =~ /[0-9]/) { - my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'amperage', instance => $instance, value => $result->{amperageProbeReading}); + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric( + section => 'amperage', + instance => $instance, + name => $result->{amperageProbeLocationName}, + value => $result->{amperageProbeReading} + ); if ($checked == 0) { $result->{amperageProbeLowerNonCriticalThreshold} = (defined($result->{amperageProbeLowerNonCriticalThreshold}) && $result->{amperageProbeLowerNonCriticalThreshold} =~ /[0-9]/) ? $result->{amperageProbeLowerNonCriticalThreshold} / $divisor : ''; diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm index b946a3ae3..eccc9e89f 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm @@ -58,7 +58,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_coolingDeviceTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'coolingdevice', instance => $instance)); + next if ($self->check_filter(section => 'coolingdevice', instance => $instance, name => $result->{coolingDeviceLocationName})); $self->{components}->{coolingdevice}->{total}++; $result->{coolingDeviceReading} = (defined($result->{coolingDeviceReading})) ? $result->{coolingDeviceReading} : 'unknown'; @@ -72,8 +72,10 @@ sub check { my $exit = $self->get_severity(label => 'default.state', section => 'coolingdevice.state', value => $result->{coolingDeviceStateSettings}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Cooling device '%s' state is '%s'", $result->{coolingDeviceLocationName}, $result->{coolingDeviceStateSettings})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Cooling device '%s' state is '%s'", $result->{coolingDeviceLocationName}, $result->{coolingDeviceStateSettings}) + ); next; } @@ -86,7 +88,12 @@ sub check { } if (defined($result->{coolingDeviceReading}) && $result->{coolingDeviceReading} =~ /[0-9]/) { - my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'coolingdevice', instance => $instance, value => $result->{coolingDeviceReading}); + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric( + section => 'coolingdevice', + instance => $instance, + name => $result->{coolingDeviceLocationName}, + value => $result->{coolingDeviceReading} + ); if ($checked == 0) { $result->{coolingDeviceLowerNonCriticalThreshold} = (defined($result->{coolingDeviceLowerNonCriticalThreshold}) && $result->{coolingDeviceLowerNonCriticalThreshold} =~ /[0-9]/) ? $result->{coolingDeviceLowerNonCriticalThreshold} / 10 : ''; diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingunit.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingunit.pm index b52508b77..b8983a76e 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingunit.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingunit.pm @@ -53,7 +53,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_coolingUnitTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'coolingunit', instance => $instance)); + next if ($self->check_filter(section => 'coolingunit', instance => $instance, name => $result->{coolingUnitName})); $self->{components}->{coolingunit}->{total}++; $self->{output}->output_add( diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/enclosure.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/enclosure.pm index 705b80815..7aeecf502 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/enclosure.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/enclosure.pm @@ -53,7 +53,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_enclosureTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'enclosure', instance => $instance)); + next if ($self->check_filter(section => 'enclosure', instance => $instance, name => $result->{enclosureName})); $self->{components}->{enclosure}->{total}++; $self->{output}->output_add( diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/fru.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/fru.pm index 24e0a10f3..5bc4cc780 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/fru.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/fru.pm @@ -52,7 +52,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_fruTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'fru', instance => $instance)); + next if ($self->check_filter(section => 'fru', instance => $instance, name => $result->{fruSerialNumberName})); $self->{components}->{fru}->{total}++; $self->{output}->output_add( diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/memory.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/memory.pm index ac1b7cd26..2a292eec2 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/memory.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/memory.pm @@ -53,7 +53,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_memoryDeviceTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'memory', instance => $instance)); + next if ($self->check_filter(section => 'memory', instance => $instance, name => $result->{memoryDeviceLocationName})); $self->{components}->{memory}->{total}++; $self->{output}->output_add( diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/network.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/network.pm index 57f4824b0..8c17cfdd6 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/network.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/network.pm @@ -52,7 +52,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_networkDeviceTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'network', instance => $instance)); + next if ($self->check_filter(section => 'network', instance => $instance, name => $result->{networkDeviceProductName})); $self->{components}->{network}->{total}++; $self->{output}->output_add( diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pci.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pci.pm index e89e466ba..cc01d2299 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pci.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pci.pm @@ -53,7 +53,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_pCIDeviceTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'pci', instance => $instance)); + next if ($self->check_filter(section => 'pci', instance => $instance, name => $result->{pCIDeviceDescriptionName})); $self->{components}->{pci}->{total}++; $self->{output}->output_add( diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pdisk.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pdisk.pm index 9cf8b4f0c..7a9773109 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pdisk.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pdisk.pm @@ -64,7 +64,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $results, instance => $instance); - next if ($self->check_filter(section => 'pdisk', instance => $instance)); + next if ($self->check_filter(section => 'pdisk', instance => $instance, name => $result->{physicalDiskFQDD})); $self->{components}->{pdisk}->{total}++; if ($result->{physicalDiskState} eq 'ready') { diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/processor.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/processor.pm index ec13a33c1..bbbde338a 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/processor.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/processor.pm @@ -53,7 +53,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); - next if ($self->check_filter(section => 'processor', instance => $instance)); + next if ($self->check_filter(section => 'processor', instance => $instance, name => $result->{processorDeviceFQDD})); $self->{components}->{processor}->{total}++; $self->{output}->output_add( diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/psu.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/psu.pm index 82217553e..784d6acba 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/psu.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/psu.pm @@ -52,13 +52,13 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_powerSupplyTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'psu', instance => $instance)); + next if ($self->check_filter(section => 'psu', instance => $instance, name => $result->{powerSupplyLocationName})); $self->{components}->{psu}->{total}++; $self->{output}->output_add( long_msg => sprintf( "power supply '%s' status is '%s' [instance = %s]", - $result->{powerSupplyLocationName}, $result->{powerSupplyStatus}, $instance, + $result->{powerSupplyLocationName}, $result->{powerSupplyStatus}, $instance ) ); diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/punit.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/punit.pm index 40c5987fd..2bdfb173b 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/punit.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/punit.pm @@ -53,7 +53,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_powerUnitTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'punit', instance => $instance)); + next if ($self->check_filter(section => 'punit', instance => $instance, name => $result->{powerUnitName})); $self->{components}->{punit}->{total}++; $self->{output}->output_add( diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/slot.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/slot.pm index b3e0a4c54..e7f7be701 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/slot.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/slot.pm @@ -52,13 +52,13 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_systemSlotTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'slot', instance => $instance)); + next if ($self->check_filter(section => 'slot', instance => $instance, name => $result->{systemSlotSlotExternalSlotName})); $self->{components}->{slot}->{total}++; $self->{output}->output_add( long_msg => sprintf( "slot '%s' status is '%s' [instance = %s]", - $result->{systemSlotSlotExternalSlotName}, $result->{systemSlotStatus}, $instance, + $result->{systemSlotSlotExternalSlotName}, $result->{systemSlotStatus}, $instance ) ); diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagebattery.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagebattery.pm index 38752aa8c..094cadc87 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagebattery.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagebattery.pm @@ -48,13 +48,13 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); - next if ($self->check_filter(section => 'storagebattery', instance => $instance)); + next if ($self->check_filter(section => 'storagebattery', instance => $instance, name => $result->{batteryFQDD})); $self->{components}->{storagebattery}->{total}++; $self->{output}->output_add( long_msg => sprintf( "storage battery '%s' status is '%s' [instance = %s]", - $result->{batteryFQDD}, $result->{batteryComponentStatus}, $instance, + $result->{batteryFQDD}, $result->{batteryComponentStatus}, $instance ) ); diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagectrl.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagectrl.pm index 469b3d278..b0eabdeb1 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagectrl.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagectrl.pm @@ -48,13 +48,13 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); - next if ($self->check_filter(section => 'storagectrl', instance => $instance)); + next if ($self->check_filter(section => 'storagectrl', instance => $instance, name => $result->{controllerFQDD})); $self->{components}->{storagectrl}->{total}++; $self->{output}->output_add( long_msg => sprintf( "storage controller '%s' status is '%s' [instance = %s]", - $result->{controllerFQDD}, $result->{controllerComponentStatus}, $instance, + $result->{controllerFQDD}, $result->{controllerComponentStatus}, $instance ) ); diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/systembattery.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/systembattery.pm index 7da627303..d9f8ea004 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/systembattery.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/systembattery.pm @@ -53,7 +53,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_systemBatteryTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'systembattery', instance => $instance)); + next if ($self->check_filter(section => 'systembattery', instance => $instance, name => $result->{systemBatteryLocationName})); $self->{components}->{systembattery}->{total}++; $self->{output}->output_add( diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm index 424a85de6..8ee832f21 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm @@ -66,7 +66,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_temperatureProbeTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'temperature', instance => $instance)); + next if ($self->check_filter(section => 'temperature', instance => $instance, name => $result->{temperatureProbeLocationName})); $self->{components}->{temperature}->{total}++; $result->{temperatureProbeReading} = (defined($result->{temperatureProbeReading})) ? $result->{temperatureProbeReading} / 10 : 'unknown'; @@ -98,9 +98,14 @@ sub check { ) ); } - + if (defined($result->{temperatureProbeReading}) && $result->{temperatureProbeReading} =~ /[0-9]/) { - my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{temperatureProbeReading}); + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric( + section => 'temperature', + instance => $instance, + name => $result->{temperatureProbeLocationName}, + value => $result->{temperatureProbeReading} + ); if ($checked == 0) { $result->{temperatureProbeLowerNonCriticalThreshold} = (defined($result->{temperatureProbeLowerNonCriticalThreshold}) && $result->{temperatureProbeLowerNonCriticalThreshold} =~ /[0-9]/) ? $result->{temperatureProbeLowerNonCriticalThreshold} / 10 : ''; diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/vdisk.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/vdisk.pm index 7bcd926be..480d98b5a 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/vdisk.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/vdisk.pm @@ -48,13 +48,13 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); - next if ($self->check_filter(section => 'vdisk', instance => $instance)); + next if ($self->check_filter(section => 'vdisk', instance => $instance, name => $result->{virtualDiskFQDD})); $self->{components}->{vdisk}->{total}++; $self->{output}->output_add( long_msg => sprintf( "virtual disk '%s' state is '%s' [instance = %s]", - $result->{virtualDiskFQDD}, $result->{virtualDiskState}, $instance, + $result->{virtualDiskFQDD}, $result->{virtualDiskState}, $instance ) ); diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm index b8345721a..2e468835f 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm @@ -58,7 +58,7 @@ sub check { my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_voltageProbeTableEntry}, instance => $instance); - next if ($self->check_filter(section => 'voltage', instance => $instance)); + next if ($self->check_filter(section => 'voltage', instance => $instance, name => $result->{voltageProbeLocationName})); $self->{components}->{voltage}->{total}++; $result->{voltageProbeReading} = (defined($result->{voltageProbeReading})) ? $result->{voltageProbeReading} / 1000 : 'unknown'; @@ -92,7 +92,12 @@ sub check { } if (defined($result->{voltageProbeReading}) && $result->{voltageProbeReading} =~ /[0-9]/) { - my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'voltage', instance => $instance, value => $result->{voltageProbeReading}); + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric( + section => 'voltage', + instance => $instance, + name => $result->{voltageProbeLocationName}, + value => $result->{voltageProbeReading} + ); if ($checked == 0) { $result->{voltageProbeLowerNonCriticalThreshold} = (defined($result->{voltageProbeLowerNonCriticalThreshold}) && $result->{voltageProbeLowerNonCriticalThreshold} =~ /[0-9]/) ? $result->{voltageProbeLowerNonCriticalThreshold} / 1000 : ''; diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm index 800756e19..4cad7232b 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm @@ -141,6 +141,10 @@ Can be: 'amperage', 'coolingdevice', 'coolingunit', 'enclosure', Exclude some parts (comma seperated list) (Example: --filter=temperature --filter=psu) Can also exclude specific instance: --filter=temperature,1.1 +=item B<--add-name-instance> + +Add literal description for instance value (used in filter and threshold options). + =item B<--no-component> Return an error if no compenents are checked.