enhance performance dell idrac snmp

This commit is contained in:
garnier-quentin 2020-04-21 11:38:50 +02:00 committed by Lotfi zaouche
parent e8a0fc50a9
commit 34cf291cba
17 changed files with 151 additions and 70 deletions

View File

@ -40,7 +40,11 @@ my $oid_amperageProbeTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.30.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_amperageProbeTableEntry }; push @{$self->{request}}, {
oid => $oid_amperageProbeTableEntry,
start => $mapping->{amperageProbeStateSettings}->{oid},
end => $mapping->{amperageProbeLowerCriticalThreshold}->{oid}
};
} }
sub check { sub check {

View File

@ -39,7 +39,11 @@ my $oid_coolingDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.700.12.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_coolingDeviceTableEntry }; push @{$self->{request}}, {
oid => $oid_coolingDeviceTableEntry,
start => $mapping->{coolingDeviceStateSettings}->{oid},
end => $mapping->{coolingDeviceLowerCriticalThreshold}->{oid}
};
} }
sub check { sub check {

View File

@ -34,7 +34,11 @@ my $oid_coolingUnitTableEntry = '.1.3.6.1.4.1.674.10892.5.4.700.10.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_coolingUnitTableEntry }; push @{$self->{request}}, {
oid => $oid_coolingUnitTableEntry,
start => $mapping->{coolingUnitStateSettings}->{oid},
end => $mapping->{coolingUnitStatus}->{oid}
};
} }
sub check { sub check {

View File

@ -33,7 +33,11 @@ my $oid_fruTableEntry = '.1.3.6.1.4.1.674.10892.5.4.2000.10.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_fruTableEntry }; push @{$self->{request}}, {
oid => $oid_fruTableEntry,
start => $mapping->{fruInformationStatus}->{oid},
end => $mapping->{fruSerialNumberName}->{oid}
};
} }
sub check { sub check {

View File

@ -34,7 +34,11 @@ my $oid_memoryDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.50.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_memoryDeviceTableEntry }; push @{$self->{request}}, {
oid => $oid_memoryDeviceTableEntry,
start => $mapping->{memoryDeviceStateSettings}->{oid},
end => $mapping->{memoryDeviceLocationName}->{oid}
};
} }
sub check { sub check {

View File

@ -33,7 +33,11 @@ my $oid_networkDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.90.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_networkDeviceTableEntry }; push @{$self->{request}}, {
oid => $oid_networkDeviceTableEntry,
start => $mapping->{networkDeviceStatus}->{oid},
end => $mapping->{networkDeviceProductName}->{oid}
};
} }
sub check { sub check {

View File

@ -34,14 +34,18 @@ my $oid_pCIDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.80.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_pCIDeviceTableEntry }; push @{$self->{request}}, {
oid => $oid_pCIDeviceTableEntry,
start => $mapping->{pCIDeviceStateSettings}->{oid},
end => $mapping->{pCIDeviceDescriptionName}->{oid}
};
} }
sub check { sub check {
my ($self) = @_; my ($self) = @_;
$self->{output}->output_add(long_msg => "Checking pci"); $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')); return if ($self->check_filter(section => 'pci'));
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_pCIDeviceTableEntry}})) { foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_pCIDeviceTableEntry}})) {

View File

@ -34,20 +34,24 @@ my $oid_processorDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.30.1';
sub load { sub load {
my ($self) = @_; 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 { sub check {
my ($self) = @_; my ($self) = @_;
$self->{output}->output_add(long_msg => "Checking processors"); $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')); 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}\.(.*)$/); next if ($oid !~ /^$mapping->{processorDeviceStatus}->{oid}\.(.*)$/);
my $instance = $1; 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)); next if ($self->check_filter(section => 'processor', instance => $instance));
$self->{components}->{processor}->{total}++; $self->{components}->{processor}->{total}++;

View File

@ -33,14 +33,18 @@ my $oid_powerSupplyTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.12.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_powerSupplyTableEntry }; push @{$self->{request}}, {
oid => $oid_powerSupplyTableEntry,
start => $mapping->{powerSupplyStatus}->{oid},
end => $mapping->{powerSupplyLocationName}->{oid}
};
} }
sub check { sub check {
my ($self) = @_; my ($self) = @_;
$self->{output}->output_add(long_msg => "Checking power supplies"); $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')); return if ($self->check_filter(section => 'psu'));
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_powerSupplyTableEntry}})) { foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_powerSupplyTableEntry}})) {

View File

@ -34,14 +34,18 @@ my $oid_powerUnitTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.10.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_powerUnitTableEntry }; push @{$self->{request}}, {
oid => $oid_powerUnitTableEntry,
start => $mapping->{powerUnitStateSettings}->{oid},
end => $mapping->{powerUnitStatus}->{oid}
};
} }
sub check { sub check {
my ($self) = @_; my ($self) = @_;
$self->{output}->output_add(long_msg => "Checking power units"); $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')); return if ($self->check_filter(section => 'punit'));
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_powerUnitTableEntry}})) { foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_powerUnitTableEntry}})) {

View File

@ -33,14 +33,18 @@ my $oid_systemSlotTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1200.10.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_systemSlotTableEntry }; push @{$self->{request}}, {
oid => $oid_systemSlotTableEntry,
start => $mapping->{systemSlotStatus}->{oid},
end => $mapping->{systemSlotSlotExternalSlotName}->{oid}
};
} }
sub check { sub check {
my ($self) = @_; my ($self) = @_;
$self->{output}->output_add(long_msg => "Checking slots"); $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')); return if ($self->check_filter(section => 'slot'));
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_systemSlotTableEntry}})) { foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_systemSlotTableEntry}})) {

View File

@ -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 }, 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' }, 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 { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_batteryTableEntry }; push @{$self->{request}}, { oid => $mapping->{batteryComponentStatus}->{oid} }, { oid => $mapping->{batteryFQDD}->{oid} };
} }
sub check { sub check {
@ -43,10 +42,11 @@ sub check {
$self->{components}->{storagebattery} = {name => 'storage batteries', total => 0, skip => 0}; $self->{components}->{storagebattery} = {name => 'storage batteries', total => 0, skip => 0};
return if ($self->check_filter(section => 'storagebattery')); 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}\.(.*)$/); next if ($oid !~ /^$mapping->{batteryComponentStatus}->{oid}\.(.*)$/);
my $instance = $1; 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)); next if ($self->check_filter(section => 'storagebattery', instance => $instance));
$self->{components}->{storagebattery}->{total}++; $self->{components}->{storagebattery}->{total}++;

