I’m attempting to use apply rules to cover endpoints that have similar attributes, such as disks.
In my master zone, I have an endpoint configured like this:
object Host NodeName {
import "generic-hostalive-5min"
address = "127.0.0.1"
vars.os = "Linux"
vars.disks["disk"] = {
**}**
vars.disks["disk /"] = {
disk_partitions = "/"
}
If I attempt to use this for an endpoint in the satellite zone, I get errors because of the duplicate NodeName. In the satellite zone, using this as an endpoint config does not work with the above in the master zone.
object Host NodeName {
import "generic-hostalive-5min"
address = "128.0.0.2"
vars.os = "Linux"
vars.disks["disk"] = {
}
vars.disks["disk /"] = {
disk_partitions = "/"
}
}
The goal is to have apply something like this in the global config, which does work with a single host with the host name NodeName:
apply Service for (disk => config in host.vars.disks){
import "generic-service"
check_command = "disk"
vars += config
assign where host.name == NodeName && host.vars.os == "Linux"
}
Am I mis-understanding the use of constants defined on the endpoints?