Odd NRPE issue - variable not printing

Frost, Mark {PBG} mark.frost1 at pepsi.com
Tue Nov 17 18:06:00 CET 2009



From: Steve Shepherd [mailto:stevenshepherd at gmail.com]
Sent: Tuesday, November 17, 2009 11:58 AM
To: Morris, Patrick
Cc: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] Odd NRPE issue - variable not printing

Yes, the script runs fine w/ Nagios user as stated.
On Tue, Nov 17, 2009 at 11:49 AM, Morris, Patrick <patrick.morris at hp.com<mailto:patrick.morris at hp.com>> wrote:
Steve Shepherd wrote:
Hello,

Using NRPE 2.12 and have an issue with a variable from a perl script not being printed.

The script works fine when executed manually using the 'nagios' user which NRPE is running as:

sh-2.05a$ /usr/local/nagios/libexec/check_apache

OK - 68 requests being processed.


However, via NRPE:

/usr/local/nagios/libexec/check_nrpe -H localhost -c check_apache
 OK -  requests being processed.


Below is the script.  I've tried many different code variations, but end result is the same.  I appreciate any insight as to what the issue could be.  Thanks!

When you test at the command line, are you doing it as the nagios user?  Looks like it could easily be a permissions issue.







I must admit to see this kind of thing myself from time to time.  Although to me, it seems more like perl than NRPE.  In a broader context the issue is about getting something different when running from the command line versus running through Nagios.

One that comes to mind that looks for processes consuming lots of CPU will tell me the specific process name when run from the command line, but tells me only "java" when run automatically via Nagios.

I have another script that runs great from the command-line, but blows up when it runs through Nagios.

I haven't had the time to dig in as much as I'd like and Nagios itself does not, unfortunately, provide much useful info from what I've seen to help you debug plugin problems.  In this case though, I'm a little suspicious of ePN causing the different behavior as that's what's really different between my command-line runs and Nagios' automatic runs.

Mark



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20091117/f4b5a231/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
-------------- next part --------------
_______________________________________________
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