Hi,

I have apply rules for services based on the following config:

  if(typeof(realm[key].home_servers) == Array) {
    apply Service "COMPROMISED-USERS-" + key use(realm, key) {
      import "compromised users template"
      groups = [ "COMPROMISED-USERS" ]
      enable_notifications = false
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#compromised-users";
      assign where host.name == realm[key].home_servers[0]
    }
  }

  if(typeof(realm[key].home_servers) != Array) {
    apply Service "COMPROMISED-USERS-" + key use(realm, key) {
      import "compromised users template"
      groups = [ "COMPROMISED-USERS" ]
      enable_notifications = false
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#compromised-users";
      assign where host.name == realm[key].home_servers
    }
  }

The config is fine, the only problem is that i want to limit both apply rules by some custom host property. When I do that, the services are assigned just fine to the correct hosts, but the problem is that there are configurations warning for those apply rules which do not match any hosts. In my deployment log i get:

[2019-03-14 15:17:23 +0100] warning/ApplyRule: Apply rule 'COMPROMISED-USERS-realm.cz' (in [stage]/zones.d/director-global/config.conf: 43:5-43:60) for type 'Service' does not match anywhere!

The config I'm actually using to limit rules only for specific hosts:

if(typeof(realm[key].home_servers) == Array) {
  apply Service "COMPROMISED-USERS-" + key use(realm, key) {
    import "compromised users template"
    groups = [ "COMPROMISED-USERS" ]
    enable_notifications = false
vars.doc_url = "https://www.eduroam.cz/cs/spravce/monitoring/end2end_monitoring_new#compromised-users";
    assign where host.name == realm[key].home_servers[0]
    ignore where host.vars.type == "SP"
  }
}

Can i somehow prevent deplyoment log warnings for these specific rules? Is there some configuration for that?

cheers,
Vaclav
--
Václav Mach
tel: +420 234 680 206
CESNET, z.s.p.o.
www.cesnet.cz

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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

Reply via email to