Error when using check_disk on local machine

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
mlecours
Posts: 4
Joined: Thu Feb 16, 2017 2:48 pm

Error when using check_disk on local machine

Post by mlecours »

I've configured Nagios to check the it's local disk space as follows:
define service{
host_name nagios
service_description disk available
check_command check_local_disk!'20%'!10%'!'/'
servicegroups nagiosservices
check_interval 10
check_period 24x7
retry_interval 3
max_check_attempts 3
notification_interval 30
notification_period 24x7
notification_options w,c,u,r
contact_groups admins
}

I receive the error (No output on stdout) stderr: /bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file

I have debugging set to all and all that is logged is the same error.

If I run the check from the command line as check_disk -w '20%' -c '10' -p '/' I get the expected response of DISK OK - free space: / 30403 MB (79% inode=99%);| /=7941MB;30676;38335;0;38345

I've set SELinux to permissive, no change. I've created my own command definition to by-pass the default.cfg and got the same error.

Any ideas anyone?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Error when using check_disk on local machine

Post by mcapra »

Your check_command directive is malformed:

Code: Select all

check_command check_local_disk!'20%'!10%'!'/'
Specifically, you're missing a single quote for the start of the highlighted argument:

check_command check_local_disk!'20%'!10%'!'/'

See if adding a single-quote to correctly wrap the 10% fixes the issue.
Former Nagios employee
https://www.mcapra.com/
Locked