Fix bluemind mode problem with centos 5 (operator can be used with Perl >= 5.10)

This commit is contained in:
Quentin Garnier 2015-02-16 11:01:24 +01:00
parent 2e9cf95dd3
commit 6da868eb79
1 changed files with 2 additions and 4 deletions

View File

@ -41,9 +41,7 @@ use strict;
use warnings;
use centreon::plugins::httplib;
use centreon::plugins::statefile;
use JSON;
use Data::Dumper;
sub new {
my ($class, %options) = @_;
@ -146,8 +144,8 @@ sub run {
}
}
my $success_incoming_mails = $hwebcontent->{qw(lmtpd.deliveries)}->[0]->{success_sum} // '0';
my $failure_incoming_mails = $hwebcontent->{qw(lmtpd.deliveries)}->[0]->{failure_sum} // '0';
my $success_incoming_mails = defined($hwebcontent->{qw(lmtpd.deliveries)}->[0]->{success_sum}) ? $hwebcontent->{qw(lmtpd.deliveries)}->[0]->{success_sum} : '0';
my $failure_incoming_mails = defined($hwebcontent->{qw(lmtpd.deliveries)}->[0]->{failure_sum}) ? $hwebcontent->{qw(lmtpd.deliveries)}->[0]->{failure_sum} : '0';
# If not present: failure and success incoming mails are 0
if (!defined($success_incoming_mails)) {