exchange 2010 queue: add nexthopdomain

This commit is contained in:
garnier-quentin 2019-02-28 12:59:03 +01:00
parent 49e295a722
commit 94c6850689
2 changed files with 10 additions and 10 deletions

View File

@ -144,13 +144,13 @@ Print powershell output.
=item B<--warning> =item B<--warning>
Set warning threshold. 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> =item B<--critical>
Set critical threshold (Default: '%{status} !~ /Ready|Active/i'). 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 =back
=cut =cut

View File

@ -44,7 +44,7 @@ try {
} }
Foreach ($result in $results) { 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 exit 0
'; ';
@ -57,7 +57,7 @@ sub check {
# options: stdout # options: stdout
# Following output: # 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', $self->{output}->output_add(severity => 'OK',
short_msg => "All Queues are ok."); short_msg => "All Queues are ok.");
@ -65,11 +65,11 @@ sub check {
$self->{output}->output_add(long_msg => $options{stdout}); $self->{output}->output_add(long_msg => $options{stdout});
$self->{perfdatas_queues} = {}; $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} = {};
($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), ($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++; $checked++;
@ -92,7 +92,7 @@ sub check {
if (!$self->{output}->is_status(value => $status, compare => 'ok', litteral => 1)) { if (!$self->{output}->is_status(value => $status, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $status, $self->{output}->output_add(severity => $status,
short_msg => sprintf("Queue '%s' status is '%s' [last error: %s]", 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+)/) { if ($self->{data}->{messagecount} =~ /^(\d+)/) {
@ -125,4 +125,4 @@ __END__
Method to check Exchange 2010 queues. Method to check Exchange 2010 queues.
=cut =cut