【发布时间】:2015-09-08 18:44:09
【问题描述】:
我的主机定义中定义了以下服务:
define service {
use generic-service
host_name myhost.com
service_description swapcheck
check_command check_ssh_swap
}
以及 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%"
}
两个 cfg 文件都会在加载时加载到 nagios 中。并且 nagios -v /etc/nagios/nagios.cfg 不会返回任何错误。
当我尝试执行命令时
/home/nagios/bin/check_by_ssh -p port -H ip -C "/home/nagios/bin/check_swap -w 20% -c 5%"
直接使用 nagios 用户,它可以正常工作,并且我会返回我的结果,但是当 nagios 本身运行计划检查时,我总是会得到
Return code of 126 for check of host 'host' was out of bounds
我在这里缺少什么?明明所有的路径、键等都是正确的,不然我手动执行就没有问题了。
【问题讨论】: