Please copy the text. Don't use screen shots. I cannot copy text segments from screenshots... And please don't use HTML either, because seriously, it's hard to copy a correct configuration from the HTMLized segments...

On 22.06.17 15:36, Umar Draz wrote:
Please check all screenshots here

https://www.umardraz.com/screen1.png

That's the host object. You need to post the service object generated as I wrote in my initial answer:

# icinga2 object list -n 'mysite!www.umardraz.com'

    > > > object Host "mysite" {
    > > >
    > > >    address = "173.212.216.101"
    > > >    check_command = "http"
    > > >    vars.http_vhosts["www.umardraz.com <http://www.umardraz.com>"] = {
    > > >
    > > >       http_uri = "/"
    > > >       http_ssl = "true"
    > > >
    > > >    }
    > > >
    > > > }
    > > >

Remove the check_command from the host definition. Import "generic-host" which uses the standard hostalive, i.e.

object Host "mysite" {
  import "generic-host"
  address = "173.212.216.101"
  vars.http_vhosts["www.umardraz.com"] = {
    http_uri = "/"
    http_ssl = "true"
  }
}

You don't want to use http for as check command for the host object. Whether the host is alive or not is usually not directly linked with a working HTTP call.

Together with this:

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

it should generate the service object for the check. Verify with the icinga2 object call above. It must be there.

-Gerald
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to