Nagios email notifications delayed

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Dzonii
Posts: 9
Joined: Wed Sep 19, 2018 3:12 am

Nagios email notifications delayed

Post by Dzonii »

Hello to everyone i have problem with Nagios Core notifications alert which re delayed 10-15 minutes, when issue is happened.
I am monitoring agents HDD using NRPE. Here is my agent config.
define host {
name linux-box1
use generic-host
check_period 24x7
check_interval 1
retry_interval 1
max_check_attempts 1
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,r
contact_groups admins
register 0
}

define host {
use linux-box1
host_name agent1
alias Host1
address 192.168.1.10
}

and here is my contacts.cfg config from server
define contact {

contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values fr$
alias Nagios Admin ; Full name of user
email local@domain.com ; <<***** CHANGE THIS TO YOUR EMAIL$
}

Is there anyway to speed up this process ? Any help is appreciated, thanks in advance
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios email notifications delayed

Post by cdienger »

How are you monitoring the delay exactly? I tested the provided config and the emails are sent right away as configured. /usr/local/nagios/var/nagios.log will log when the notification commands are run. Are these entries made on time?

If you're using an external mail server then I would check logs there to verify when mail is getting sent. The delay may be there. I would also try sending notification to root@localhost to see if those are delivered quickly and help rule some things out.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Dzonii
Posts: 9
Joined: Wed Sep 19, 2018 3:12 am

Re: Nagios email notifications delayed

Post by Dzonii »

I check Nagios logs immediately, and nothing is happening there for, even hdd is down for a more than 5 minutes, and then there is a entry in log file SERVICE ALERT: agent1;HDD Usage;CRITICAL;SOFT;1;DISK CRITICAL - free space: / 813 MB (8% inode=79%):
but still no aler after 10 minutes of time. I use Postfix, but when i send email to my email on another computer outside i got email in less then a second. Any idea how to configure an warning email alert when HDD is 80% full and then another alert when is 90%???? I got generate alert in log file when is 80 %, but it doesnt sent an email it is Service Alert not a Service Notification
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios email notifications delayed

Post by cdienger »

The configuration that was provided was a host check and not a disk space check. Please provide the disk space check configuration if that is what is having the problem.

That said, ALERTS are different from NOTIFICATIONS. ALERTS tell you if there is a state change and NOTIFICATIONS are sent when the state is HARD. In the log you saw an ALERT for a SOFT state and not a notification(email).

https://assets.nagios.com/downloads/nag ... tions.html
https://assets.nagios.com/downloads/nag ... types.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mickaelm
Posts: 1
Joined: Wed Oct 31, 2018 4:31 pm

Re: Nagios email notifications delayed

Post by mickaelm »

Hi,
With a fresh install of nagios-4.4.2, I have exactly the same problem!!

In Nagios: 10-31-2018 22:09:50] HOST ALERT: sd1001;DOWN;SOFT;1;(Host check timed out after 30.03 seconds)
In Postfix: Oct 31 22:24:09 ber002 postfix/pickup[12519]: 712DD7381317: uid=1000 from=<nagios@ber002.eu.xyz.net>

22:24 - 22:09 = 15 min.

Why these 15 minutes between detection and sending e-mail ?? It does not make you crazy enough to give up nagios. Hours that I'm looking for why.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios email notifications delayed

Post by cdienger »

In Nagios: 10-31-2018 22:09:50] HOST ALERT: sd1001;DOWN;SOFT;1;(Host check timed out after 30.03 seconds)

The above does not send an email. The above is a SOFT ALERT. NOTIFICATIONS(emails) are sent when the status goes into a HARD state.

It's very likely that the check's retry_interval and max_check_attempts will account for the 15 minute difference. We would need a copy of that config though to confirm.

https://assets.nagios.com/downloads/nag ... ml#service
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked