FW: NRPE: Unable to read output - Plugin(event handler)

Nathan Oyler noyler at khimetrics.com
Wed Jan 5 21:39:48 CET 2005


Actually, I just tried something regarding your message and got a
response.

I think I know what the problem is now, but need help in how to correct
it. 

I specified in nrpe.cfg the command as

command[cycle_tomcat]=/usr/lib/nagios/plugins/cycle_tomcat OK

and put an echo statement inside OK and it came back with the response. 

Same with the rest of the states, except for the state in which the
actual restart code is implemented, then the socket does a 10 second
time out.

So from that I gather I am incorrectly specifiying the command when
arguments need to be accepted. The command I was using is
command[cycle_tomcat]=/usr/lib/nagios/plugins/cycle_tomcat $ARG1$ $ARG2$
$ARG3$

and with don't blame nrpe on, and specifying arguments on the command
line with check nrpe
[root at triad8 plugins]# ./check_nrpe -H devweb1 -c cycle_tomcat OK

Replies back with the statement in OK

./check_nrpe -H devweb1 -c cycle_tomcat CRITICAL HARD 2

Replies back with the statement in OK

If I specify the command check as

Command[cycle_tomcat]=/usr/lib/nagios/plugins/cycle_tomcat CRITICAL SOFT
3

I get back the socket timeout.

So I can state the exact command, and I think it's running but time's
out, so I believe there are two issues.

Am I setting arugments correctly inside nrpe.cfg for an event handler.

And is there a way to set the timeout as longer. I just found that there
is, so I'll try that specifying the command explicitly.

And that seemed to work. 

So... How do you set up arguments when using an event handler, I thought
it was $ARG1$

Thank you very much for your help Lewis.



 


> -----Original Message-----
> From: Lewis Getschel [mailto:lgetschel at denver.westerngeco.slb.com]
> Sent: Wednesday, January 05, 2005 1:02 PM
> To: Nathan Oyler
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: FW: [Nagios-users] NRPE: Unable to read output -
Plugin(event
> handler)
> 
> Nathan-
>    If I'm following you (which I may not be)...
> 
> Your nrpe.cfg command listed here doesn't have ANY arguments shown for
> cycle_tomcat.
> 
> Assuming that you're using nrpe's original configuration, it doesn't
> accept any arguments while 'calling' nrpe from your nagios server
> (security issues abound, i.e. dont_blame_nrpe=1).
> Therefore, if cycle_tomcat needs any parameters, you need to list them
> along with the script path/name. Here is one of my nrpe.cfg commands:
> 
> command[check_fsdisk4]=/usr/lib/nagios/plugins/check_disk -w 10% -c 5%
> -p /dev/sde1
> 
> In services.cfg it is simply called with:
> check_nrpe!check_fsdisk4
> 
> I don't put any parameters in the services.cfg file, just in the
> nrpe.cfg file.
> 
> I hope I got what you wanted.
> Lewis
> 
> 
> Nathan Oyler wrote:
> 
> >/* see if the command timed out */
> >			if(early_timeout==TRUE)
> >				snprintf(buffer,sizeof(buffer)-1,"NRPE:
> >Command timed out after %d seconds\n",command_timeout);
> >			else if(!strcmp(buffer,""))
> >				snprintf(buffer,sizeof(buffer)-1,"NRPE:
> >Unable to read output\n");
> >
> >
> >Is the part of the code that gives me this error, what does that
mean?
> >
> >I've created a test plugin with just an echo, and it runs fine. I can
> >paste my plugin as well if that would help, here is the command
listed
> >in nrpe.
> >
> >command[cycle_tomcat]=/usr/lib/nagios/plugins/cycle_tomcat
> >
> >
> >The Script accepts Okay, Critical, Unknown, etc. Where does the
command
> >get specified as needing arguments? Could that be the problem?
> >
> >Thanks.
> >
> >
> >
> >>I wrote an event handler in bash. It runs perfectly fine as the
nagios
> >>user on the machine.
> >>
> >>When I run it via check_nrpe -H hostname -c cycle_tomcat CRITICAL
SOFT
> >>
> >>
> >3
> >
> >
> >>I get NRPE: Unable to read output
> >>
> >>If I run it without the variables Critical, etc, I still get the
same
> >>error.
> >>
> >>I have googled for the error, although I believe it comes up in many
> >>different scenarios, and so far I have not gotten it.
> >>
> >>The plugin has permissions on it that are good. It's defined in
> >>nrpe.cfg. I am not sure what the problem is.
> >>
> >>Nathan Oyler
> >>Information Technology
> >>480-308-2342 Office
> >>
> >>Khimetrics Inc.
> >>Maximizing Sales & Profit
> >>Revenue Management from Khimetrics
> >>
> >>
> >>
> >
> >
> >
> >-------------------------------------------------------
> >The SF.Net email is sponsored by: Beat the post-holiday blues
> >Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> >It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> >_______________________________________________
> >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
> >
> >
> >
> 
> --
> Lewis Getschel             | Today is done...
> WesternGeco                |     Today was fun...
> 1625 Broadway              |         Tommorrow is another one.
> Denver, CO 80202           |
> Direct Phone - 303-389-4407|        -- Dr. Seuss --
> 




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
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