enhance performance dell idrac snmp
This commit is contained in:
parent
e8a0fc50a9
commit
34cf291cba
|
@ -40,7 +40,11 @@ my $oid_amperageProbeTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.30.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_amperageProbeTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_amperageProbeTableEntry,
|
||||
start => $mapping->{amperageProbeStateSettings}->{oid},
|
||||
end => $mapping->{amperageProbeLowerCriticalThreshold}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
|
|
@ -39,7 +39,11 @@ my $oid_coolingDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.700.12.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_coolingDeviceTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_coolingDeviceTableEntry,
|
||||
start => $mapping->{coolingDeviceStateSettings}->{oid},
|
||||
end => $mapping->{coolingDeviceLowerCriticalThreshold}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
|
|
@ -34,7 +34,11 @@ my $oid_coolingUnitTableEntry = '.1.3.6.1.4.1.674.10892.5.4.700.10.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_coolingUnitTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_coolingUnitTableEntry,
|
||||
start => $mapping->{coolingUnitStateSettings}->{oid},
|
||||
end => $mapping->{coolingUnitStatus}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -71,4 +75,4 @@ sub check {
|
|||
}
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
|
@ -33,7 +33,11 @@ my $oid_fruTableEntry = '.1.3.6.1.4.1.674.10892.5.4.2000.10.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_fruTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_fruTableEntry,
|
||||
start => $mapping->{fruInformationStatus}->{oid},
|
||||
end => $mapping->{fruSerialNumberName}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -63,4 +67,4 @@ sub check {
|
|||
}
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
|
@ -34,7 +34,11 @@ my $oid_memoryDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.50.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_memoryDeviceTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_memoryDeviceTableEntry,
|
||||
start => $mapping->{memoryDeviceStateSettings}->{oid},
|
||||
end => $mapping->{memoryDeviceLocationName}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -71,4 +75,4 @@ sub check {
|
|||
}
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
|
@ -33,7 +33,11 @@ my $oid_networkDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.90.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_networkDeviceTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_networkDeviceTableEntry,
|
||||
start => $mapping->{networkDeviceStatus}->{oid},
|
||||
end => $mapping->{networkDeviceProductName}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -63,4 +67,4 @@ sub check {
|
|||
}
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
|
@ -34,14 +34,18 @@ my $oid_pCIDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.80.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_pCIDeviceTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_pCIDeviceTableEntry,
|
||||
start => $mapping->{pCIDeviceStateSettings}->{oid},
|
||||
end => $mapping->{pCIDeviceDescriptionName}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->{output}->output_add(long_msg => "Checking pci");
|
||||
$self->{components}->{pci} = {name => 'pci', total => 0, skip => 0};
|
||||
$self->{components}->{pci} = { name => 'pci', total => 0, skip => 0 };
|
||||
return if ($self->check_filter(section => 'pci'));
|
||||
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_pCIDeviceTableEntry}})) {
|
||||
|
@ -71,4 +75,4 @@ sub check {
|
|||
}
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
|
@ -34,20 +34,24 @@ my $oid_processorDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.30.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_processorDeviceTableEntry };
|
||||
push @{$self->{request}},
|
||||
{ oid => $oid_processorDeviceTableEntry, start => $mapping->{processorDeviceStateSettings}->{oid}, end => $mapping->{processorDeviceStatus}->{oid} },
|
||||
{ oid => $mapping->{processorDeviceFQDD}->{oid} }
|
||||
;
|
||||
}
|
||||
|
||||
sub check {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->{output}->output_add(long_msg => "Checking processors");
|
||||
$self->{components}->{processor} = {name => 'processors', total => 0, skip => 0};
|
||||
$self->{components}->{processor} = { name => 'processors', total => 0, skip => 0 };
|
||||
return if ($self->check_filter(section => 'processor'));
|
||||
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_processorDeviceTableEntry}})) {
|
||||
my $snmp_result = { %{$self->{results}->{ $oid_processorDeviceTableEntry }}, %{$self->{results}->{ $mapping->{processorDeviceFQDD}->{oid} }} };
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %$snmp_result)) {
|
||||
next if ($oid !~ /^$mapping->{processorDeviceStatus}->{oid}\.(.*)$/);
|
||||
my $instance = $1;
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_processorDeviceTableEntry}, instance => $instance);
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
|
||||
|
||||
next if ($self->check_filter(section => 'processor', instance => $instance));
|
||||
$self->{components}->{processor}->{total}++;
|
||||
|
|
|
@ -33,14 +33,18 @@ my $oid_powerSupplyTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.12.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_powerSupplyTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_powerSupplyTableEntry,
|
||||
start => $mapping->{powerSupplyStatus}->{oid},
|
||||
end => $mapping->{powerSupplyLocationName}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->{output}->output_add(long_msg => "Checking power supplies");
|
||||
$self->{components}->{psu} = {name => 'power supplies', total => 0, skip => 0};
|
||||
$self->{components}->{psu} = { name => 'power supplies', total => 0, skip => 0 };
|
||||
return if ($self->check_filter(section => 'psu'));
|
||||
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_powerSupplyTableEntry}})) {
|
||||
|
|
|
@ -34,14 +34,18 @@ my $oid_powerUnitTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.10.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_powerUnitTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_powerUnitTableEntry,
|
||||
start => $mapping->{powerUnitStateSettings}->{oid},
|
||||
end => $mapping->{powerUnitStatus}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->{output}->output_add(long_msg => "Checking power units");
|
||||
$self->{components}->{punit} = {name => 'power units', total => 0, skip => 0};
|
||||
$self->{components}->{punit} = { name => 'power units', total => 0, skip => 0 };
|
||||
return if ($self->check_filter(section => 'punit'));
|
||||
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_powerUnitTableEntry}})) {
|
||||
|
@ -71,4 +75,4 @@ sub check {
|
|||
}
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
|
@ -33,21 +33,25 @@ my $oid_systemSlotTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1200.10.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_systemSlotTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_systemSlotTableEntry,
|
||||
start => $mapping->{systemSlotStatus}->{oid},
|
||||
end => $mapping->{systemSlotSlotExternalSlotName}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->{output}->output_add(long_msg => "Checking slots");
|
||||
$self->{components}->{slot} = {name => 'slots', total => 0, skip => 0};
|
||||
$self->{components}->{slot} = { name => 'slots', total => 0, skip => 0 };
|
||||
return if ($self->check_filter(section => 'slot'));
|
||||
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_systemSlotTableEntry}})) {
|
||||
next if ($oid !~ /^$mapping->{systemSlotStatus}->{oid}\.(.*)$/);
|
||||
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));
|
||||
$self->{components}->{slot}->{total}++;
|
||||
|
||||
|
@ -63,4 +67,4 @@ sub check {
|
|||
}
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
|
@ -28,12 +28,11 @@ my $mapping = {
|
|||
batteryComponentStatus => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1.6', map => \%map_status },
|
||||
batteryFQDD => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1.20' },
|
||||
};
|
||||
my $oid_batteryTableEntry = '.1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1';
|
||||
|
||||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_batteryTableEntry };
|
||||
push @{$self->{request}}, { oid => $mapping->{batteryComponentStatus}->{oid} }, { oid => $mapping->{batteryFQDD}->{oid} };
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -43,10 +42,11 @@ sub check {
|
|||
$self->{components}->{storagebattery} = {name => 'storage batteries', total => 0, skip => 0};
|
||||
return if ($self->check_filter(section => 'storagebattery'));
|
||||
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_batteryTableEntry}})) {
|
||||
my $snmp_result = { %{$self->{results}->{ $mapping->{batteryComponentStatus}->{oid} }}, %{$self->{results}->{ $mapping->{batteryFQDD}->{oid} }} };
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %$snmp_result)) {
|
||||
next if ($oid !~ /^$mapping->{batteryComponentStatus}->{oid}\.(.*)$/);
|
||||
my $instance = $1;
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_batteryTableEntry}, instance => $instance);
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
|
||||
|
||||
next if ($self->check_filter(section => 'storagebattery', instance => $instance));
|
||||
$self->{components}->{storagebattery}->{total}++;
|
||||
|
@ -63,4 +63,4 @@ sub check {
|
|||
}
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
|
@ -28,12 +28,11 @@ my $mapping = {
|
|||
controllerComponentStatus => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1.38', map => \%map_status },
|
||||
controllerFQDD => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1.78' },
|
||||
};
|
||||
my $oid_controllerTableEntry = '.1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1';
|
||||
|
||||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_controllerTableEntry };
|
||||
push @{$self->{request}}, { oid => $mapping->{controllerComponentStatus}->{oid} }, { oid => $mapping->{controllerFQDD}->{oid} };
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -43,10 +42,11 @@ sub check {
|
|||
$self->{components}->{storagectrl} = {name => 'storage controllers', total => 0, skip => 0};
|
||||
return if ($self->check_filter(section => 'storagectrl'));
|
||||
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_controllerTableEntry}})) {
|
||||
my $snmp_result = { %{$self->{results}->{ $mapping->{controllerComponentStatus}->{oid} }}, %{$self->{results}->{ $mapping->{controllerFQDD}->{oid} }} };
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %$snmp_result)) {
|
||||
next if ($oid !~ /^$mapping->{controllerComponentStatus}->{oid}\.(.*)$/);
|
||||
my $instance = $1;
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_controllerTableEntry}, instance => $instance);
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
|
||||
|
||||
next if ($self->check_filter(section => 'storagectrl', instance => $instance));
|
||||
$self->{components}->{storagectrl}->{total}++;
|
||||
|
@ -63,4 +63,4 @@ sub check {
|
|||
}
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
|
@ -34,7 +34,11 @@ my $oid_systemBatteryTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.50.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_systemBatteryTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_systemBatteryTableEntry,
|
||||
start => $mapping->{systemBatteryStateSettings}->{oid},
|
||||
start => $mapping->{systemBatteryLocationName}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -52,23 +56,36 @@ sub check {
|
|||
next if ($self->check_filter(section => 'systembattery', instance => $instance));
|
||||
$self->{components}->{systembattery}->{total}++;
|
||||
|
||||
$self->{output}->output_add(long_msg => sprintf("system battery '%s' status is '%s' [instance = %s] [state = %s]",
|
||||
$result->{systemBatteryLocationName}, $result->{systemBatteryStatus}, $instance,
|
||||
$result->{systemBatteryStateSettings}));
|
||||
|
||||
$self->{output}->output_add(
|
||||
long_msg => sprintf(
|
||||
"system battery '%s' status is '%s' [instance = %s] [state = %s]",
|
||||
$result->{systemBatteryLocationName},
|
||||
$result->{systemBatteryStatus}, $instance,
|
||||
$result->{systemBatteryStateSettings}
|
||||
)
|
||||
);
|
||||
|
||||
my $exit = $self->get_severity(label => 'default.state', section => 'systembattery.state', value => $result->{systemBatteryStateSettings});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("System battery '%s' state is '%s'", $result->{systemBatteryLocationName}, $result->{systemBatteryStateSettings}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"System battery '%s' state is '%s'", $result->{systemBatteryLocationName}, $result->{systemBatteryStateSettings}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'default.status', section => 'systembattery.status', value => $result->{systemBatteryStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("System battery '%s' status is '%s'", $result->{systemBatteryLocationName}, $result->{systemBatteryStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"System battery '%s' status is '%s'", $result->{systemBatteryLocationName}, $result->{systemBatteryStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
|
@ -47,7 +47,11 @@ my $oid_temperatureProbeTableEntry = '.1.3.6.1.4.1.674.10892.5.4.700.20.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_temperatureProbeTableEntry, begin => $mapping->{temperatureProbeStateSettings}->{oid}, end => $mapping->{temperatureProbeLowerCriticalThreshold}->{oid} };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_temperatureProbeTableEntry,
|
||||
start => $mapping->{temperatureProbeStateSettings}->{oid},
|
||||
end => $mapping->{temperatureProbeLowerCriticalThreshold}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
|
|
@ -26,42 +26,48 @@ use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_vdi
|
|||
|
||||
my $mapping = {
|
||||
virtualDiskState => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.4', map => \%map_vdisk_state },
|
||||
virtualDiskFQDD => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.35' },
|
||||
virtualDiskFQDD => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.35' }
|
||||
};
|
||||
my $oid_virtualDiskTableEntry = '.1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1';
|
||||
|
||||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_virtualDiskTableEntry };
|
||||
|
||||
push @{$self->{request}}, { oid => $mapping->{virtualDiskState}->{oid} }, { oid => $mapping->{virtualDiskFQDD}->{oid} };
|
||||
}
|
||||
|
||||
sub check {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->{output}->output_add(long_msg => "Checking virtual disks");
|
||||
$self->{components}->{vdisk} = {name => 'virtual disks', total => 0, skip => 0};
|
||||
$self->{components}->{vdisk} = { name => 'virtual disks', total => 0, skip => 0 };
|
||||
return if ($self->check_filter(section => 'vdisk'));
|
||||
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_virtualDiskTableEntry}})) {
|
||||
my $snmp_result = { %{$self->{results}->{ $mapping->{virtualDiskState}->{oid} }}, %{$self->{results}->{ $mapping->{virtualDiskFQDD}->{oid} }} };
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %$snmp_result)) {
|
||||
next if ($oid !~ /^$mapping->{virtualDiskState}->{oid}\.(.*)$/);
|
||||
my $instance = $1;
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_virtualDiskTableEntry}, instance => $instance);
|
||||
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
|
||||
|
||||
next if ($self->check_filter(section => 'vdisk', instance => $instance));
|
||||
$self->{components}->{vdisk}->{total}++;
|
||||
|
||||
$self->{output}->output_add(long_msg => sprintf("virtual disk '%s' state is '%s' [instance = %s]",
|
||||
$result->{virtualDiskFQDD}, $result->{virtualDiskState}, $instance,
|
||||
));
|
||||
|
||||
$self->{output}->output_add(
|
||||
long_msg => sprintf(
|
||||
"virtual disk '%s' state is '%s' [instance = %s]",
|
||||
$result->{virtualDiskFQDD}, $result->{virtualDiskState}, $instance,
|
||||
)
|
||||
);
|
||||
|
||||
my $exit = $self->get_severity(section => 'vdisk.state', value => $result->{virtualDiskState});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("Virtual disk '%s' state is '%s'", $result->{virtualDiskFQDD}, $result->{virtualDiskState}));
|
||||
next;
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"Virtual disk '%s' state is '%s'", $result->{virtualDiskFQDD}, $result->{virtualDiskState}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
|
@ -39,7 +39,11 @@ my $oid_voltageProbeTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.20.1';
|
|||
sub load {
|
||||
my ($self) = @_;
|
||||
|
||||
push @{$self->{request}}, { oid => $oid_voltageProbeTableEntry };
|
||||
push @{$self->{request}}, {
|
||||
oid => $oid_voltageProbeTableEntry,
|
||||
start => $mapping->{voltageProbeStateSettings}->{oid},
|
||||
end => $mapping->{voltageProbeLowerCriticalThreshold}->{oid}
|
||||
};
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -58,10 +62,14 @@ sub check {
|
|||
$self->{components}->{voltage}->{total}++;
|
||||
|
||||
$result->{voltageProbeReading} = (defined($result->{voltageProbeReading})) ? $result->{voltageProbeReading} / 1000 : 'unknown';
|
||||
$self->{output}->output_add(long_msg => sprintf("voltage '%s' status is '%s' [instance = %s] [state = %s] [value = %s]",
|
||||
$result->{voltageProbeLocationName}, $result->{voltageProbeStatus}, $instance,
|
||||
$result->{voltageProbeStateSettings}, $result->{voltageProbeReading}));
|
||||
|
||||
$self->{output}->output_add(
|
||||
long_msg => sprintf(
|
||||
"voltage '%s' status is '%s' [instance = %s] [state = %s] [value = %s]",
|
||||
$result->{voltageProbeLocationName}, $result->{voltageProbeStatus}, $instance,
|
||||
$result->{voltageProbeStateSettings}, $result->{voltageProbeReading}
|
||||
)
|
||||
);
|
||||
|
||||
my $exit = $self->get_severity(label => 'default.state', section => 'voltage.state', value => $result->{voltageProbeStateSettings});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
|
@ -98,8 +106,10 @@ sub check {
|
|||
}
|
||||
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("Voltage '%s' is %s V", $result->{voltageProbeLocationName}, $result->{voltageProbeReading}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf("Voltage '%s' is %s V", $result->{voltageProbeLocationName}, $result->{voltageProbeReading})
|
||||
);
|
||||
}
|
||||
$self->{output}->perfdata_add(
|
||||
label => 'voltage', unit => 'V',
|
||||
|
|
Loading…
Reference in New Issue