我创建了自己的命令来检查特定的 URL
define command{
command_name check_url
command_line /usr/lib/nagios/plugins/check_http -f follow -H '$HOSTNAME$' -I '$HOSTADDRESS$' -u '$ARG1$'
}
如果我从命令行运行我的命令,它可以工作:
/usr/lib/nagios/plugins/check_http -f follow -H www.example.com -u http://www.example.com/server-status
HTTP OK: HTTP/1.1 200 OK - 4826 bytes in 0.011 second response time |time=0.010625s;;;0.000000 size=4826B;;;0
但是当穿过 Icinga 时,我得到了
HTTP WARNING: HTTP/1.1 404 NOT FOUND - 314 bytes in 0.011 second response time