Send notifications while host is down or unreachable

Icinga 2 implicitly suppresses notifications for hosts that are DOWN or Unreachable
I am trying to overwrite this and enable notifications regardless of host status
Now if I understand correctly this should be done through creating a dependency for the service I need on it’s host and setting

disable_notifications = false

I tried setting it like this, but the notifications still aren’t being sent

The dependency I created:

apply Dependency “enable-notifications” to Service {

import “template1

parent_host_name = host.vars.parent_host_name

disable_notifications = false

period = “always”

assign where service.name == “websever-remote-check” && typeof(host.vars.parent_host_name) == String

states = [ Critical ]

}

apply Dependency “enable-notifications” for (host_parent_name in host.vars.parent_host_name) to Service {

import “template1

parent_host_name = host_parent_name

disable_notifications = false

period = “always”

assign where service.name == “websever-remote-check” && typeof(host.vars.parent_host_name) == Array

states = [ Critical ]

}

Would anyone be so kind and give me some advice on what am I doing wrong?

Hello and welcome :slight_smile:

Not sure if, but it might be that the == operator in assignments only works for strings.

You could try typeof(a).name == "String"

 a = "test"
 typeof(a) == String
true
typeof(a) == "String"
false
typeof(a).name == "String"
true