check_disk not working

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.
froometgn
Posts: 10
Joined: Fri Aug 25, 2017 1:41 am

Re: check_disk not working

Post by froometgn »

tgriep wrote:The valid nrpe config file is this file /usr/local/nagios/etc/nrpe.cfg .

If you want to use arguments in your commands, you have to edit the commands so they will use the arguments that the Nagios server will pass to the NRPE Agent.

To do that, edit /usr/local/nagios/etc/nrpe.cfg file on the remote server and change the command from

Code: Select all

command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda5
to

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
Save the file and restart the nrpe agent.

Without knowing exactly how you defined the check_nrpe command on the Nagios Server, you would have to change your command from

Code: Select all

check_command check_nrpe!check_disk!10%5% -p /dev/sda5
to

Code: Select all

check_command check_nrpe!check_disk!10% 5% /dev/sda5
Save the file and restart nagios and see if the check returns the correct information for the /dev/sda5 partition.
I did that you requested and I'm getting argument, as you can see below

Image

I looked for nrpe.cfg on nagios server but I only find nrpe.cfg on the following location:

/etc/nagios/nrpe.cfg

with the following content about commands

command[check_users]=/usr/lib64/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib64/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 150 -c 200

Thanks again for your help

Best regards
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_disk not working

Post by tgriep »

Can you run the following commands on the remote server and post the output so we can find the nrpe.cfg file that is in use?

Code: Select all

netstat -anp |grep 5666
ps -ef |grep nrpe
find / -name nrpe.cfg
Also, can you post how the check_nrpe command is defined on the Nagios server?
It is typically defined in the commands.cfg file.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked