Hi.
I’m having a problem with nagios not triggering any notification when an hard state is met. I’ve looked through the configs and notifications are enabled on service,hosts and hostgroup but no email nor sms are sent. Nagios.log doesn’t contain any notification info. Could someone please help me solve this, I’ve been scratching my head for days.
My configs:
Host template
define host{
name generic-host
alias generic-host
check_command check_host_alive
max_check_attempts 5
active_checks_enabled 1
passive_checks_enabled 0
check_period 24x7
contact_groups Helpdesk, IT
notification_interval 120
notification_period 24x7
notification_options d,u,r
notifications_enabled 1
register 0
}
Hostgroup
define host{
name Servers-Linux
use generic-host
alias Linux Servers
max_check_attempts 5
check_interval 5
contact_groups Helpdesk, IT
notification_interval 120
notification_period 24x7
notification_options d,u,r
notifications_enabled 1
register 0
}
Example host
define host{
host_name bil-apt01
use Servers-Linux
alias Apt cache
address 10.122.102.31
hostgroups Linux_Servers
contact_groups Helpdesk, IT
notification_interval 120
notification_period 24x7
notification_options d,u,r,f
notifications_enabled 1
}
Hi,
Thanks for you reply. Notifications aren’t triggered by anything at the moment. Neither for services nor host problem. In nagios.log:
[1243495251] SERVICE ALERT: bil-apt01;ping;CRITICAL;SOFT;2;GPING CRITICAL - 3 packets transmitted, 0 received, +3 errors, 100percent packet loss, time 2010ms
[1243495285] SERVICE ALERT: bil-apt01;ping;CRITICAL;HARD;3;GPING CRITICAL - 3 packets transmitted, 0 received, +3 errors, 100percent packet loss, time 2005ms
But no Notification Alert. I remember adding www-data (for centreon) to group nagios some time back so I could disable notifications from the web-interface. Not sure if this caused the error but it could be a permission problem. I got suspicious when I hadn’t received any emails for a week.
You have to check that the service has notifications enabled, and your user has to have notifications enabled, if only one has the notfications disabled you won’t get any.
I’ve checked that service, host, hostgroup and contact have notifications enabled. Isn’t there a way to get a good log out of nagios, what it is doing and so on. I set the debug log but couldn’t find anything valuable. Can someone point me in the right direction. It used to work but since I added http process to group nagios (for centreon) I havent got any notifications. That shouldn’t really be the problem but maybe there’s some permission issues.
i suppose you should ask on some centreon forum… sorry never had a look at it so i have no idea if this can be caused by centreon messing up some files…
No, I haven’t. Everything points towards luca’s suggestion that notifications must be disabled somewhere but I haven’t been able to find it. Sadly, nagios debug log doesn’t help much either.
It must be something in the config files. I was trying to use nconf to make configuration easier and I am going to give up on that. It all worked beautifully except for the notifications. When I returned Nagios to original config files, the notifications worked fine. Seemed like nothing I did in nconf would allow the notifications to trigger. So I am going to start with what works and build the configuration files manually. I know this doesn’t help you much, except to confirm that it must be something in your config files also. Good luck!
I also had this problem with a fresh Nagios and NConf install.
It turns out that the default contact in NConf, “nagiosadmin”, has notifications turned off! The “host notification options” and “service notification options” configuration for the contact is, by default, set to “d,u,r,f,n” and “w,u,c,r,f,n” respectively. Notice the “n” option on each. That means “None” and will override all other options. It’s really hard to spot that pesky “n” when all the other options are there as well!