Page 1 of 1

nrpe and check_disk - specify filesystem

Posted: Mon Dec 08, 2014 2:55 pm
by danoreilly
I'm attempting to use the check_disk function via nrpe. My service definition is:


define service{
use generic-service
hostgroup_name cloud_hosts
service_description tmp Partition
check_command check_nrpe!check_disk!20%!10%!tmp!/
}

my npre.cfg file on my remote node is:

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

It appears that the 3rd argument isn't being passed, as the utilization is always the same for all filesystems I'm looking at, even though they're actually on separate logical volumes (RHEL 6.6, by the way). I suspect it may have something to do with the way it's being passed. Specifically, how do I specify a real filesystem for arg3 for the -p argument to check_disk?

I've tried check_nrpe!check_disk!20%!10%!tmp!/ and that doesn't work. I've tried check_nrpe!check_disk!20%!10%!"/tmp"!/ and that doesn't work. What's the solution here????

Re: nrpe and check_disk - specify filesystem

Posted: Mon Dec 08, 2014 6:08 pm
by lgroschen
did you set dont_blame_nrpe=1?

Code: Select all

# COMMAND ARGUMENT PROCESSING
# This option determines whether or not the NRPE daemon will allow clients
# to specify arguments to commands that are executed.  This option only works
# if the daemon was configured with the --enable-command-args configure script
# option.
#
# *** ENABLING THIS OPTION IS A SECURITY RISK! ***
# Read the SECURITY file for information on some of the security implications
# of enabling this variable.
#
# Values: 0=do not allow arguments, 1=allow command arguments

dont_blame_nrpe=1
Also, when you send your $ARG3$ you shouldn't have to add a '/' in front of it since you can pass the folder as part of check_nrpe -a [arglist], so for your check it would be something like:

Code: Select all

./check_nrpe -H 192.168.4.35 -c check_disk -a 20 10 /tmp