View File

@ -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 }, 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' }, 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 { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_controllerTableEntry }; push @{$self->{request}}, { oid => $mapping->{controllerComponentStatus}->{oid} }, { oid => $mapping->{controllerFQDD}->{oid} };
} }
sub check { sub check {
@ -43,10 +42,11 @@ sub check {
$self->{components}->{storagectrl} = {name => 'storage controllers', total => 0, skip => 0}; $self->{components}->{storagectrl} = {name => 'storage controllers', total => 0, skip => 0};
return if ($self->check_filter(section => 'storagectrl')); 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}\.(.*)$/); next if ($oid !~ /^$mapping->{controllerComponentStatus}->{oid}\.(.*)$/);
my $instance = $1; 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)); next if ($self->check_filter(section => 'storagectrl', instance => $instance));
$self->{components}->{storagectrl}->{total}++; $self->{components}->{storagectrl}->{total}++;

View File

@ -34,7 +34,11 @@ my $oid_systemBatteryTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.50.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_systemBatteryTableEntry }; push @{$self->{request}}, {
oid => $oid_systemBatteryTableEntry,
start => $mapping->{systemBatteryStateSettings}->{oid},
start => $mapping->{systemBatteryLocationName}->{oid}
};
} }
sub check { sub check {
@ -52,21 +56,34 @@ sub check {
next if ($self->check_filter(section => 'systembattery', instance => $instance)); next if ($self->check_filter(section => 'systembattery', instance => $instance));
$self->{components}->{systembattery}->{total}++; $self->{components}->{systembattery}->{total}++;
$self->{output}->output_add(long_msg => sprintf("system battery '%s' status is '%s' [instance = %s] [state = %s]", $self->{output}->output_add(
$result->{systemBatteryLocationName}, $result->{systemBatteryStatus}, $instance, long_msg => sprintf(
$result->{systemBatteryStateSettings})); "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}); 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)) { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("System battery '%s' state is '%s'", $result->{systemBatteryLocationName}, $result->{systemBatteryStateSettings})); severity => $exit,
short_msg => sprintf(
"System battery '%s' state is '%s'", $result->{systemBatteryLocationName}, $result->{systemBatteryStateSettings}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'default.status', section => 'systembattery.status', value => $result->{systemBatteryStatus}); $exit = $self->get_severity(label => 'default.status', section => 'systembattery.status', value => $result->{systemBatteryStatus});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("System battery '%s' status is '%s'", $result->{systemBatteryLocationName}, $result->{systemBatteryStatus})); severity => $exit,
short_msg => sprintf(
"System battery '%s' status is '%s'", $result->{systemBatteryLocationName}, $result->{systemBatteryStatus}
)
);
} }
} }
} }

