From fe2911fbe370a8bd9ee5507f613356873f03b890 Mon Sep 17 00:00:00 2001 From: Colin Gagnaire Date: Wed, 22 Aug 2018 08:24:12 +0000 Subject: [PATCH] fix hp ilo xmlapi pdrive xml variant (#1105) --- hardware/server/hp/ilo/xmlapi/custom/api.pm | 24 +++++++++++++++++++ .../hp/ilo/xmlapi/mode/components/pdrive.pm | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/hardware/server/hp/ilo/xmlapi/custom/api.pm b/hardware/server/hp/ilo/xmlapi/custom/api.pm index 9a72b8a91..d90c3e737 100644 --- a/hardware/server/hp/ilo/xmlapi/custom/api.pm +++ b/hardware/server/hp/ilo/xmlapi/custom/api.pm @@ -251,6 +251,30 @@ sub change_shitty_xml { # $options{response} =~ s///msg; + # 3rd variant, known as the ArnoMLT variant + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + $options{response} =~ s////msg; + return $options{response}; } diff --git a/hardware/server/hp/ilo/xmlapi/mode/components/pdrive.pm b/hardware/server/hp/ilo/xmlapi/mode/components/pdrive.pm index 18bccc95a..1fef2aa66 100644 --- a/hardware/server/hp/ilo/xmlapi/mode/components/pdrive.pm +++ b/hardware/server/hp/ilo/xmlapi/mode/components/pdrive.pm @@ -22,6 +22,7 @@ package hardware::server::hp::ilo::xmlapi::mode::components::pdrive; use strict; use warnings; +use centreon::plugins::misc; sub load { } @@ -93,7 +94,7 @@ sub check_ilo2 { $self->{components}->{pdrive}->{total}++; $self->{output}->output_add(long_msg => sprintf("physical drive '%s' status is '%s' [instance = %s]", - $result->{NUM}, $result->{STATUS}, $instance)); + centreon::plugins::misc::trim($result->{NUM}), $result->{STATUS}, $instance)); my $exit = $self->get_severity(label => 'default', section => 'pdrive', value => $result->{STATUS}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {