Remote disk check not working
Remote disk check not working
I want to get remote disk checks going. After much trial and error, I can finally use check_nrpe on the Nagios server to get values. But when I configure Nagios to watch this, I get (null)
I'm guessing this is part of having to use '-a' on the command line. I have no idea how I'm supposed to pass that along in the Nagios config, or why I'd need to... every step along the way, critical functionality (like "dont_blame_nagios") is not set up to begin with, and the only way to find out is by Googling error after error. I haven't been able to find any documentation that spells out all of the steps needed to do this... every example might tell you to do one thing, but assumes you already know all the rest.
I'm guessing this is part of having to use '-a' on the command line. I have no idea how I'm supposed to pass that along in the Nagios config, or why I'd need to... every step along the way, critical functionality (like "dont_blame_nagios") is not set up to begin with, and the only way to find out is by Googling error after error. I haven't been able to find any documentation that spells out all of the steps needed to do this... every example might tell you to do one thing, but assumes you already know all the rest.
Re: Remote disk check not working
Example:
On the remote machine:
Test check run from the command line on the nagios server:
Hope this helps.
On the remote machine:
Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
Code: Select all
[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_disk -a '-w 10% -c 5% -p /'
DISK OK - free space: / 2821 MB (29% inode=69%);| /=6692MB;8650;9131;0;9612
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Remote disk check not working
Then why is the default in nrpe.cfg:lmiltchev wrote:Example:
On the remote machine:Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
In any case, that didn't help, the service status is complaining about "check_disk: Could not parse arguments" and gives usage.
That part works perfectly. But there's that '-a'... and I do not see a '-a' in any config or in any example of any config.Test check run from the command line on the nagios server:Code: Select all
[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_disk -a '-w 10% -c 5% -p /' DISK OK - free space: / 2821 MB (29% inode=69%);| /=6692MB;8650;9131;0;9612
Re: Remote disk check not working
With debugging turned up to 2048, I can see that nagios builds the command to:
It doesn't add the -w, -c, or -p parts. In my service definition, I have:
Code: Select all
/usr/lib64/nagios/plugins/check_nrpe -H 192.168.2.20 -c check_disk
Code: Select all
check_nrpe!check_disk!20%!10%!/
Re: Remote disk check not working
Please post your command definition for check_nrpe in your /usr/local/nagios/etc/commands.cfg.
Re: Remote disk check not working
ssax wrote:Please post your command definition for check_nrpe in your /usr/local/nagios/etc/commands.cfg.
Code: Select all
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Re: Remote disk check not working
With the way your check is defined, you should have this:
Code: Select all
$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$ $ARG3$
Re: Remote disk check not working
Wait.. sorry.. use this:
And then you would use this in the nrpe.cfg:
Code: Select all
$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a '-w $ARG2$ -c $ARG3$ -p $ARG4$'
Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
Re: Remote disk check not working
There we go!ssax wrote:Wait.. sorry.. use this:
And then you would use this in the nrpe.cfg:Code: Select all
$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a '-w $ARG2$ -c $ARG3$ -p $ARG4$'
Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
So, clearly, this shouldn't be 'check_nrpe', but 'check_nrpe_disks' or something.
Re: Remote disk check not working
Nice! Did that get it working for you on your system? Just trying to figure out if we can mark this as resolved.
Former Nagios Employee