[Nagiosplug-devel] plugin works locally but not remotely

Gary W. Smith gary at primeexalia.com
Thu Nov 23 07:06:28 CET 2006


For some reason the check_mailq is using "nagios/plugins/" as the base
path (from the source).  This I changed it to be the full path of
"/usr/lib/nagiios/plugins/" and it seems to work now.  I will check the
other files and see what else might be broken.  I will hack the source
and update my rpath package to fix it there as well.

 

Thanks...

 

Gary Wayne Smith

 

________________________________

From: nagiosplug-devel-bounces at lists.sourceforge.net
[mailto:nagiosplug-devel-bounces at lists.sourceforge.net] On Behalf Of
Thomas Guyot-Sionnest
Sent: Wednesday, November 22, 2006 9:50 PM
To: Nagios Plugin Development Mailing List;
nagiosplug-devel at lists.sourceforge.net
Subject: Re: [Nagiosplug-devel] plugin works locally but not remotely

 

Make sure the path to utils.pm in check_mailq is right, then try one of
the following:

If you can reproduce the problem locally, run the problematic command
with:

"strace -f <full command>"

It it only happens trough NRPE, disable active checks to that host, find
the pid of the nrpe daemon and run:

"strace -fp <nrpe pid>"


In either case try to follow the systems calls. Look for an error like
permission denied opening a file or a file not found. I know the output
is awfully long (especially with Perl checks) but you'll likely find
exactly where it's failing.

Thomas

-----Original Message-----
From: nagiosplug-devel-bounces at lists.sourceforge.net on behalf of Gary
W. Smith
Sent: Thu 23-Nov-06 0:35
To: nagiosplug-devel at lists.sourceforge.net
Subject: [Nagiosplug-devel] plugin works locally but not remotely

I have two servers, one redhat, one rpath os, both running nrpe.  These
are postfix mail spoolers.  The check_nrpe command from the nagios
servers works fine on the redhat server but dies on the rpath server
(only for the check_mailq command).

When I run the check_mailq command on the local rpath box it runs
without any problem.  I can't tell why it's dying remotely BUT when I
wrap the check_mailq command with a shell it works fine remotely.

So I renamed check_mailq to check_mailq.pl and create check_mailq (shell
script) which does this:

#!/bin/sh
# Nasty fix for some off the wall reason
cd /usr/lib/nagios/plugins
/usr/lib/nagios/plugins/check_mailq.pl $1 $2 $3 $4 $5 $6

I'm not sure why I have to write a wrapper.  Anyone seem anything like
this on different distros?  I had to put the cd /usr/lib/nagios/plugins
in there or it would die on the call to
/usr/lib/nagios/plugins/check_mailq.pl $1 $2 $3 $4 $5 $6.

Any help would be appreciated.

Gary Wayne Smith

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20061122/484d46d1/attachment.html>


More information about the Devel mailing list