<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7650.28">
<TITLE>RE: [Nagiosplug-devel] plugin works locally but not remotely</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Make sure the path to utils.pm in check_mailq is right, then try one of the following:<BR>
<BR>
If you can reproduce the problem locally, run the problematic command with:<BR>
<BR>
"strace -f <full command>"<BR>
<BR>
It it only happens trough NRPE, disable active checks to that host, find the pid of the nrpe daemon and run:<BR>
<BR>
"strace -fp <nrpe pid>"<BR>
<BR>
<BR>
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.<BR>
<BR>
Thomas<BR>
<BR>
-----Original Message-----<BR>
From: nagiosplug-devel-bounces@lists.sourceforge.net on behalf of Gary W. Smith<BR>
Sent: Thu 23-Nov-06 0:35<BR>
To: nagiosplug-devel@lists.sourceforge.net<BR>
Subject: [Nagiosplug-devel] plugin works locally but not remotely<BR>
<BR>
I have two servers, one redhat, one rpath os, both running nrpe. These<BR>
are postfix mail spoolers. The check_nrpe command from the nagios<BR>
servers works fine on the redhat server but dies on the rpath server<BR>
(only for the check_mailq command).<BR>
<BR>
When I run the check_mailq command on the local rpath box it runs<BR>
without any problem. I can't tell why it's dying remotely BUT when I<BR>
wrap the check_mailq command with a shell it works fine remotely.<BR>
<BR>
So I renamed check_mailq to check_mailq.pl and create check_mailq (shell<BR>
script) which does this:<BR>
<BR>
#!/bin/sh<BR>
# Nasty fix for some off the wall reason<BR>
cd /usr/lib/nagios/plugins<BR>
/usr/lib/nagios/plugins/check_mailq.pl $1 $2 $3 $4 $5 $6<BR>
<BR>
I'm not sure why I have to write a wrapper. Anyone seem anything like<BR>
this on different distros? I had to put the cd /usr/lib/nagios/plugins<BR>
in there or it would die on the call to<BR>
/usr/lib/nagios/plugins/check_mailq.pl $1 $2 $3 $4 $5 $6.<BR>
<BR>
Any help would be appreciated.<BR>
<BR>
Gary Wayne Smith<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>