Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 -u
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 {
        service_description     HTTP-wiki
        check_command           check_http_url!

Any ideas?

share|improve this question
Found it .. simple typo - needs another $ in $HOSTADDRESS$ – Roy Mar 24 '13 at 15:03
up vote 1 down vote accepted

Try just this

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

If you need to put a host in use

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

Check to make sure you can resolve on the host also

share|improve this answer
Thanks, I didn't consider that way of doing it. Will it work with virtual hosts? – Roy Mar 24 '13 at 15:06
yes it will. That's the same setup i use to check vhosts – Mike Mar 24 '13 at 16:09
Lovely, I noticed this way http_check does a HTTP/1.1 request instead of HTTP/1.0. Much better this way, thanks again. – Roy Mar 24 '13 at 19:37
right cause in 1.1 the host header is needed.. 1.0 it isn't – Mike Mar 25 '13 at 3:35

Try to change the check_command in your commands.cfg with:

service {
        service_description     HTTP-wiki
        check_command           check_http_url!!

Check your files:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Restart nagios and check your nagios site.

share|improve this answer
I don't think this will work without changing the command definition, will it? Anyway, I found the typo in my configuration, it just needed an extra dollar sign in $HOSTADDRESS$ – Roy Mar 24 '13 at 17:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.