NRPE: Unable to read output

Dan Langille dan at langille.org
Tue Jan 16 02:25:02 CET 2007


On 16 Jan 2007 at 2:06, Arno Lehmann wrote:

> Hi,
> 
> On 1/16/2007 1:26 AM, Dan Langille wrote:
> > On 16 Jan 2007 at 1:12, Arno Lehmann wrote:
> > 
> > 
> >>Hi,
> >>
> >>On 1/16/2007 12:40 AM, Dan Langille wrote:
> >>
> >>>On 15 Jan 2007 at 18:08, Dan Langille wrote:
> >>>
> >>>
> >>>
> >>>>Hi folks,
> >>>>
> >>>>I'm using nrpe 1.9 on FreeBSD 6.x and I'm failing to get a remote 
> >>>>script to work.  It seems that no perl script works, but I can get 
> >>>>compiled plug-ins to work.
> >>
> >>...
> >>
> >>>My thanks to bernardl for the repeated questions about what I was 
> >>>doing.  The solution: write a wrapper which does a cd.
> >>>
> >>># cat check_raid_dell_wrapper
> >>>#!/bin/sh
> >>>cd /usr/local/libexec/nagios
> >>>perl check_raid_dell
> >>>
> >>>Then refer to the wrapper in the nrpe.cfg on the remote server:
> >>>
> >>># grep dell /usr/local/etc/nrpe.cfg
> >>>command[check_raid_dell]=/usr/local/libexec/nagios/check_raid_dell_wra
> >>>pper
> >>
> >>Interesting. Should be possible to invoke the check script directly, 
> >>though. You can call it with its path, it should have a hash bang line, 
> >>and the necessary inclusion of utils.pm could be handled from inside the 
> >>script. Which, incidentially, is how the standard plugins I know work :-)
> >>
> >>But a wrapper is often the solution to plugin problems...
> > 
> > 
> > 
> > We write that, with the full path.  That is what led us to the 
> > wrapper solution:
> > 
> > # su -m -c nagios nagios c 
> > "/usr/local/libexec/nagios/check_raid_dell"
> > Can't locate utils.pm in @INC (@INC contains: nagios 
> > /usr/local/lib/perl5/5.8.8/BSDPAN 
> > /usr/local/lib/perl5/site_perl/5.8.8/mach 
> > /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl 
> > /usr/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 .) at 
> > /usr/local/libexec/nagios/check_raid_dell line 17.
> > BEGIN failed--compilation aborted at 
> > /usr/local/libexec/nagios/check_raid_dell line 17.
> > #
> > 
> 
> Well, I'm not a perl guru, but in the standard plugins I looked at I 
> have a line "use lib "/usr/local/nagios2/libexec"  ;" which looks like 
> it is important for cases like yours...

$ grep "use lib" check_*
check_breeze:use lib "nagios" ;
check_disk_smb:use lib "nagios" ;
check_file_age:use lib "nagios";
check_flexlm:use lib "nagios";
check_ifoperstatus:use lib "nagios" ;
check_ifstatus:use lib "nagios" ;
check_ircd:use lib "nagios";
check_mailq:use lib  "nagios";
check_rpc:use lib "nagios";
check_wave:use lib "nagios";

Yep...  How unfortunate that the one I chose to base my plugin on is 
check_file_age, which does not have this.


-- 
Dan Langille : Software Developer looking for work
my resume: http://www.freebsddiary.org/dan_langille.php
PGCon - The PostgreSQL Conference - http://www.pgcon.org/



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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