Mail notification

Hello,

I’m trying to figure out how to set up a mail notification per check, the idea is that you only get a mail notification after 2-3 times critical.

I’m trying to set up in web console but I don’t know where to look.

I don’t see an exception option for that

Getting a notification after 2-3 times critical is already kind of the default :slight_smile:
Notifications are only sent if a Hard State is reached. You can configure how many soft states are needed for a Hard State.

@bberg

How and where can you configure it ?

In the Icinga Director, if you are using it. Otherwise you need to rely on config files using the Icinga2 DSL.

Wel i cant find any option for in icinga director > notification> Rule notification when i am making new rule

Hi @Skepko,
could you elaborate on what specifically you are not finding?

Hi @lorenz

how to set up mail notification when soft state reached more then 3 criticals or something like this.

I dont want to get mail notification after each critical services reached. And can i get mail per services per client ?

What @bberg wanted to tell you is, that this is alreday the case by default. Icinga2 will (by default) only trigger a notification if a Host or Service reaches a “hard state”, which is (again by default, can be configured) after three consecutive “failed” checks.
How many “failed” attempts are necessary for a ‘Host’ or ‘Service’ to reach a “hard state” (as opposed to the “sofft state”) is not part of the notification configuration but of the Host or Service.

Regarding your second question, what is a “client” in this case?

1 Like

@lorenz Some sql windows client

Ok, let’s see if I can explain it in a few words:
Notifications are attached or linked to Services or Hosts, one Notification object for each single Service or Host.
Meaning, they are independent of each other. If two Services trigger a notification you will get two emails (assuming the usage of emails, the same apply rule for the Notifications and so on).

If you configure something like a Service Notification which applies to every Service (Condition: service.name or just true or something like that) you will get Notifications independently for each Service.

Does this answer your question? If not, please elaborate a bit.

1 Like

@lorenz Thank you for explanation, i get it. And then i can easly make new Apply Rule en assing to the host/services (Webconsole> Directory> notification> notification> Create new notification Apply Rule> )

Exactly. you can then also use different parameters for more or less “critical” service.

@lorenz I have another quiestion about notification.

i want that for example that CPU services pop up RED ONLY when:

there should be some kind of “counter” so as an example within 15 min

check x at minute 0 = too high >> counter goes to 1

check y minute 4 = too high >> counter goes to 2

check z minute 8 = too high >> counter goes to 3

and THEN there is a critical is at check z ok again then NOT

I didn’t get your last line but this sounds like the difference between soft and hard states.

https://icinga.com/docs/icinga-2/latest/doc/03-monitoring-basics/#hard-and-soft-states

1 Like

@rivad

i have CPu check with warning at 80% and critical at 90 % and ThresholdInterval 5 min.

So what want is that if the CPU above 90% after 3 checks (after 15 min) then its wil print RED in dahsboard not if when Critical 90% after 2 checks and next check is under 90%

If retry_interval is 5min and max_check_attempts is 4 you will get a notification 15min after the first check failed.

In my dashboards I filter out soft states and only show hard states.

@rivad increasng max_check_attepmts resloved our issue for now. Thank you.

1 Like