Notification issues in icinga2

I am using icinga2 versoin 2.6.3. It seems like when a host goes down it sends notification and when it comes online within few minutes, it fail to send “resolved” notification. issue happens only for when it goes down and up quickly. Any suggestion to configure proper notification when it resolves

object NotificationCommand “outage-notify” {
command = [ SysconfDir + “/icinga2/scripts/xxxxx” ]
arguments = {
“–event” = “$notification.type$”
“–service” = “$host.vars.connection_id$”
“–timestamp” = “$icinga.timet$”
}
env = {
NOTIFICATIONTYPE = “$notification.type$”
HOSTOBJECTNAME = “$host.name$”
HOSTADDRESS = “$address$”
HOSTSTATE = “$host.state$”
LONGDATETIME = “$icinga.long_date_time$”
NOTIFICATIONAUTHORNAME = “$notification.author$”
NOTIFICATIONCOMMENT = “$notification.comment$”
HOSTDISPLAYNAME = “$host.display_name$”
HOSTSTATETYPE = “$host.state_type$”
}
}
apply Notification “outage-notify” to Host {
command = “outage-notify”
interval = 0 // disable re-notification
states = [ Up, Down ]
types = [ Problem, Recovery ]
period = “24x7”
user_groups = [ “xxxx” ]
users = [ “xxxxx” ]
assign where host.address
}
template Host “core-host” {
max_check_attempts = 5
check_interval = 5m
retry_interval = 30s
check_command = “hostalive”
enable_flapping = false
}

Hi, Your code is a bit hard to read without a code block :slight_smile:
But looking at I cannot find a specific error with your setup here. What I would suggest is fail a host on purpose and tail -f /var/log/icinga2/icinga2.log | grep hostname-of-server-that-is-down it should state that it did or did not send a notification or why it failed.

object NotificationCommand “outage-notify” {
command = [ SysconfDir + “/icinga2/scripts/xxxxx” ]
  arguments = {
    “–event” = “$notification.type$”
    “–service” = “$host.vars.connection_id$”
    “–timestamp” = “$icinga.timet$”
  }
  env = {
    NOTIFICATIONTYPE = “$notification.type$”
    HOSTOBJECTNAME = “$host.name$”
    HOSTADDRESS = “$address$”
    HOSTSTATE = “$host.state$”
    LONGDATETIME = “$icinga.long_date_time$”
    NOTIFICATIONAUTHORNAME = “$notification.author$”
    NOTIFICATIONCOMMENT = “$notification.comment$”
    HOSTDISPLAYNAME = “$host.display_name$”
    HOSTSTATETYPE = “$host.state_type$”
  }
}

apply Notification “outage-notify” to Host {
  command = “outage-notify”
  interval = 0 // disable re-notification
  states = [ Up, Down ]
  types = [ Problem, Recovery ]
  period = “24x7”
  user_groups = [ “xxxx” ]
  users = [ “xxxxx” ]
  assign where host.address
}

template Host “core-host” {
  max_check_attempts = 5
  check_interval = 5m
  retry_interval = 30s
  check_command = “hostalive”
  enable_flapping = false
}

Also, consider updating to the most recent version of icinga2, 2.6 ist way out of date and so many features were added as well as many bugs fixed, including issues with notification.