check_nrpe misbehaving?

schnitzel meister schnitzelmeister at gmail.com
Fri Apr 22 14:12:13 CEST 2005


I've filled the mailq, and check_mailq is not returning the same value
as mailq itself.

The problem line is:
                if (/empty/ ) {
                        $msg = "OK: mailq is empty";

Here is what mailq tells me:

MSP Queue status...
/var/spool/mqueue-client is empty
                Total requests: 0
MTA Queue status...
                /var/spool/mqueue (14 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
etc.

So I suppose that's the primary problem.
I'm using v1.5 of the plugin, I'll go back to the earlier version for
the moment.

Thanks for your help.

On 4/22/05, schnitzel meister <schnitzelmeister at gmail.com> wrote:
> Hi, thanks for the reply.
> 
> On 4/22/05, Andreas Ericsson <ae at op5.se> wrote:
> > schnitzel meister wrote:
> > > Hello again,
> > > Thanks for your previous help, maybe you can help me again?
> > >
> > > I'm having some trouble with check_mailq returning the wrong return
> > > code - but only when running over check_nrpe.
> > >
> >
> > It's a permission issue in 99.9% of the cases.
> >
> > > To find out why, I ran the plugin on both the mail server and the
> > > nagios server from the command line.
> > >
> > > On the mail server, I have:
> > >  while true; do
> > >   /usr/lib/nagios/plugins/check_mailq -w 50 -c 100
> > >   echo "Return: $?";
> > >   sleep 5;
> > >  done
> > >
> >
> > Are you running this as the user nrpe runs as?
> 
> Yes I am.
> 
> > Does it give different
> > output when run as root vs the nrpe user?
> 
> No it doesn't.
> 
> >
> > > and on the nagios box I have:
> > >  while true; do
> > >   /usr/lib/nagios/plugins/check_nrpe -n -H ip.goes.here -c check_mailq1;
> > >   echo "Return: $?";
> > >   sleep 5;
> > >  done
> > >
> > > The mail server ALWAYS returns an "OK: mailq empty message", return code 3.
> > > check_nrpe on the nagios box also always returns an "OK: mailq empty
> > > message", but 20% of the time has a return code of 0.
> > >
> > > Any ideas?
> > >
> >
> > Several.
> >
> > 1/ Permissions (see above).
> >
> > 2/ check_mailq seems broken, since it reports UNKNOWN but yet produces
> > output which would lead one to think the mailqueue is empty (which it
> > can't know if it returns UNKNOWN).
> 
> To check if the mailq command was confusing check_mailq, I ran the
> following on the mail server:
> while true; do mailq 1>/dev/null; echo "Return: $?"; sleep 1; done
> mailq always returned 0.
> Next I tried running mailq lots of time simulatenously. Still no
> problem. Always the same return code.
> 
> >
> > 3/ You're running an MTA which check_mailq doesn't know how to check
> > (links in to 2, since it's per definition broken for failing to report
> > this).
> 
> Sendmail on Debian.
> 
> >
> > --
> > Andreas Ericsson                   andreas.ericsson at op5.se
> > OP5 AB                             www.op5.se
> > Lead Developer
> >
> >
> 
> I don't get this problem with the other plugins, so I guess it's a
> check_mailq bug.
> How can I debug this?
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list