我正在尝试http_check
使用 -u 参数配置来检查特定的 URL,但尽管这在命令行中运行良好,但 nagios 检查仅返回Temporary failure in name resolution
# /usr/lib/nagios/plugins/check_http -H 176.67.169.157 -u http://dolicapax.org/
HTTP OK: HTTP/1.1 200 OK - 10960 bytes in 0.360 second response time |time=0.359959s;;;0.000000 size=10960B;;;0
以下是命令和服务定义
# 'check_http_url' command definition
define command{
command_name check_http_url
command_line /usr/lib/nagios/plugins/check_http -I '$HOSTADDRESS' -u '$ARG1$'
}
define service {
host_name frank.olsenit.no
service_description HTTP-wiki
check_command check_http_url!http://dolicapax.org/
...
}
有任何想法吗?
答案1
试试这个
/usr/lib/nagios/plugins/check_http -H 176.67.169.157 -u /
如果你需要使用主机
/usr/lib/nagios/plugins/check_http -H dolicapax.org -I 176.67.169.157 -u /
检查以确保您也可以在主机上解析
nslookup dolicapax.org
答案2
尝试使用以下命令更改check_command
你的commands.cfg:
service {
host_name frank.olsenit.no
service_description HTTP-wiki
check_command check_http_url!176.67.169.157!http://dolicapax.org/
}
检查你的文件:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
重新启动 nagios 并检查您的 nagios 站点。