[Nagiosplug-help] Problem with check_http within nagios

Jonathan Angliss jon at netdork.net
Sat May 21 04:00:20 CEST 2011


On 05/18/11 18:06, DeBattista, Joe wrote:
> Hi,
>       I'm trying to use check_http from within nagios, and I keep getting a status UNKNOWN with "no output returned from plugin".  When I run the commands from the command line on both the client and the nagios server, I seem to get the right output, but not from within nagios itself.
> I'm using nagios version 3.0.6 on a RedhHat Linux server, with the check_http from nagios-plugins version 1.4.13. My nagios client is named cenn, and the nagios server is vx8.
>
> When I issue the check_nrpe command from vx8, I get the following:
> /usr/local/nagios/libexec/check_nrpe -H cenn -c check_http
> HTTP OK HTTP/1.1 200 OK - 308 bytes in 0.001 seconds |time=0.000777s;5.000000;10.000000;0.000000 size=308B;;;0
>
>> From the client, cenn, the command also seems to run ok.
> /usr/local/nagios/libexec/check_http -H 127.0.0.1 -w 5 -c 10
> HTTP OK HTTP/1.1 200 OK - 308 bytes in 0.001 seconds |time=0.000797s;5.000000;10.000000;0.000000 size=308B;;;0
>
>
> Here's my entries:
> On the nagios server, in the  checkcommands.cfg I have
> # 'check_http' command definition
> define command{
>          command_name    check_http
>          command_line    $USER1$/check_http -H $HOSTADDRESS$
>
> I've defined the service in minimal.cfg to check the server, cenn's http process as
> define service{
>          use                             generic-service         ; Name of service template to use
>          host_name                       cenn
>          service_description             Process httpd: Check Access
>          is_volatile                     0
>          check_period                    24x7
>          max_check_attempts              10
>          normal_check_interval           5
>          retry_check_interval            2
>          contact_groups                  admins
>          notification_options            u,c,r
>          notification_interval           960
>          notification_period             24x7
>          check_command                   check_nrpe!check_http
>          }
>
> On my client, cenn, I defined an entry in nrpe.cfg
> command[check_http]=/usr/local/nagios/libexec/check_http -H 127.0.0.1 -w 5 -c 10
>
>
> Any ideas?

Quite often, a packaged install of Nagios plugins will cause this kind 
of behavior because of the check_command you're using.  How is your 
define command{} look for check_nrpe on vx8?

With the way you're calling it in your service, you should have it look 
like this:

define command {
	command_line	$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
	command_name	check_nrpe
}

However, some package systems define check_nrpe like this:

	command_line	$USER1$/check_nrpe -H $HOSTADDRESS$ \
				-c $ARG1$ -a $ARG2

Wrapped at \, so it should be on a single line.  This definition would 
result in an error and get similar output to what you're seeing above.

-- 
Jonathan Angliss





More information about the Help mailing list