Hello!
I’m not really getting what you are trying to achive.
Are the hosts with the variable already active in the monitoring and you (don’t) want to apply a service to them?
In this case simply point the apply rule to all hosts where “host.vars.check_x509_certificates is true (or set)”
Or do the hosts exist in an import source, from which you create new services for them?
If so, create a new modifier in the import source that rejects the row ifthe variable is false
If neither is the case, please clear the situation up with some examples
If you used the import source “Director Hosts”, as I described in my last post to your other question, then you should be able to read this variable in the x509 service import and discard the rows with check_x509_certificates = false. In the same way the rows without a matching host got discarded.
Use the preview in the “Director Hosts” import source to understand the data structure to get at the variable from the x509 service import.
An alternative would be the regex filters in my import but I should replace those with your idea, so my users can manage this variable on their hosts and don’t need me for this.