Stop recovery notification from WARNING to OK

I have a notification as below which works great. My problem is that the script is triggered twice.
The first time when the problem occurs and a second time when the problem has been recovered

 Sending reminder 'Problem' notification
 Sending 'Recovery' notification

How can I stop icinga2 from sending the Recovery notification for this specific notification, please? In this case from WARNING to OK

template NotificationCommand "empty_json_file-template-service" {
    import "plugin-notification-command"
    command = [ "/usr/lib64/nagios/plugins/empty_json_file" ]

object NotificationCommand "empty_json_file-service" {
  import "empty_json_file-template-service"
  command = [ "/usr/lib64/nagios/plugins/empty_json_file" ]


apply Notification "Empty-JSON-file" to Service {
  command = "empty_json_file-service"
  users = ["opsgenie"]
  states = [ Warning ]
  interval = 0
  times.begin = 1m 
  assign where == "SOME_HOSTNAME" && == "Storage"

Try adding this to your notification apply:
types = [ Problem ]


Many thanks, now the notification is behaving as I wanted to!

1 Like