# Http monitoring not working

**URL:** <https://community.icinga.com/t/http-monitoring-not-working/5091>\
**Category:** Service Monitoring\
**Tags:** check\_http\
**Created:** [July 25, 2020, 11:33pm UTC](https://community.icinga.com/t/http-monitoring-not-working/5091 "2020-07-25T23:33:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronanlucio](https://community.icinga.com/letter_avatar_proxy/v4/letter/r/b4bc9f/32.png) [@ronanlucio](https://community.icinga.com/u/ronanlucio)\
**Post date:** [July 25, 2020, 11:33pm UTC](https://community.icinga.com/t/http-monitoring-not-working/5091/1 "2020-07-25T23:33:18Z")

</div>

Hi,  
I’m trying to configure an http check for some websites on external hosts, but it always answers “Name or service not know”

![image](https://community.icinga.com/uploads/default/original/2X/1/16020486d544828e6aed90f4850410605cc30f43.png)

My configuration is:

```
object Host "mydomain.com" {
  check_command = "check_domain_expiration"

  // check_http
  vars.http_vhosts["http"] = {
    http_vhost = "my domain.com"
    http_uri = "/"
  }

  // check_domain_expiration
  vars.domain_check = name
}

apply Service for (http_vhost => config in host.vars.http_vhosts) {
  import "generic-service"
  check_command = "http"

  vars += config

  //assign where host.vars.http_vhosts
}

// Domain Expiration Check
apply Service "Domain Expiration" {
  check_command = "check_domain_expiration"
  assign where host.vars.domain_check
}

```

If I execute check\_http via command-line it works fine:

check\_http -H [mydomain.com](http://mydomain.com) -u “/”  
HTTP OK: HTTP/1.1 301 Moved Permanently - 352 bytes in 0.022 second response time |time=0.021921s;;;0.000000;10.000000 size=352B;;;0

check\_domain\_expiration works fine

Any help would be appreciated

---

<div class="post-metadata">

**Author:** ![ronanlucio](https://community.icinga.com/letter_avatar_proxy/v4/letter/r/b4bc9f/32.png) [@ronanlucio](https://community.icinga.com/u/ronanlucio)\
**Post date:** [July 26, 2020, 12:32am UTC](https://community.icinga.com/t/http-monitoring-not-working/5091/2 "2020-07-26T00:32:38Z")

</div>

OK, it’s working now. I just added “http\_address = mydomain”

```
object Host "mydomain.com" {
  check_command = "check_domain_expiration"

  // check_http
  vars.http_vhosts["http"] = {
    http_address = "mydomain.com"
    http_vhost = "mydomain.com"
    http_uri = "/"
  }
  vars.http_vhosts["www"] = {
    http_address = "www.mydomain.com"
    http_vhost = "www.mydomain.com"
    http_uri = "/"
  }

  // check_domain_expiration
  vars.domain_check = name
}
```
