+ Fix perfdatas raising from exchange 2010 mode get-queue
This commit is contained in:
parent
ef9e11780f
commit
95b2280177
|
@ -63,6 +63,8 @@ sub check {
|
||||||
|
|
||||||
my $checked = 0;
|
my $checked = 0;
|
||||||
$self->{output}->output_add(long_msg => $options{stdout});
|
$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=(.*?)\]\[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}->{deliverytype}, $self->{data}->{status}, $self->{data}->{isvalid}, $self->{data}->{messagecount}, $self->{data}->{error}) =
|
||||||
|
@ -94,12 +96,21 @@ sub check {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($self->{data}->{messagecount} =~ /^(\d+)/) {
|
if ($self->{data}->{messagecount} =~ /^(\d+)/) {
|
||||||
$self->{output}->perfdata_add(label => 'queue_length_' . $self->{data}->{identity},
|
my $num = $1;
|
||||||
value => $1,
|
my $identity = $self->{data}->{identity};
|
||||||
min => 0);
|
|
||||||
|
$identity = $1 if ($self->{data}->{identity} =~ /^(.*\\)[0-9]+$/);
|
||||||
|
$self->{perfdatas_queues}->{$identity} = 0 if (!defined($self->{perfdatas_queues}->{$identity}));
|
||||||
|
$self->{perfdatas_queues}->{$identity} += $num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (keys %{$self->{perfdatas_queues}}) {
|
||||||
|
$self->{output}->perfdata_add(label => 'queue_length_' . $_,
|
||||||
|
value => $self->{perfdatas_queues}->{$_},
|
||||||
|
min => 0);
|
||||||
|
}
|
||||||
|
|
||||||
if ($checked == 0) {
|
if ($checked == 0) {
|
||||||
$self->{output}->output_add(severity => 'UNKNOWN',
|
$self->{output}->output_add(severity => 'UNKNOWN',
|
||||||
short_msg => 'Cannot find informations');
|
short_msg => 'Cannot find informations');
|
||||||
|
|
Loading…
Reference in New Issue