Disable Notification for specific Service in Icinga2

Hi Team,

We have lots of windows sql servers that we are monitoring… & along with there are tons of unneccesary memory utilization alerts that we are getting…

Can you please suggest me the below possible scenarios?

  1. If i want to turn off the memory utlization completely on all servers what change needed on service check?
  2. If i want to turn off memory allocation for few servers? what would be best approach…

Here my service check:

apply Service “Memory-Utlization” {

import “generic-service”

check_command = “memory-windows”

command_endpoint = host.vars.client_endpoint

assign where host.vars.client_endpoint && (host.vars.os == “Windows” || host.vars.os == “AWS-Windows”)

}

Hi Team,

I have tried with the below change…

apply Service “Memory-Utlization” {

import “generic-service”

check_command = “memory-windows”

vars.enable_nofitication = false
command_endpoint = host.vars.client_endpoint

assign where host.vars.client_endpoint && (host.vars.os == “Windows” || host.vars.os == “AWS-Windows”)

}

Still i am getting notification… Can someone help on this?

Hello,

its only

enable_nofitications = false

and not vars.enable_nofitication = false

Regards,
Carsten

1 Like

Hi,

you forgot the s :slight_smile: it’s named enable_notifications

For the second question, i would define an atttribute on the host level and decide with the apply rule if the service get’s applied or not (as you already done that with host.vars.os)

Greetz

2 Likes

Your right, shouldnt post before the first coffee :slight_smile:

1 Like

Sorry this is defintely not working… if i update the service check as enable_nofitication = false i have been getting the syntax errors([2020-02-20 12:25:19 -0700] critical/config: Error: Attribute ‘enable_notification’ does not exist) during validation… If i update as vars.enable_notification=false thats not working…

Correct me if i am doing anything wrong here?

Its enable_notifications as @fluxX wrote. I posted it before my first coffee :wink:
By the way, the docs are a good source to see what you can configure for each object type.

Regards,
Carsten

1 Like