From 94c6850689db4c29053774077db36d007c1c5337 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 28 Feb 2019 12:59:03 +0100 Subject: [PATCH] exchange 2010 queue: add nexthopdomain --- .../apps/exchange/2010/local/mode/queues.pm | 6 +++--- .../common/powershell/exchange/2010/queues.pm | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/centreon-plugins/apps/exchange/2010/local/mode/queues.pm b/centreon-plugins/apps/exchange/2010/local/mode/queues.pm index 449edef22..5a8ddbceb 100644 --- a/centreon-plugins/apps/exchange/2010/local/mode/queues.pm +++ b/centreon-plugins/apps/exchange/2010/local/mode/queues.pm @@ -144,13 +144,13 @@ Print powershell output. =item B<--warning> Set warning threshold. -Can used special variables like: %{status}, %{identity}, %{isvalid}, %{deliverytype} +Can used special variables like: %{status}, %{identity}, %{isvalid}, %{deliverytype}, %{messagecount} =item B<--critical> Set critical threshold (Default: '%{status} !~ /Ready|Active/i'). -Can used special variables like: %{status}, %{identity}, %{isvalid}, %{deliverytype} +Can used special variables like: %{status}, %{identity}, %{isvalid}, %{deliverytype}, %{messagecount} =back -=cut \ No newline at end of file +=cut diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm index a1485d898..b663ed2d9 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm @@ -44,7 +44,7 @@ try { } Foreach ($result in $results) { - Write-Host "[identity=" $result.Identity "][deliverytype=" $result.DeliveryType "][status=" $result.Status "][isvalid=" $result.IsValid "][messagecount=" $result.MessageCount "][[error=" $result.LastError "]]" + Write-Host "[identity=" $result.Identity "][nexthopdomain=" $result.NextHopDomain "][deliverytype=" $result.DeliveryType "][status=" $result.Status "][isvalid=" $result.IsValid "][messagecount=" $result.MessageCount "][[error=" $result.LastError "]]" } exit 0 '; @@ -57,7 +57,7 @@ sub check { # options: stdout # Following output: - #[identity= ][deliverytype= SmtpRelayWithinAdSite][status= Active ][isvalid= Yes][messagecount= 1 ][[error=...]] + #[identity= ][nexthopdomain= xxxx][deliverytype= SmtpRelayWithinAdSite][status= Active ][isvalid= Yes][messagecount= 1 ][[error=...]] $self->{output}->output_add(severity => 'OK', short_msg => "All Queues are ok."); @@ -65,11 +65,11 @@ sub check { $self->{output}->output_add(long_msg => $options{stdout}); $self->{perfdatas_queues} = {}; - while ($options{stdout} =~ /\[identity=(.*?)\]\[deliverytype=(.*?)\]\[status=(.*?)\]\[isvalid=(.*?)\]\[messagecount=(.*?)\]\[\[error=(.*?)\]\]/msg) { + while ($options{stdout} =~ /\[identity=(.*?)\]\[nexthopdomain=(.*?)\]\[deliverytype=(.*?)\]\[status=(.*?)\]\[isvalid=(.*?)\]\[messagecount=(.*?)\]\[\[error=(.*?)\]\]/msg) { $self->{data} = {}; - ($self->{data}->{identity}, $self->{data}->{deliverytype}, $self->{data}->{status}, $self->{data}->{isvalid}, $self->{data}->{messagecount}, $self->{data}->{error}) = + ($self->{data}->{identity}, $self->{data}->{nexthopdomain}, $self->{data}->{deliverytype}, $self->{data}->{status}, $self->{data}->{isvalid}, $self->{data}->{messagecount}, $self->{data}->{error}) = ($self->{output}->to_utf8($1), centreon::plugins::misc::trim($2), - centreon::plugins::misc::trim($3), centreon::plugins::misc::trim($4), centreon::plugins::misc::trim($5), centreon::plugins::misc::trim($6)); + centreon::plugins::misc::trim($3), centreon::plugins::misc::trim($4), centreon::plugins::misc::trim($5), centreon::plugins::misc::trim($6), centreon::plugins::misc::trim($7)); $checked++; @@ -92,7 +92,7 @@ sub check { if (!$self->{output}->is_status(value => $status, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $status, short_msg => sprintf("Queue '%s' status is '%s' [last error: %s]", - $self->{data}->{identity}, $self->{data}->{status}, $self->{data}->{error})); + $self->{data}->{nexthopdomain}, $self->{data}->{status}, $self->{data}->{error})); } if ($self->{data}->{messagecount} =~ /^(\d+)/) { @@ -125,4 +125,4 @@ __END__ Method to check Exchange 2010 queues. -=cut \ No newline at end of file +=cut