[Nagiosplug-help] check_mailq plugin

Peter Hicks petong at jah.net
Fri Sep 19 12:44:26 CEST 2003


I seem to be having trouble with the check_mailq plugin. When executed,
I get the following results:

 ./check_mailq -w 100 -c 500 -v
Use of uninitialized value in concatenation (.) or string at ./check_mailq line 110.
Use of uninitialized value in concatenation (.) or string at ./check_mailq line 110.
 | mailq = 
Use of uninitialized value in exit at ./check_mailq line 111.

I am using the 1.3.1 plugins. I tried using the plugins that are in cvs,
but I seem to have problems with this check_mailq as well. The cvs
version would be ideal, as I am running qmail. This is the output from
the cvs version:

./check_mailq -M qmail -w 100 -c 200 -v
Duplicate specification "Warning=i" for option "warning"
Duplicate specification "Critical=i" for option "critical"
/usr/sbin/qmail-qstat: line 1: wc: No such file or directory
/usr/sbin/qmail-qstat: line 1: find: No such file or directory
/usr/sbin/qmail-qstat: line 1: wc: No such file or directory
/usr/sbin/qmail-qstat: line 1: wc: No such file or directory
/usr/sbin/qmail-qstat: line 1: find: No such file or directory
/usr/sbin/qmail-qstat: line 1: wc: No such file or directory
/usr/sbin/qmail-qstat: line 1: expr: No such file or directory
/usr/sbin/qmail-qstat: line 1: expr: No such file or directory
Couldn't match /usr/sbin/qmail-qstat output

When looking at the source for the cvs version, I see the following,
which looks like the output of someones mailq in the code:

if ($mailq eq "sendmail") {

        ## open mailq 
        if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) {
                if (! open (MAILQ, "$utils::PATH_TO_MAILQ | " ) ) {
                        print "ERROR: could not open $utils::PATH_TO_MAILQ \n";
                        exit $ERRORS{'UNKNOWN'};
                }
        }elsif( defined $utils::PATH_TO_MAILQ){
                unless (-x $utils::PATH_TO_MAILQ) {
                        print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>
:gid($)))\n";
                        exit $ERRORS{'UNKNOWN'};
                }
        } else {
                print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n";
                exit $ERRORS{'UNKNOWN'};
        }
#  single queue empty
##/var/spool/mqueue is empty
#  single queue: 1
##                /var/spool/mqueue (1 request)
##----Q-ID---- --Size-- -----Q-Time----- ------------Sender/Recipient------------
##h32E30p01763     2782 Wed Apr  2 15:03 <silvaATkpnqwest.pt>
##      8BITMIME
##                                       <silvaATeunet.pt>

#  multi queue empty
##/var/spool/mqueue/q0/df is empty
##/var/spool/mqueue/q1/df is empty
##/var/spool/mqueue/q2/df is empty
##/var/spool/mqueue/q3/df is empty
##/var/spool/mqueue/q4/df is empty
##/var/spool/mqueue/q5/df is empty
##/var/spool/mqueue/q6/df is empty
##/var/spool/mqueue/q7/df is empty
##/var/spool/mqueue/q8/df is empty
##/var/spool/mqueue/q9/df is empty
##/var/spool/mqueue/qA/df is empty
##/var/spool/mqueue/qB/df is empty
<snip>

Any helpful ideas? I could really use the help of this plugin right
about now.

TIA

-Pete





More information about the Help mailing list