How to monitor multiple endpoints or services on a single host

Hi all

How to monitor multiple endpoints or services on a single host. For instance I want to monitor the below services.

http://domainname/ServiceName1.svc
http://domainname/ServiceName2svc

Use the http check from ITL with 2 or more defined services depending how much urls you want to monitor.

Thanks Carsten
however it doesn’t seem to work see my host file below. Only ServiceName2 gets pickedup and ServiceName1 does not appear anywhere in the monitor.
object Host “My host” {
address = “domainname”
display_name = “Monitor Service”
vars.hostgroup = “My Service group”
check_command = “http”
vars.http_vhosts[“domainname”] = {
http_uri = “http://domainname/ServiceName1.svc
vars.http_vhosts[“domainname”] = {
http_uri = “http://domainname/ServiceName2.svc

First use code blocks please.

you host should not use http as host check. do normal hostalive. Second you overwrite your dictionaries if you give them the same names. Use different names

vars.http_vhosts["ServiceName1"] = {
    http_uri = "http://domainname/ServiceName1.svc"
}
vars.http_vhosts["ServiceName2"] = {
    http_uri = "http://domainname/ServiceName2.svc"
}

And add a apply rules which uses the dictionaries, i think there is a apply rule under /etc/icinga2/conf.d which you can use as example.

2 Likes

Thanks Carsten that worked perfectly. :slight_smile: