Page 1 of 1

Send notification right away

Posted: Thu Mar 01, 2018 9:59 am
by jkinning
I have some checks that Nagios XI is using the check_nrpe to call a PowerShell script that the NSClient++ runs. It is checking errors within a database table. I am using the following for my intervals
Check interval = 5
Retry interval = 1
Max check attempts = 5

If I want the service to send out the notification as soon as it is received would changing my intervals to all have 1min provide me with that result?

The issue is when the alert happens and it is in SOFT state by the time the notification should be sent out Nagios sees it as OK and never alerts. So I just need to have it send out a notification and not retry. I wasn't sure if a zero is a valid number as I was going to try this.
Check interval = 5
Retry interval = 0
Max check attempts = 0

Just looking for advice on having notifications sent out immediately when a service goes critical.

Re: Send notification right away

Posted: Thu Mar 01, 2018 12:41 pm
by npolovenko
Hello, @jkinning.

You need to set the notification interval to 0.
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 down or unreachable. 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 host - only one problem notification will be sent out.
from https://assets.nagios.com/downloads/nag ... tions.html

Re: Send notification right away

Posted: Thu Mar 01, 2018 2:38 pm
by jkinning
I am looking to send out the 1st notification right away and not have it wait. That setting would be after it sends out the 1st notification correct?

See how it waits for 5 attempts and shows SOFT, i need or want it to be sent 1 of 1 with a HARD so the notification is sent.

Re: Send notification right away

Posted: Thu Mar 01, 2018 5:24 pm
by npolovenko
@jkinning, I apologize, actually you need to change the max_check_attempts option to 1.

Code: Select all

Service - max check attempts

This directive is used to define the number of times that Nagios will retry the service check command if it returns any state other than an OK state. Setting this value to 1 will cause Nagios to generate an alert without retrying the service check again.
That also means the service check will go into a hard state right away.

Please disregard my previous answer.

Re: Send notification right away

Posted: Fri Mar 02, 2018 10:07 am
by jkinning
Thanks! You can close this.