diff --git a/centreon-plugins/centreon/common/redfish/restapi/mode/components/device.pm b/centreon-plugins/centreon/common/redfish/restapi/mode/components/device.pm index c6ed407c4..9462dd117 100644 --- a/centreon-plugins/centreon/common/redfish/restapi/mode/components/device.pm +++ b/centreon-plugins/centreon/common/redfish/restapi/mode/components/device.pm @@ -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}++; diff --git a/centreon-plugins/centreon/common/redfish/restapi/mode/components/fan.pm b/centreon-plugins/centreon/common/redfish/restapi/mode/components/fan.pm index 644631168..9456be684 100644 --- a/centreon-plugins/centreon/common/redfish/restapi/mode/components/fan.pm +++ b/centreon-plugins/centreon/common/redfish/restapi/mode/components/fan.pm @@ -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}++; diff --git a/centreon-plugins/centreon/common/redfish/restapi/mode/components/psu.pm b/centreon-plugins/centreon/common/redfish/restapi/mode/components/psu.pm index 8f3bed657..d246769d1 100644 --- a/centreon-plugins/centreon/common/redfish/restapi/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/redfish/restapi/mode/components/psu.pm @@ -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}++; diff --git a/centreon-plugins/centreon/common/redfish/restapi/mode/components/temperature.pm b/centreon-plugins/centreon/common/redfish/restapi/mode/components/temperature.pm index ef7e7ea72..60fcc460b 100644 --- a/centreon-plugins/centreon/common/redfish/restapi/mode/components/temperature.pm +++ b/centreon-plugins/centreon/common/redfish/restapi/mode/components/temperature.pm @@ -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}++; diff --git a/centreon-plugins/centreon/common/redfish/restapi/mode/hardware.pm b/centreon-plugins/centreon/common/redfish/restapi/mode/hardware.pm index 86d6b4aea..b077f0732 100644 --- a/centreon-plugins/centreon/common/redfish/restapi/mode/hardware.pm +++ b/centreon-plugins/centreon/common/redfish/restapi/mode/hardware.pm @@ -38,6 +38,7 @@ sub set_system { ['ok', 'OK'], ['warning', 'WARNING'], ['critical', 'CRITICAL'], + ['n/a', 'OK'], ], state => [ # can be: absent, deferring, disabled, enabled, diff --git a/centreon-plugins/hardware/server/hp/ilo/restapi/custom/api.pm b/centreon-plugins/hardware/server/hp/ilo/restapi/custom/api.pm index bc5f55551..8de765e8b 100644 --- a/centreon-plugins/hardware/server/hp/ilo/restapi/custom/api.pm +++ b/centreon-plugins/hardware/server/hp/ilo/restapi/custom/api.pm @@ -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();