Page 1 of 1

Notification Alerts

Posted: Tue Oct 29, 2019 8:59 am
by ITOMB_IMT
Hi,

I have the below configuration to monitor a service

define service {
host_name server_name
service_description / Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 15% -c 10% -p /'!!!!!!
initial_state o
max_check_attempts 1
check_interval 5
retry_interval 1
active_checks_enabled 1
check_period xi_timeperiod_24x7
notification_interval 10
notification_period xi_timeperiod_24x7
notification_options w,c,u,r,
notifications_enabled 1
contacts nagiosadmin
_xiwizard linux-server
register 1
}

I am receiving emails from Nagios for every 15 mins until the correction is corrected. Is there a way, Nagios can send email only once (instead of many emails) I know we can do that in escalation if we set last notification.

Re: Notification Alerts

Posted: Tue Oct 29, 2019 9:37 am
by lmiltchev
You can change:

Code: Select all

notification_interval 10
to:

Code: Select all

notification_interval 0
Service - notification interval

This directive is used to define the number of "time units" to wait before re-notifying a contact that this service is still in a non-OK state. Unless you've changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will not re-notify contacts about problems for this service - only one problem notification will be sent out.

Parameter name: notification_interval
Required: yes
Hope this helps.

Re: Notification Alerts

Posted: Thu Oct 31, 2019 10:12 am
by ITOMB_IMT
Thanks for the help.This works.

I need some clarification, i have multiple escalation levels set up for same service from Notification 3, so how can i get it. as there is only one notification after i change to notification_interval 0

first_notification 3
last_notification 0

Re: Notification Alerts

Posted: Thu Oct 31, 2019 11:04 am
by lmiltchev
Well, the point of escalations is to notify more people on the team in case the issue is not resolved timely, so that means sending more notifications... Do you want nagios to send multiple notifications? My understanding (from your first post) was that you wanted to receive only one email... So, which one is it? Can you elaborate?

If your first_notification is set to 3, that means that escalations will never trigger for this service as notification_interval is set to 0, and only one notification will go out.
Serviceescalation - first notification

This directive is a number that identifies the first notification for which this escalation is effective. For instance, if you set this value to 3, this escalation will only be used if the service is in a non-OK state long enough for a third notification to go out.
If your last notification is set to 0, that means that notifications will be sent "forever".
Serviceescalation - last notification

This directive is a number that identifies the last notification for which this escalation is effective. For instance, if you set this value to 5, this escalation will not be used if more than five notifications are sent out for the service. Setting this value to 0 means to keep using this escalation entry forever (no matter how many notifications go out).
You would need to decide what exactly you would like to accomplish before modifying these settings. Do you want to receive one email only, or receive multiple emails (escalating the issue to the members of your team).

Re: Notification Alerts

Posted: Thu Oct 31, 2019 12:06 pm
by ITOMB_IMT
previously, i had set up like this. check every 5 mins and a notification interval of 10 mins and after 3rd notification escalation starts.

Now i would like to achieve like this initial(only one alert) alert and then if problem still persists after 30 mins i would like to escalate the problem.

Thanks,

Re: Notification Alerts

Posted: Thu Oct 31, 2019 1:38 pm
by lmiltchev
In this case, I believe you need to set the following in your service definition:

Code: Select all

notification_interval 30
but in your service escalation definition, you would need to have:

Code: Select all

first_notification 2
last_notification 0
notification_interval 30
This way, only 1 "regular" (non-escalated) notification will be sent. In 30 min (if the problem still exists), a second notification will be sent, but this time - "escalated". Nagios will continue sending (escalated) notifications every 30 min as long as the problem exists.

Is this what you are aiming at?