As per the documentation, i have seen notification delay/escalation
notification syntax as shown below.
apply Notification "mail" to Service {
import "generic-notification"
command = "mail-notification"
users = [ "icingaadmin" ]
interval = 5m
times.begin = 15m
assign where service.name == "ping4"
}
So, the above is applying a Notification to a Service check, where the service
name is “ping4”. It means you’ll get notified about “ping4” check results.
If we have apply service block as below how to define the assign block? is
it something like assign where service.name == “service_win_service”?
That seems unlikely to me, although it could help if you describe quite what
it is you’re trying to achieve.
apply Service for (service_win_service => config in
host.vars.win_services) {
import “generic-service”
check_command = “service-windows”
enable_notifications = false
vars += config
command_endpoint = host.vars.client_endpoint
assign where host.vars.client_endpoint
}
What are you doing with the content of “service_win_service”?
Presumably it’s used by the check command “service-windows” somehow? (Maybe
it would be useful to post the contents of that check command here).
I think it’s more likely you want to say
assign where host.vars.win_services
but more detail from your side regarding what this variable contains and what
that means would be instructive.
As host.vars.win_services most likely is an array containing different service names I also could imagine that something like assign where host.vars.win_services in [ "thisservice" ] will work, if you only want to pin it to single services.
Or assign where host.vars.win_services in [ "thisservice", "thatservice" ] for multiple services