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.
...However, that does not explain why it works when I comment out the new definitions.
If you're commenting out a line that has a non-printable character in it, then that does explain it.
Oh, sorry, I should have been clear. I comment out the new definition, which is at the bottom. when I try and restart the deamon it complains about line 1. which is far from the bottom.
I have the following, but I want to be sure its correct:
Nope. You can't have a "command_line" in a service check.
The service check definition uses "check_command" to specify the command and arguments.
"check_command" is defined in commands.cfg
The commands.cfg has a list of what FILE to execute when the COMMAND is given, and passes the ARGUMENTS to it.
You have no closing "}" for the second definition.
You use "command_name" in the last definition - should be "check_command"
In the same one, "check_disk!/" is not a valid check_command. I assume it should be "check_local_disk" if it's the machine that's running Nagios, or else you'll need to use an NRPE command here.
Fixing these got it to parse properly on my server.
You have no closing "}" for the second definition.
You use "command_name" in the last definition - should be "check_command"
In the same one, "check_disk!/" is not a valid check_command. I assume it should be "check_local_disk" if it's the machine that's running Nagios, or else you'll need to use an NRPE command here.
Fixing these got it to parse properly on my server.
Hi
The missing brackets } are do to some commands that i ran earlier from this forum.
I think we may be one to something with the nrpe commands. by chance do you know the nrpe command for checking disk?
I tried finding it but I have not had any luck.
To get NRPE working to check disks on a remote host, you need to edit "/usr/local/nagios/etc/nrpe/common.cfg" to make sure that this line is in there somewhere:
Then you can make a service check that uses check_nrpe command on the Nagios host to use NRPE to execute the check_disk command on the remote host with the appropriate parameters:
define service{
use nrpe-service
service_description Root Partition
hostgroups private
servicegroups System
check_command check_nrpe!check_disk!-w 20% -c 10% -p /
}
(Note that we use hostgroups to specify what services should be checked on each machine. Use an appropriate "host_name XXX" command for your configuration.)