Notification for one server and one service is not working

Hello everybody,

found a new problem. I have two server with the same settings (only difference is the hostname and the ip). I will call them server1 and server2. Server1 is the one which works, server2 is the one which not works.

For only one service of one of them there are no notifications.

Log of server1 sending a notification:

[2020-04-17 09:13:27 +0200] information/ExternalCommandListener: Executing external command: [1587107607] SEND_CUSTOM_SVC_NOTIFICATION;server1;swap;0;user1;test notification
[2020-04-17 09:13:27 +0200] information/Checkable: Checkable 'server1!swap' has 1 notification(s). Checking filters for type 'Custom', sends will be logged.
[2020-04-17 09:13:27 +0200] information/Notification: Sending 'Custom' notification 'server1!swap!Stab2B-Mail-Service-Notification' for user 'Stab2B'
[2020-04-17 09:13:27 +0200] information/Notification: Completed sending 'Custom' notification 'server1!swap!Stab2B-Mail-Service-Notification' for checkable 'server1!swap' and user 'Stab2B' using command 'e-mail-service-notification'.

Log of server2 not sending notifications:

[2020-04-17 09:16:59 +0200] information/ExternalCommandListener: Executing external command: [1587107819] SEND_CUSTOM_SVC_NOTIFICATION;server2;swap;0;user1;test notification
[2020-04-17 09:16:59 +0200] information/Checkable: Checkable 'server2!swap' has 1 notification(s). Checking filters for type 'Custom', sends will be logged.

Both notification objects are equal without there name:

server1

Object 'server1!swap!Stab2B-Mail-Service-Notification' of type 'Notification':
  % declared in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64
  * __name = "server1!swap!Stab2B-Mail-Service-Notification"
  * command = "e-mail-service-notification"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_templates.conf', lines 7:5-7:43
  * command_endpoint = ""
  * host_name = "server1"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64
  * interval = 0
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 248:5-248:17
  * name = "Stab2B-Mail-Service-Notification"
  * package = "_cluster"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64
  * period = "7x24"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_templates.conf', lines 8:5-8:19
  * service_name = "swap"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64
  * source_location
    * first_column = 1
    * first_line = 245
    * last_column = 64
    * last_line = 245
    * path = "/var/lib/icinga2/api/zones/master/director/notification_apply.conf"
  * states = [ "Critical", "OK", "Unknown", "Warning" ]
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 250:5-250:47
  * templates = [ "Stab2B-Mail-Service-Notification", "e-Mail-Service-Notification" ]
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_templates.conf', lines 6:1-6:51
  * times = null
  * type = "Notification"
  * types = [ "Acknowledgement", "Custom", "Problem", "Recovery" ]
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 251:5-251:58
  * user_groups = null
  * users = [ "Stab2B" ]
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 252:5-252:24
  * vars = null
  * zone = "master"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64

server2

Object 'server2!swap!Stab2B-Mail-Service-Notification' of type 'Notification':
  % declared in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64
  * __name = "server2!swap!Stab2B-Mail-Service-Notification"
  * command = "e-mail-service-notification"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_templates.conf', lines 7:5-7:43
  * command_endpoint = ""
  * host_name = "server2"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64
  * interval = 0
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 248:5-248:17
  * name = "Stab2B-Mail-Service-Notification"
  * package = "_cluster"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64
  * period = "7x24"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_templates.conf', lines 8:5-8:19
  * service_name = "swap"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64
  * source_location
    * first_column = 1
    * first_line = 245
    * last_column = 64
    * last_line = 245
    * path = "/var/lib/icinga2/api/zones/master/director/notification_apply.conf"
  * states = [ "Critical", "OK", "Unknown", "Warning" ]
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 250:5-250:47
  * templates = [ "Stab2B-Mail-Service-Notification", "e-Mail-Service-Notification" ]
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_templates.conf', lines 6:1-6:51
  * times = null
  * type = "Notification"
  * types = [ "Acknowledgement", "Custom", "Problem", "Recovery" ]
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 251:5-251:58
  * user_groups = null
  * users = [ "Stab2B" ]
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 252:5-252:24
  * vars = null
  * zone = "master"
    % = modified in '/var/lib/icinga2/api/zones/master/director/notification_apply.conf', lines 245:1-245:64

Anyone a idea where to look for a difference?

Kind regards,
Alicia

Hello Alicia

Can you share the Service and Host objects ?
It could be in the definitions of those.

Regards

Hi,
sure, but like I sad, the second one is a cloned host from the first one. To get sure, I mad this step on friday again:

server1:

object Host "server1" {
    import "Linux-Server"

    address = "ip1"
    check_command = "ssh"
    max_check_attempts = "3"
    check_interval = 1m
    retry_interval = 30s
    enable_notifications = true
    enable_active_checks = true
    enable_passive_checks = true
    enable_event_handler = true
    enable_flapping = false
    enable_perfdata = true
    volatile = false
    vars.agent_endpoint = true
    vars.notification_icingaweb2url = ""
    vars.os = "61"
}

server2:

object Host "server1" {
    import "Linux-Server"

    address = "ip2"
    check_command = "ssh"
    max_check_attempts = "3"
    check_interval = 1m
    retry_interval = 30s
    enable_notifications = true
    enable_active_checks = true
    enable_passive_checks = true
    enable_event_handler = true
    enable_flapping = false
    enable_perfdata = true
    volatile = false
    vars.agent_endpoint = true
    vars.notification_icingaweb2url = ""
    vars.os = "61"
}

service apply rule:

apply Service "swap" {
    check_command = "swap"
    max_check_attempts = "5"
    check_interval = 3m
    retry_interval = 30s
    enable_notifications = true
    enable_active_checks = true
    enable_passive_checks = true
    enable_event_handler = true
    enable_perfdata = true
    volatile = false

    assign where "Linux-Server" in host.templates
    command_endpoint = host_name

    import DirectorOverrideTemplate
}

Regards Alicia