0

I'm setting up Icinga for the first time.

I'd like to monitor websites, not their hosts (i.e. no ping, only http).

I've created a template like this:

template Host "generic-website" {
    check_command = "http"
}


apply Service "http" {
  import "generic-website"

  check_command = "http"

  assign where host.vars.http_address
}

but my "hosts" always show up even with a bogus address.

What is the proper way to check for http?

Thanks in advance

greg
  • 171
  • 11
  • You'd probably need to define more custom attributes required by the 'http' CheckCommand as command parameters. Please add more details on the actual host object involved. – dnsmichi Oct 17 '15 at 16:36

1 Answers1

1

You can define a command like this:

# 'check_http' command definition
define command{
command_name    check_http
command_line    $USER1$/check_http -H $HOSTADDRESS$
}

And then calling this command as:

define service{
use                             genericservice
hostgroup_name                  hostgroup
service_description             Web Servers public site
notes                           www site check
check_command                   check_http
}
serverstackqns
  • 722
  • 2
  • 16
  • 39