check_command failing

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nequid
Posts: 2
Joined: Thu Feb 14, 2013 1:59 pm

check_command failing

Post by nequid »

Hi all I have this weird problem:

Nagios server: stageutil03
NRPE: testapp01

On nagios server end:

in /usr/local/nagios/etc/objects/_applayer.cfg

define service{
use generic-service
host_name testapp01
service_description App_site_8080
check_command check_http!2!4!/!8080
notifications_enabled 1
}

check_command defined in this service definition as I get Connection Refused on Nagios Core interface.
But when I run this command instead, I get response back
[root@stageutil03 libexec]# ./check_http testapp01 -w 2 -c 4 -u / -p 8080
HTTP OK: HTTP/1.1 200 OK - 169891 bytes in 0.236 second response time |time=0.236184s;2.000000;4.000000;0.000000 size=169891B;;;0

Connectivity from nagios server to nrpe client is there

[root@stageutil03 libexec]# telnet testapp01 8080
Trying 10.198.192.14...
Connected to testapp01.
Escape character is '^]'.

On NRPE client:

[root@testapp01 libexec]# ./check_nrpe -H localhost
NRPE v2.12

[root@testapp01 libexec]# netstat -na | grep 5666
*.5666 *.* 0 0 49152 0 LISTEN

nrpe.cfg allows the proper IP, /etc/hosts.allow is setup

Anything else I do fix this? Maybe it's unable to parse check_command properly?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_command failing

Post by slansing »

Are you trying to run check_http to an IP? Or are you trying to run a NRPE plugin. Check_http has nothing to do with NRPE as it is it's own stand alone plugin. Check_nrpe is used to execute plugins remotely from the Nagios server to a remote host. If you are indeed trying to execute a NRPE plugin can you provide an example of the command you are running? Also, you need to run check_nrpe to the remote host not localhost to make sure that it can connect. When you run it from the localhost you are only testing to see that it is running locally.
nequid
Posts: 2
Joined: Thu Feb 14, 2013 1:59 pm

Re: check_command failing

Post by nequid »

Turns out I was missing this in commands.cfg

# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -u $ARG3$ -p $ARG4$
}

I added this and it can now properly parse check_command parameters
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_command failing

Post by abrist »

Great. Any time you add a new plugin, you will have to create a command for it.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked