fix ilo 5 plugin

This commit is contained in:
garnier-quentin 2019-12-30 10:21:59 +01:00
parent 21c699408b
commit 4bac793318
6 changed files with 7 additions and 2 deletions

View File

@ -41,6 +41,7 @@ sub check {
my $device_name = $device->{Name};
my $instance = $chassis->{Id} . '.' . $device->{Id};
$device->{Status}->{Health} = defined($device->{Status}->{Health}) ? $device->{Status}->{Health} : 'n/a';
next if ($self->check_filter(section => 'device', instance => $instance));
$self->{components}->{device}->{total}++;

View File

@ -47,6 +47,7 @@ sub check {
my $fan_name = $fan->{Name};
my $instance = $chassis->{Id} . '.' . $fan->{MemberId};
$fan->{Status}->{Health} = defined($fan->{Status}->{Health}) ? $fan->{Status}->{Health} : 'n/a';
next if ($self->check_filter(section => 'fan', instance => $instance));
$self->{components}->{fan}->{total}++;

View File

@ -38,10 +38,11 @@ sub check {
$chassis->{Power}->{result} = $self->get_power(chassis => $chassis) if (!defined($chassis->{Power}->{result}));
next if (!defined($chassis->{Power}->{result}->{PowerSupplies}));
foreach my $psu (@{$chassis->{Thermal}->{result}->{PowerSupplies}}) {
foreach my $psu (@{$chassis->{Power}->{result}->{PowerSupplies}}) {
my $psu_name = 'psu:' . $psu->{MemberId};
my $instance = $chassis->{Id} . '.' . $psu->{MemberId};
$psu->{Status}->{Health} = defined($psu->{Status}->{Health}) ? $psu->{Status}->{Health} : 'n/a';
next if ($self->check_filter(section => 'psu', instance => $instance));
$self->{components}->{psu}->{total}++;

View File

@ -42,6 +42,7 @@ sub check {
my $temp_name = $temp->{Name};
my $instance = $chassis->{Id} . '.' . $temp->{MemberId};
$temp->{Status}->{Health} = defined($temp->{Status}->{Health}) ? $temp->{Status}->{Health} : 'n/a';
next if ($self->check_filter(section => 'temperature', instance => $instance));
$self->{components}->{temperature}->{total}++;

View File

@ -38,6 +38,7 @@ sub set_system {
['ok', 'OK'],
['warning', 'WARNING'],
['critical', 'CRITICAL'],
['n/a', 'OK'],
],
state => [
# can be: absent, deferring, disabled, enabled,

View File

@ -184,7 +184,7 @@ sub authenticate {
$self->{output}->option_exit();
}
my $token = $self->{http}->get_header(name => 'X-Auth-Token');
$token = $self->{http}->get_header(name => 'X-Auth-Token');
if (!defined($token)) {
$self->{output}->add_option_msg(short_msg => "Error retrieving token");
$self->{output}->option_exit();