|
|
@ -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 $_); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|