Also report the number in the deferred queue

tags/zabbix-agent-addons-0.2.64-1
Daniel Berteaud 6 years ago
parent 263253fe87
commit d381cb5d31
  1. 7
      zabbix_scripts/check_pmg_sudo

@ -19,7 +19,8 @@ my $json = {
ptime_in => 0, ptime_in => 0,
ptime_out => 0, ptime_out => 0,
queue_hold => 0, queue_hold => 0,
queue_active => 0 queue_active => 0,
queue_deferred => 0
}; };
my $pretty = 0; my $pretty = 0;
my ($domain,$what) = undef; my ($domain,$what) = undef;
@ -79,10 +80,10 @@ if (not defined $domain){
my $res = $sth->fetchrow_hashref; my $res = $sth->fetchrow_hashref;
$json->{$_} = $res->{$_} foreach (qw/rbl pregreet/); $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)){ foreach my $res (qx(postqueue -j)){
$res = from_json($res); $res = from_json($res);
foreach (qw/hold active/){ foreach (qw/hold active deferred/){
$json->{'queue_' . $_} += 1 if ($res->{queue_name} eq $_); $json->{'queue_' . $_} += 1 if ($res->{queue_name} eq $_);
} }
} }

Loading…
Cancel
Save