--- check_mailq.pl 2010-11-19 10:09:30.871245273 -0500 +++ /home/jwm/check_mailq 2010-11-19 10:13:33.060816778 -0500 @@ -130,7 +130,26 @@ ##/var/spool/mqueue/qF/df is empty ## Total Requests: 1 - +# separate submission/transport queues, empty +## MSP Queue status... +## /var/spool/mqueue-client is empty +## Total requests: 0 +## MTA Queue status... +## /var/spool/mqueue is empty +## Total requests: 0 +# separate submission/transport queues: 1 +## MSP Queue status... +## /var/spool/mqueue-client (1 request) +## -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient----------- +## oAJEfhdW014123 5 Fri Nov 19 14:41 jwm +## (Deferred: Connection refused by [127.0.0.1]) +## root +## Total requests: 1 +## MTA Queue status... +## /var/spool/mqueue is empty +## Total requests: 0 + + my $this_msg_q = 0; while () { # match email addr on queue listing @@ -170,13 +189,18 @@ # # single queue: first line # multi queue: one for each queue. overwrite on multi queue below - $msg_q = $1 ; + $this_msg_q = $1 ; + $msg_q += $1 ; } } elsif (/^\s+Total\sRequests:\s(\d+)$/i) { - print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ; - # - # multi queue: last line - $msg_q = $1 ; + if ($this_msg_q) { + $this_msg_q = 0 ; + } else { + print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ; + # + # multi queue: last line + $msg_q += $1 ; + } } }