From d381cb5d31a3dfad6e0696f629e80842b272ea11 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 20 Feb 2019 19:54:34 +0100 Subject: [PATCH] Also report the number in the deferred queue --- zabbix_scripts/check_pmg_sudo | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/zabbix_scripts/check_pmg_sudo b/zabbix_scripts/check_pmg_sudo index 381a037..69c4736 100644 --- a/zabbix_scripts/check_pmg_sudo +++ b/zabbix_scripts/check_pmg_sudo @@ -8,18 +8,19 @@ use Data::Dumper; use PMG::DBTools; my $json = { - count_in => 0, - count_out => 0, - bytes_in => 0, - bytes_out => 0, - spam_in => 0, - spam_out => 0, - virus_in => 0, - virus_out => 0, - ptime_in => 0, - ptime_out => 0, - queue_hold => 0, - queue_active => 0 + count_in => 0, + count_out => 0, + bytes_in => 0, + bytes_out => 0, + spam_in => 0, + spam_out => 0, + virus_in => 0, + virus_out => 0, + ptime_in => 0, + ptime_out => 0, + queue_hold => 0, + queue_active => 0, + queue_deferred => 0 }; my $pretty = 0; my ($domain,$what) = undef; @@ -79,10 +80,10 @@ if (not defined $domain){ my $res = $sth->fetchrow_hashref; $json->{$_} = $res->{$_} foreach (qw/rbl pregreet/); - # Here we count email in the queue (active and hold queue) + # Here we count email in the queue (active, deferred and hold queues) foreach my $res (qx(postqueue -j)){ $res = from_json($res); - foreach (qw/hold active/){ + foreach (qw/hold active deferred/){ $json->{'queue_' . $_} += 1 if ($res->{queue_name} eq $_); } }