<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered)">
<title>RE: [Nagiosplug-devel] plugin works locally but not remotely</title>
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks…</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Gary Wayne Smith</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
nagiosplug-devel-bounces@lists.sourceforge.net
[mailto:nagiosplug-devel-bounces@lists.sourceforge.net] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Thomas Guyot-Sionnest<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, November 22, 2006
9:50 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Nagios Plugin Development
Mailing List; nagiosplug-devel@lists.sourceforge.net<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Nagiosplug-devel]
plugin works locally but not remotely</span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>

<p style='margin-bottom:12.0pt'><font size=2 face="Times New Roman"><span
style='font-size:10.0pt'>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</span></font></p>

</div>

</body>

</html>