View File

@ -47,7 +47,11 @@ my $oid_temperatureProbeTableEntry = '.1.3.6.1.4.1.674.10892.5.4.700.20.1';
sub load { sub load {
my ($self) = @_; 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 { sub check {

View File

@ -26,40 +26,46 @@ use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_vdi
my $mapping = { my $mapping = {
virtualDiskState => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.4', map => \%map_vdisk_state }, 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 { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_virtualDiskTableEntry }; push @{$self->{request}}, { oid => $mapping->{virtualDiskState}->{oid} }, { oid => $mapping->{virtualDiskFQDD}->{oid} };
} }
sub check { sub check {
my ($self) = @_; my ($self) = @_;
$self->{output}->output_add(long_msg => "Checking virtual disks"); $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')); 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}\.(.*)$/); next if ($oid !~ /^$mapping->{virtualDiskState}->{oid}\.(.*)$/);
my $instance = $1; 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)); next if ($self->check_filter(section => 'vdisk', instance => $instance));
$self->{components}->{vdisk}->{total}++; $self->{components}->{vdisk}->{total}++;
$self->{output}->output_add(long_msg => sprintf("virtual disk '%s' state is '%s' [instance = %s]", $self->{output}->output_add(
$result->{virtualDiskFQDD}, $result->{virtualDiskState}, $instance, 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}); my $exit = $self->get_severity(section => 'vdisk.state', value => $result->{virtualDiskState});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("Virtual disk '%s' state is '%s'", $result->{virtualDiskFQDD}, $result->{virtualDiskState})); severity => $exit,
next; short_msg => sprintf(
"Virtual disk '%s' state is '%s'", $result->{virtualDiskFQDD}, $result->{virtualDiskState}
)
);
} }
} }
} }

View File

@ -39,7 +39,11 @@ my $oid_voltageProbeTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.20.1';
sub load { sub load {
my ($self) = @_; my ($self) = @_;
push @{$self->{request}}, { oid => $oid_voltageProbeTableEntry }; push @{$self->{request}}, {
oid => $oid_voltageProbeTableEntry,
start => $mapping->{voltageProbeStateSettings}->{oid},
end => $mapping->{voltageProbeLowerCriticalThreshold}->{oid}
};
} }
sub check { sub check {
@ -58,9 +62,13 @@ sub check {
$self->{components}->{voltage}->{total}++; $self->{components}->{voltage}->{total}++;
$result->{voltageProbeReading} = (defined($result->{voltageProbeReading})) ? $result->{voltageProbeReading} / 1000 : 'unknown'; $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]", $self->{output}->output_add(
$result->{voltageProbeLocationName}, $result->{voltageProbeStatus}, $instance, long_msg => sprintf(
$result->{voltageProbeStateSettings}, $result->{voltageProbeReading})); "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}); 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)) { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
@ -98,8 +106,10 @@ sub check {
} }
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("Voltage '%s' is %s V", $result->{voltageProbeLocationName}, $result->{voltageProbeReading})); severity => $exit,
short_msg => sprintf("Voltage '%s' is %s V", $result->{voltageProbeLocationName}, $result->{voltageProbeReading})
);
} }
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'voltage', unit => 'V', label => 'voltage', unit => 'V',