From 75c8b4fbe9ba74ade9b60bab5660ef869deac553 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Tue, 12 Sep 2017 14:05:12 +0200 Subject: [PATCH] fix 0 values in jmx list attributes --- centreon/common/protocols/jmx/custom/jolokia.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/centreon/common/protocols/jmx/custom/jolokia.pm b/centreon/common/protocols/jmx/custom/jolokia.pm index d2dfaca51..fb1f83915 100644 --- a/centreon/common/protocols/jmx/custom/jolokia.pm +++ b/centreon/common/protocols/jmx/custom/jolokia.pm @@ -292,7 +292,8 @@ sub list_attributes { $v =~ s/^\s*//; print " = " . $v; } else { - if (my $scal = JMX::Jmx4Perl::Util->dump_scalar($val)) { + my $scal = JMX::Jmx4Perl::Util->dump_scalar($val); + if (defined($scal)) { print " = " . $scal . "\n"; } else { print " = undef\n"; @@ -367,4 +368,4 @@ Credentials to use for the target B. -=cut \ No newline at end of file +=cut