+ Fix Dell Openmanage snmp plugin
This commit is contained in:
parent
e8978d68d5
commit
5b24d119d3
|
@ -49,7 +49,7 @@ my $oid_batteryTableEntry = '.1.3.6.1.4.1.674.10892.1.600.50.1';
|
|||
sub load {
|
||||
my (%options) = @_;
|
||||
|
||||
push @{$options{request}}, { oid => $oid_batteryTableEntry, start => $mapping->{globalSystemStatus}->{oid} };
|
||||
push @{$options{request}}, { oid => $oid_batteryTableEntry, start => $mapping->{batteryStatus}->{oid}, end => $mapping->{batteryLocationName}->{oid} };
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
|
|
@ -92,7 +92,8 @@ sub check {
|
|||
my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{batteryComponentStatus}->{oid}}, instance => $instance);
|
||||
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} : '-';
|
||||
|
||||
next if ($self->check_exclude(section => 'cachebattery', instance => $instance));
|
||||
|
||||
$self->{components}->{cachebattery}->{total}++;
|
||||
|
|
|
@ -60,12 +60,12 @@ my $mapping2 = {
|
|||
my $mapping3 = {
|
||||
channelBusType => { oid => '.1.3.6.1.4.1.674.10893.1.20.130.2.1.11', map => \%map_busType },
|
||||
};
|
||||
my $oid_batteryEntry = '.1.3.6.1.4.1.674.10893.1.20.130.15.1';
|
||||
my $oid_channelEntry = '.1.3.6.1.4.1.674.10893.1.20.130.2.1';
|
||||
|
||||
sub load {
|
||||
my (%options) = @_;
|
||||
|
||||
push @{$options{request}}, { oid => $oid_batteryEntry, start => $mapping->{channelName}->{oid}, end => $mapping->{channelState}->{oid} },
|
||||
push @{$options{request}}, { oid => $oid_channelEntry, start => $mapping->{channelName}->{oid}, end => $mapping->{channelState}->{oid} },
|
||||
{ oid => $mapping2->{channelComponentStatus}->{oid} },
|
||||
{ oid => $mapping3->{channelBusType}->{oid} } ;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ sub check {
|
|||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$mapping2->{channelComponentStatus}->{oid}}})) {
|
||||
next if ($oid !~ /^$mapping2->{channelComponentStatus}->{oid}\.(.*)$/);
|
||||
my $instance = $1;
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_batteryEntry}, instance => $instance);
|
||||
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);
|
||||
|
||||
|
|
|
@ -44,21 +44,13 @@ my $mapping = {
|
|||
my $mapping2 = {
|
||||
coolingDeviceLocationName => { oid => '.1.3.6.1.4.1.674.10892.1.700.12.1.8' },
|
||||
};
|
||||
my $mapping3 = {
|
||||
coolingDeviceUpperCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.1.700.12.1.10' },
|
||||
coolingDeviceUpperNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.1.700.12.1.11' },
|
||||
coolingDeviceLowerNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.1.700.12.1.12' },
|
||||
coolingDeviceLowerCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.1.700.12.1.13' },
|
||||
};
|
||||
my $oid_coolingDeviceTable = '.1.3.6.1.4.1.674.10892.1.700.12';
|
||||
my $oid_coolingDeviceTableEntry = '.1.3.6.1.4.1.674.10892.1.700.12.1';
|
||||
|
||||
sub load {
|
||||
my (%options) = @_;
|
||||
|
||||
push @{$options{request}}, { oid => $oid_coolingDeviceTableEntry, start => $mapping->{coolingDeviceStatus}->{oid}, end => $mapping->{coolingDeviceReading}->{oid} },
|
||||
{ oid => $mapping2->{coolingDeviceLocationName}->{oid} },
|
||||
{ oid => $oid_coolingDeviceTable, start => $mapping3->{coolingDeviceUpperCriticalThreshold}->{oid}, end => $mapping3->{coolingDeviceLowerCriticalThreshold}->{oid} };
|
||||
{ oid => $mapping2->{coolingDeviceLocationName}->{oid} };
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -73,7 +65,6 @@ sub check {
|
|||
my $instance = $1;
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_coolingDeviceTableEntry}, instance => $instance);
|
||||
my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{coolingDeviceLocationName}->{oid}}, instance => $instance);
|
||||
my $result3 = $self->{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{$oid_coolingDeviceTable}, instance => $instance);
|
||||
|
||||
next if ($self->check_exclude(section => 'fan', instance => $instance));
|
||||
|
||||
|
@ -92,17 +83,6 @@ sub check {
|
|||
|
||||
if (defined($result->{coolingDeviceReading}) && $result->{coolingDeviceReading} =~ /[0-9]/) {
|
||||
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{coolingDeviceReading});
|
||||
if ($checked == 0) {
|
||||
my $warn_th = $result->{coolingDeviceLowerNonCriticalThreshold} . ':' . $result->{coolingDeviceUpperNonCriticalThreshold};
|
||||
my $crit_th = $result->{coolingDeviceLowerCriticalThreshold} . ':' . $result->{coolingDeviceUpperCriticalThreshold};
|
||||
$self->{perfdata}->threshold_validate(label => 'warning-fan-instance-' . $instance, value => $warn_th);
|
||||
$self->{perfdata}->threshold_validate(label => 'critical-fan-instance-' . $instance, value => $crit_th);
|
||||
|
||||
$exit = $self->{perfdata}->threshold_check(value => $result->{coolingDeviceReading}, threshold => [ { label => 'critical-fan-instance-' . $instance, exit_litteral => 'critical' },
|
||||
{ label => 'warning-fan-instance-' . $instance, exit_litteral => 'warning' } ]);
|
||||
$warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-fan-instance-' . $instance);
|
||||
$crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-fan-instance-' . $instance);
|
||||
}
|
||||
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
|
|
|
@ -99,7 +99,7 @@ sub check {
|
|||
my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{arrayDiskState}->{oid}}, instance => $instance);
|
||||
my $result3 = $self->{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{$mapping3->{arrayDiskSpareState}->{oid}}, instance => $instance);
|
||||
my $result4 = $self->{snmp}->map_instance(mapping => $mapping4, results => $self->{results}->{$mapping4->{arrayDiskComponentStatus}->{oid}}, instance => $instance);
|
||||
my $result5 = $self->{snmp}->map_instance(mapping => $mapping4, results => $self->{results}->{$mapping5->{arrayDiskSmartAlertIndication}->{oid}}, instance => $instance);
|
||||
my $result5 = $self->{snmp}->map_instance(mapping => $mapping5, results => $self->{results}->{$mapping5->{arrayDiskSmartAlertIndication}->{oid}}, instance => $instance);
|
||||
|
||||
next if ($self->check_exclude(section => 'physicaldisk', instance => $instance));
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ sub load {
|
|||
my (%options) = @_;
|
||||
|
||||
push @{$options{request}}, { oid => $oid_powerSupplyTable, start => $mapping->{powerSupplyStatus}->{oid}, end => $mapping->{powerSupplyLocationName}->{oid} },
|
||||
{ oid => $oid_powerSupplyTableEntry, start => $mapping->{powerSupplySensorState}->{oid}, end => $mapping->{powerSupplyConfigurationErrorType}->{oid} };
|
||||
{ oid => $oid_powerSupplyTableEntry, start => $mapping2->{powerSupplySensorState}->{oid}, end => $mapping2->{powerSupplyConfigurationErrorType}->{oid} };
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -92,7 +92,8 @@ sub check {
|
|||
my $instance = $1;
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_powerSupplyTable}, instance => $instance);
|
||||
my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_powerSupplyTableEntry}, instance => $instance);
|
||||
|
||||
$result2->{powerSupplyConfigurationErrorType} = defined($result2->{powerSupplyConfigurationErrorType}) ? $result2->{powerSupplyConfigurationErrorType} : '-';
|
||||
|
||||
next if ($self->check_exclude(section => 'psu', instance => $instance));
|
||||
|
||||
$self->{components}->{psu}->{total}++;
|
||||
|
@ -110,7 +111,7 @@ sub check {
|
|||
}
|
||||
|
||||
if (defined($result->{powerSupplyOutputWatts}) && $result->{powerSupplyOutputWatts} =~ /[0-9]/) {
|
||||
$result->{powerSupplyOutputWatts} *= 10;
|
||||
$result->{powerSupplyOutputWatts} /= 10;
|
||||
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'psu.power', instance => $instance, value => $result->{powerSupplyOutputWatts});
|
||||
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
|
|
|
@ -49,20 +49,12 @@ my $mapping = {
|
|||
temperatureProbeType => { oid => '.1.3.6.1.4.1.674.10892.1.700.20.1.7', map => \%map_type },
|
||||
temperatureProbeLocationName => { oid => '.1.3.6.1.4.1.674.10892.1.700.20.1.8' },
|
||||
};
|
||||
my $mapping2 = {
|
||||
temperatureProbeUpperCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.1.700.20.1.10' },
|
||||
temperatureProbeUpperNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.1.700.20.1.11' },
|
||||
temperatureProbeLowerNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.1.700.20.1.12' },
|
||||
temperatureProbeLowerCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.1.700.20.1.13' },
|
||||
};
|
||||
my $oid_temperatureProbeTable = '.1.3.6.1.4.1.674.10892.1.700.20';
|
||||
my $oid_temperatureProbeTableEntry = '.1.3.6.1.4.1.674.10892.1.700.20.1';
|
||||
|
||||
sub load {
|
||||
my (%options) = @_;
|
||||
|
||||
push @{$options{request}}, { oid => $oid_temperatureProbeTable, start => $mapping->{temperatureProbeStatus}->{oid}, end => $mapping->{temperatureProbeLocationName}->{oid} },
|
||||
{ oid => $oid_temperatureProbeTableEntry, start => $mapping2->{temperatureProbeUpperCriticalThreshold}->{oid}, end => $mapping2->{temperatureProbeLowerCriticalThreshold}->{oid} };
|
||||
push @{$options{request}}, { oid => $oid_temperatureProbeTable, start => $mapping->{temperatureProbeStatus}->{oid}, end => $mapping->{temperatureProbeLocationName}->{oid} };
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -76,7 +68,6 @@ sub check {
|
|||
next if ($oid !~ /^$mapping->{temperatureProbeStatus}->{oid}\.(.*)$/);
|
||||
my $instance = $1;
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_temperatureProbeTable}, instance => $instance);
|
||||
my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_temperatureProbeTableEntry}, instance => $instance);
|
||||
|
||||
next if ($self->check_exclude(section => 'temperature', instance => $instance));
|
||||
|
||||
|
@ -94,19 +85,8 @@ sub check {
|
|||
}
|
||||
|
||||
if (defined($result->{temperatureProbeReading}) && $result->{temperatureProbeReading} =~ /[0-9]/) {
|
||||
$result->{temperatureProbeReading} *= 10;
|
||||
$result->{temperatureProbeReading} /= 10;
|
||||
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{temperatureProbeReading});
|
||||
if ($checked == 0) {
|
||||
my $warn_th = $result->{temperatureProbeLowerNonCriticalThreshold} . ':' . $result->{temperatureProbeUpperNonCriticalThreshold};
|
||||
my $crit_th = $result->{temperatureProbeLowerCriticalThreshold} . ':' . $result->{temperatureProbeUpperCriticalThreshold};
|
||||
$self->{perfdata}->threshold_validate(label => 'warning-temperature-instance-' . $instance, value => $warn_th);
|
||||
$self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $instance, value => $crit_th);
|
||||
|
||||
$exit = $self->{perfdata}->threshold_check(value => $result->{temperatureProbeReading}, threshold => [ { label => 'critical-temperature-instance-' . $instance, exit_litteral => 'critical' },
|
||||
{ label => 'warning-temperature-instance-' . $instance, exit_litteral => 'warning' } ]);
|
||||
$warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-temperature-instance-' . $instance);
|
||||
$crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $instance);
|
||||
}
|
||||
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
|
|
|
@ -128,7 +128,7 @@ my $thresholds = {
|
|||
['nonRecoverable', 'CRITICAL'],
|
||||
],
|
||||
physicaldisk_smartalert => [
|
||||
['yes', 'CRITICAL'],
|
||||
['yes', 'WARNING'],
|
||||
['no', 'OK'],
|
||||
],
|
||||
psu => [
|
||||
|
@ -169,7 +169,6 @@ sub new {
|
|||
"critical:s@" => { name => 'critical' },
|
||||
});
|
||||
|
||||
$self->{product_name} = undef;
|
||||
$self->{components} = {};
|
||||
return $self;
|
||||
}
|
||||
|
@ -257,7 +256,7 @@ sub run {
|
|||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_chassisModelName}})) {
|
||||
my $name = defined($self->{results}->{$oid_chassisModelName}->{$oid}) ?
|
||||
centreon::plugins::misc::trim($self->{results}->{$oid_chassisModelName}->{$oid}) : 'unknown';
|
||||
$self->{output}->output_add(long_msg => sprintf("Product Name: %s", $self->{product_name}));
|
||||
$self->{output}->output_add(long_msg => sprintf("Product Name: %s", $name));
|
||||
}
|
||||
|
||||
foreach (@components) {
|
||||
|
|
Loading…
Reference in New Issue