I have the following service defined in my host definition:
define service {
use generic-service
host_name myhost.com
service_description swapcheck
check_command check_ssh_swap
}
and the following in the commands.cfg:
define command {
command_name check_ssh_swap
command_line /home/nagios/bin/check_by_ssh -p port -H ip -C "/home/nagios/bin/check_swap -w 20% -c 5%"
}
both cfg files are loaded into nagios on load. And nagios -v /etc/nagios/nagios.cfg does not give back any errors.
When i try to execute the command
/home/nagios/bin/check_by_ssh -p port -H ip -C "/home/nagios/bin/check_swap -w 20% -c 5%"
with the nagios user directly, it works without problems, and I get my results back, but when nagios itself runs a scheduled check I always get
Return code of 126 for check of host 'host' was out of bounds
What am I missing here? Obviously all the paths, the keys, etc. are correct, otherwise I wouldnt be able to execute it manually without any problems.