[icinga-users] Separate services or separate http_vhosts?

Stephane Bortzmeyer stephane at sources.org
Sat Jan 21 22:25:42 CET 2017


I'm still overwhelmed by the amount of possibilities in Icinga2
configuration language.

I want to monitor two things on the same HTTP vhost, the main page and
the search engine. Should I use two http_vhosts in the same service:

apply Service "web" {

  check_command = "http"

  vars.http_vhosts["main"] = {
    http_uri = "/"
  }

  vars.http_vhosts["search"] = {
    http_uri = "/search?pattern=foobar"
  }

  assign where (host.address || host.address6) && host.vars.web == 1

 }

Or two services:

apply Service "web-main" {

  check_command = "http"

  vars.http_vhosts["main"] = {
    http_uri = "/"
  }

  assign where (host.address || host.address6) && host.vars.web == 1

}

apply Service "web-search" {

  check_command = "http"

  vars.http_vhosts["search"] = {
    http_uri = "/search?pattern=foobar"
  }

  assign where (host.address || host.address6) && host.vars.web == 1

 }

What are the consequences of this choice? Is there a recommended way?
It is not clear for me from the documentation.


More information about the icinga-users mailing list