Fix Major bugs #5151
This commit is contained in:
parent
3f024a52ad
commit
e77249516d
|
@ -60,16 +60,17 @@ sub check {
|
|||
$self->{components}->{fan} = {name => 'fans', total => 0};
|
||||
return if ($self->check_exclude('fan'));
|
||||
|
||||
my $oid_coolingDeviceStatus = '.1.3.6.1.4.1.674.10892.1.700.12.1.5.1';
|
||||
my $oid_coolingDeviceReading = '.1.3.6.1.4.1.674.10892.1.700.12.1.6.1';
|
||||
my $oid_coolingDeviceLocationName = '.1.3.6.1.4.1.674.10892.1.700.12.1.8.1';
|
||||
my $oid_coolingDeviceStatus = '.1.3.6.1.4.1.674.10892.1.700.12.1.5';
|
||||
my $oid_coolingDeviceReading = '.1.3.6.1.4.1.674.10892.1.700.12.1.6';
|
||||
my $oid_coolingDeviceLocationName = '.1.3.6.1.4.1.674.10892.1.700.12.1.8';
|
||||
|
||||
my $result = $self->{snmp}->get_table(oid => $oid_coolingDeviceStatus);
|
||||
return if (scalar(keys %$result) <= 0);
|
||||
|
||||
my $result2 = $self->{snmp}->get_leef(oids => [$oid_coolingDeviceReading, $oid_coolingDeviceLocationName],
|
||||
$self->{snmp}->load(oids => [$oid_coolingDeviceReading, $oid_coolingDeviceLocationName],
|
||||
instances => [keys %$result],
|
||||
instance_regexp => '(\d+\.\d+)$');
|
||||
my $result2 = $self->{snmp}->get_leef();
|
||||
return if (scalar(keys %$result2) <= 0);
|
||||
|
||||
foreach my $key ($self->{snmp}->oid_lex_sort(keys %$result)) {
|
||||
|
@ -79,7 +80,7 @@ sub check {
|
|||
|
||||
my $fan_Status = $result->{$key};
|
||||
my $fan_Reading = $result2->{$oid_coolingDeviceReading . '.' . $instance};
|
||||
my $fan_LocationName = $result->{$oid_coolingDeviceLocationName . '.' . $instance};
|
||||
my $fan_LocationName = $result2->{$oid_coolingDeviceLocationName . '.' . $instance};
|
||||
|
||||
$self->{components}->{fan}->{total}++;
|
||||
$self->{output}->output_add(long_msg => sprintf("fan %d status is %s, speed is %d [chassis: %d, location: %s].",
|
||||
|
|
|
@ -85,17 +85,18 @@ sub check {
|
|||
$self->{components}->{psu} = {name => 'power supplies', total => 0};
|
||||
return if ($self->check_exclude('psu'));
|
||||
|
||||
my $oid_powerSupplyStatus = '.1.3.6.1.4.1.674.10892.1.600.12.1.5.1';
|
||||
my $oid_powerSupplyType = '.1.3.6.1.4.1.674.10892.1.600.12.1.7.1';
|
||||
my $oid_powerSupplySensorState = '.1.3.6.1.4.1.674.10892.1.600.12.1.11.1';
|
||||
my $oid_powerSupplyConfigurationErrorType = '1.3.6.1.4.1.674.10892.1.600.12.1.12.1';
|
||||
my $oid_powerSupplyStatus = '.1.3.6.1.4.1.674.10892.1.600.12.1.5';
|
||||
my $oid_powerSupplyType = '.1.3.6.1.4.1.674.10892.1.600.12.1.7';
|
||||
my $oid_powerSupplySensorState = '.1.3.6.1.4.1.674.10892.1.600.12.1.11';
|
||||
my $oid_powerSupplyConfigurationErrorType = '1.3.6.1.4.1.674.10892.1.600.12.1.12';
|
||||
|
||||
my $result = $self->{snmp}->get_table(oid => $oid_powerSupplyStatus);
|
||||
return if (scalar(keys %$result) <= 0);
|
||||
|
||||
my $result2 = $self->{snmp}->get_leef(oids => [$oid_powerSupplyType, $oid_powerSupplySensorState, $oid_powerSupplyConfigurationErrorType],
|
||||
$self->{snmp}->load(oids => [$oid_powerSupplyType, $oid_powerSupplySensorState, $oid_powerSupplyConfigurationErrorType],
|
||||
instances => [keys %$result],
|
||||
instance_regexp => '(\d+\.\d+)$');
|
||||
my $result2 = $self->{snmp}->get_leef();
|
||||
return if (scalar(keys %$result2) <= 0);
|
||||
|
||||
foreach my $key ($self->{snmp}->oid_lex_sort(keys %$result)) {
|
||||
|
@ -105,13 +106,13 @@ sub check {
|
|||
|
||||
my $psu_Status = $result->{$key};
|
||||
my $psu_Type = $result2->{$oid_powerSupplyType . '.' . $instance};
|
||||
my $psu_SensorState = $result->{$oid__powerSupplySensorState . '.' . $instance};
|
||||
my $psu_ConfigurationErrorType = $result->{$oid__powerSupplyConfigurationErrorType . '.' . $instance};
|
||||
my $psu_SensorState = $result2->{$oid_powerSupplySensorState . '.' . $instance};
|
||||
my $psu_ConfigurationErrorType = $result2->{$oid_powerSupplyConfigurationErrorType . '.' . $instance};
|
||||
|
||||
$self->{components}->{psu}->{total}++;
|
||||
$self->{output}->output_add(long_msg => sprintf("psu %d status is %s, state is %s [chassis: %d, type: %d].",
|
||||
$psu_Index, ${$status{$psu_Status}}[0], ${$state{$psu_SensorState}}[0],
|
||||
$chassis_Index, ${$type{$psu_Type}}[0]
|
||||
$self->{output}->output_add(long_msg => sprintf("psu %d status is %s, state is %s [chassis: %d, type: %s].",
|
||||
$psu_Index, ${$status{$psu_Status}}[0], $state{$psu_SensorState},
|
||||
$chassis_Index, $type{$psu_Type}
|
||||
));
|
||||
if ($psu_Status != 3) {
|
||||
$self->{output}->output_add(severity => ${$status{$psu_Status}}[1],
|
||||
|
|
|
@ -72,17 +72,18 @@ sub check {
|
|||
$self->{components}->{temperature} = {name => 'temperature probes', total => 0};
|
||||
return if ($self->check_exclude('temperature'));
|
||||
|
||||
my $oid_temperatureProbeStatus = '.1.3.6.1.4.1.674.10892.1.700.20.1.5.1';
|
||||
my $oid_temperatureProbeReading = '.1.3.6.1.4.1.674.10892.1.700.20.1.6.1';
|
||||
my $oid_temperatureProbeType = '.1.3.6.1.4.1.674.10892.1.700.20.1.7.1';
|
||||
my $oid_temperatureProbeLocationName = '.1.3.6.1.4.1.674.10892.1.700.20.1.8.1';
|
||||
my $oid_temperatureProbeStatus = '.1.3.6.1.4.1.674.10892.1.700.20.1.5';
|
||||
my $oid_temperatureProbeReading = '.1.3.6.1.4.1.674.10892.1.700.20.1.6';
|
||||
my $oid_temperatureProbeType = '.1.3.6.1.4.1.674.10892.1.700.20.1.7';
|
||||
my $oid_temperatureProbeLocationName = '.1.3.6.1.4.1.674.10892.1.700.20.1.8';
|
||||
|
||||
my $result = $self->{snmp}->get_table(oid => $oid_temperatureProbeStatus);
|
||||
return if (scalar(keys %$result) <= 0);
|
||||
|
||||
my $result2 = $self->{snmp}->get_leef(oids => [$oid_temperatureProbeReading, $oid_temperatureProbeType, $oid_temperatureProbeLocationName],
|
||||
$self->{snmp}->load(oids => [$oid_temperatureProbeReading, $oid_temperatureProbeType, $oid_temperatureProbeLocationName],
|
||||
instances => [keys %$result],
|
||||
instance_regexp => '(\d+\.\d+)$');
|
||||
my $result2 = $self->{snmp}->get_leef();
|
||||
return if (scalar(keys %$result2) <= 0);
|
||||
|
||||
foreach my $key ($self->{snmp}->oid_lex_sort(keys %$result)) {
|
||||
|
@ -93,7 +94,7 @@ sub check {
|
|||
my $temperature_Status = $result->{$key};
|
||||
my $temperature_Reading = $result2->{$oid_temperatureProbeReading . '.' . $instance};
|
||||
my $temperature_Type = $result2->{$oid_temperatureProbeType . '.' . $instance};
|
||||
my $temperature_LocationName = $result->{$oid_temperatureProbeLocationName . '.' . $instance};
|
||||
my $temperature_LocationName = $result2->{$oid_temperatureProbeLocationName . '.' . $instance};
|
||||
|
||||
my $temperature_Reading2 = $temperature_Reading/10;
|
||||
|
||||
|
|
Loading…
Reference in New Issue