fix ilo 5 plugin
This commit is contained in:
parent
6222119981
commit
aaf382dfa2
|
@ -41,6 +41,7 @@ sub check {
|
||||||
my $device_name = $device->{Name};
|
my $device_name = $device->{Name};
|
||||||
my $instance = $chassis->{Id} . '.' . $device->{Id};
|
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));
|
next if ($self->check_filter(section => 'device', instance => $instance));
|
||||||
$self->{components}->{device}->{total}++;
|
$self->{components}->{device}->{total}++;
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ sub check {
|
||||||
my $fan_name = $fan->{Name};
|
my $fan_name = $fan->{Name};
|
||||||
my $instance = $chassis->{Id} . '.' . $fan->{MemberId};
|
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));
|
next if ($self->check_filter(section => 'fan', instance => $instance));
|
||||||
$self->{components}->{fan}->{total}++;
|
$self->{components}->{fan}->{total}++;
|
||||||
|
|
||||||
|
|
|
@ -38,10 +38,11 @@ sub check {
|
||||||
$chassis->{Power}->{result} = $self->get_power(chassis => $chassis) if (!defined($chassis->{Power}->{result}));
|
$chassis->{Power}->{result} = $self->get_power(chassis => $chassis) if (!defined($chassis->{Power}->{result}));
|
||||||
next if (!defined($chassis->{Power}->{result}->{PowerSupplies}));
|
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 $psu_name = 'psu:' . $psu->{MemberId};
|
||||||
my $instance = $chassis->{Id} . '.' . $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));
|
next if ($self->check_filter(section => 'psu', instance => $instance));
|
||||||
$self->{components}->{psu}->{total}++;
|
$self->{components}->{psu}->{total}++;
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ sub check {
|
||||||
my $temp_name = $temp->{Name};
|
my $temp_name = $temp->{Name};
|
||||||
my $instance = $chassis->{Id} . '.' . $temp->{MemberId};
|
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));
|
next if ($self->check_filter(section => 'temperature', instance => $instance));
|
||||||
$self->{components}->{temperature}->{total}++;
|
$self->{components}->{temperature}->{total}++;
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ sub set_system {
|
||||||
['ok', 'OK'],
|
['ok', 'OK'],
|
||||||
['warning', 'WARNING'],
|
['warning', 'WARNING'],
|
||||||
['critical', 'CRITICAL'],
|
['critical', 'CRITICAL'],
|
||||||
|
['n/a', 'OK'],
|
||||||
],
|
],
|
||||||
state => [
|
state => [
|
||||||
# can be: absent, deferring, disabled, enabled,
|
# can be: absent, deferring, disabled, enabled,
|
||||||
|
|
|
@ -184,7 +184,7 @@ sub authenticate {
|
||||||
$self->{output}->option_exit();
|
$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)) {
|
if (!defined($token)) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Error retrieving token");
|
$self->{output}->add_option_msg(short_msg => "Error retrieving token");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
|
|
Loading…
Reference in New Issue