I just built Nagios from the FreeBSD ports and the plugins seem broken.
I can run plugins from the comand line fine but with in nagios it never works.
Here is the log output
Attempting to execute the command “/usr/local/libexec/nagios/check_ping -H 192.168.0.1 -w 3000.0,80% -c 5000.0,100% -p 1” resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists…
And here is the results from the Comnad line?
/usr/local/libexec/nagios/check_ping -H 192.168.0.1 -w 3000.0,80% -c 5000.0,100% -p 1
PING OK - Packet loss = 0%, RTA = 0.43 ms
So the command is making it to nagios corectly just seems like nagios it not reading the results.
No, the problem is that nagios is attempting to run the command named this:
"/usr/local/libexec/nagios/check_ping -H 192.168.0.1 -w 3000.0,80% -c 5000.0,100% -p 1"
There is no such command defined in your config files.
You see, you need to read the docs, and look over the sample config files, to understand how nagios runs commands.
In a nutshell it’s kinda like this.
I define a command in checkcommands.cfg like this.
define command{
command_name check_local_disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}
I then define $USER1$ like this in resource.cfg:
$USER1$=/usr/local/nagios/libexec
I then place the check_disk plugin file into that directory, /usr/local/nagios/libexec
I then define a service in services.cfg to use the above command like this:
define service{
use test ; Name of service template to use
host_name Test
service_description free-Disk-Space
check_command check_local_disk!10%!5%!/boot
contact_groups test
servicegroups free-Disk-Space
}
Now, compare the above to what you have configured. I bet you have a service in services.cfg defined like this:
define service{
use test ; Name of service template to use
host_name Test
service_description ping
check_command /usr/local/libexec/nagios/check_ping -H 192.168.0.1 -w 3000.0,80% -c 5000.0,100% -p 1
contact_groups test
servicegroups ping
}
That isn’t even close to how you are to define a service. Read the docs and sample config files.