Monitoring Web Sites/Services with Icinga

Hello,

We are trying to organize our sites monitoring using Icinga. Basically, we just want to check if site is accessible and respond with required status code. Web Sites/Services can be on different ports and have different paths.
Unlike the hosts, they does not have Icinga agent installed and we can’t use any check for them.

We did:

  1. Service Template - Web Service
    template Service "Web Service" {
        import "HTTP check"
    }
    
  2. Host Template - Web Service
    template Host "Web Service" {
        check_command = "dummy"
        groups = [ "Web Service" ]
    }
    
  3. Added a Service to the Host Template using Service Template
    apply Service "Web Service" {
        import "Web Service"
    
        assign where "Web Service" in host.templates
    
        import DirectorOverrideTemplate
    }
    

We have the following questions/issue here:

  1. Is the dummy command a correct way to monitor Web Sites or there is a way to add hosts without check command?

  2. Is there a way to specify HTTP protocol 1.1 and 2.0 using regexp for the HTTP Status?
    HTTP/1.1 200 OK,HTTP/2.0 200 OKHTTP/* 200 OK

  3. Right now, this solution is not extendable because we can’t override variables like http_port, http_uri - we get the following message:

    This service has been inherited from Web Service. Still, you might want to change the following properties for this host only.

    We found only some old issues on GitHub relaled to this:
    Can no longer edit Custom Properties on Inherited Service #1602
    Override of custom vars on applied servies for a single host is not possible #1575
    Not able to change service properties (newly created services only) #1193

    Is there a way to apply globally to all Sites the same Service and then override some variables like http_port, http_uri for it?

Thank you!

Hi,
the check http will be your friend :wink:
Depending which arguments you will take for your requirement, you will get the results you want. So you can check for a string, performance data, certificates, etc. etc.

1 Like

@stevie-sy, thank you for reply!

Should we use ‘http’ command for Host Template or Service Template?

both is possible. We for example use http check in service definition and apply them to a (dummy) host.

It means that ‘dummy’ is the right check for the host when we use Service Templates - one thing solved, thanks!

Also, I tried solution you proposed for the Host Template - http. It have some limitations - we can’t, for example, check endpoint and certificate at the same time because certificate check disable host endpoint check. In such a case Host with attached Services Template will be more suitable.

One thing here - how can we have one Host Template with attached Service Templates where we then can override HTTP Check parameters, also it is preferably to define them at Host and not on the Service.

yes. And as IP e.g. 127.0.0.1 so this one is always up.

If you create a dummy host, you can assign as many services with http checks as you will. That means it is no problem to create one http-check to check if the website is online, one check if the correct page is loaded (searching for a keyword) and one http check to check the cert, etc.

Use ServiceSets in the director. Here exists a override function

We already use ServiceSets for the Icinga Agents and noted same limitations as I was mentioned above:
Service

This service has been inherited from Web Service. Still, you might want to change the following properties for this host only.

Service Set

This service belongs to the Web Service Service Set. Still, you might want to override the following properties for this host only.

I can’t see any override Windows or anything else - just a Blacklist button.

You have to do this through the host in Icingaweb2.You search for the service. Under the menue “actions” there as a link “modify”. Values you can overwrite will be suggested