Failing to execute check_disk on NRPE client

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
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Failing to execute check_disk on NRPE client

Post by stecino »

Hi all

I am running this against on the Nagios server

[root@pbur2mon1 libexec]# ./check_nrpe -H 10.67.30.1 -c check_disk -a 10 20 /var
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

This is what I am seeing in the logs on the NRPE client

Aug 29 10:38:12 sbur2a1 nrpe[20991]: Error: Request contained command arguments!
Aug 29 10:38:12 sbur2a1 nrpe[20991]: Client request was invalid, bailing out...

This is what's in the nrpe.cfg

command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$

What am I doing wrong?

Thanks in advance
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: Failing to execute check_disk on NRPE client

Post by stecino »

I noticed that allow command arguments was set to 0, so I set it to 1
How can I tell if the client was compiled using command-arguments flag?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Failing to execute check_disk on NRPE client

Post by tmcdonald »

From the nrpe.cfg:

Code: Select all

# The following examples allow user-supplied arguments and can
# only be used if the NRPE daemon was compiled with support for
# command arguments *AND* the dont_blame_nrpe directive in this
# config file is set to '1'.  This poses a potential security risk, so
# make sure you read the SECURITY file before doing this.
Did you compile with support for commands and set dont_blame_nrpe to 1?

Edit: Replied right after your second post.

If you installed nrpe using yum or something, it doesn't have support for commands. You need to compile it from source as per this article:

http://www.thegeekstuff.com/2010/12/ena ... arguments/
Former Nagios employee
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: Failing to execute check_disk on NRPE client

Post by stecino »

Client was already there, nrpe conf didn't have the don't_blame_nrpe set to 1, so I set it.
After that I am still getting the same error when executing the remote command.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Failing to execute check_disk on NRPE client

Post by tmcdonald »

NRPE will need to be uninstalled and re-compiled from source with --enable-command-args according to the doc I posted. It was likely installed with yum, so try "yum remove nrpe" to uninstall.
Former Nagios employee
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: Failing to execute check_disk on NRPE client

Post by stecino »

Thanks, that did the trick :)

[root@pbur2mon1 libexec]# ./check_nrpe -H 10.67.30.1 -c check_disk -a 10 20 '/var /'
DISK OK - free space: /var 9106 MB (96% inode=99%); / 5357 MB (56% inode=94%);| /var=300MB;9909;9899;0;9919 /=4049MB;9909;9899;0;9919
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Failing to execute check_disk on NRPE client

Post by tmcdonald »

Half hour to resolve, not bad ;)

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked