Nagios http url check fails with “Temporary failure in name resolution”

nagios

I'm trying to configure a http_check using the -u parameter to check a specific URL, but while this works fine from the command line, the nagios check only returns 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

Here's the command and service definitions

# '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/
        ...
}

Any ideas?

Best Answer

Try just this

/usr/lib/nagios/plugins/check_http -H 176.67.169.157 -u /

If you need to put a host in use

/usr/lib/nagios/plugins/check_http -H dolicapax.org -I 176.67.169.157 -u /

Check to make sure you can resolve on the host also

nslookup dolicapax.org