# Sendmail mailq check for mail servers. If checks the numeber of mail
# message queue against the $MAILQWARN AND $MAILQCRIT variables
-# $Id: check_mailq,v 1.4 2001/09/16 18:08:39 sljohnson Exp $
+# $Id: check_mailq,v 1.5 2002/01/22 15:08:07 sljohnson Exp $
use Spong::SafeExec qw(safe_exec);
$singlq = 0;
my @msg = safe_exec($MAILQ);
$mqcnt = 0;
- while (shift @msg) {
+ while ($_ = shift @msg) {
if (/Mail Queue\s+\((\d+)/) { $mqcnt = $1; $singleq=1; }
elsif (/Total Requests:\s+(\d+)/) { $mqcnt = $1; }
elsif (/\s+(\S+)\s+\((\d+)\s+requests\)/) { $qcnt{$1} = $2; }