Page 1 of 2
Receiving Nagios notifications after disabling it
Posted: Wed Mar 25, 2015 10:09 am
by Sacotram
Hello!
I have nagios installed in a Ubuntu 12.04.5 server. I have configured hosts and services and they all inherit attributes from respective templates (generic-host and generic-service).
I have disabled notifications for services by adding the attribute notifications_enabled and setting it to 0 on the generic-service definition. This should be applied to every single service as all are inheriting this attribute.
However, after disabling it I'm still receiving notifications and I have no idea why.
I know I am missing something but I haven't got a clue.
Can you help me?
Thank you
Re: Receiving Nagios notifications after disabling it
Posted: Wed Mar 25, 2015 11:32 am
by ssax
Please post the config of a host and it's service that is still notifying.
Re: Receiving Nagios notifications after disabling it
Posted: Wed Mar 25, 2015 11:40 am
by eloyd
Just curious about two things:
1) Are you receiving the same notification twice at the same time, or after an interval?
2) What does your Nagios GUI say when you click "Notifications?" Does it have each notification listed or is it just one?
I'm wondering if you're receiving multiple notifications because you're on a mailing list or something twice.
Re: Receiving Nagios notifications after disabling it
Posted: Wed Mar 25, 2015 1:16 pm
by jdalrymple
Also - are you certain it's not a host notification you're receiving? The service template would not prevent host notifications from being sent.
Re: Receiving Nagios notifications after disabling it
Posted: Wed Mar 25, 2015 1:29 pm
by eloyd
Whoops! I meant to ask that, too!

Re: Receiving Nagios notifications after disabling it
Posted: Wed Mar 25, 2015 1:33 pm
by Sacotram
First thanks for your help
I will answer both replies on this post:
1) Here's an example of a host definition (on the image attached to this post a sent service notification is shown, for the following host)
Code: Select all
####################################################################################################
# (...)-CA - 192.168.1.206
####################################################################################################
define host{
use (...)-generic-host,host-pnp
host_name (...)-CA
alias (...)-CA
display_name CA
address 192.168.1.206
hostgroups (...)
parents <system>
notes
}
define hostextinfo{
host_name (...)-CA
icon_image
icon_image_alt
statusmap_image
}
2)An example of a service of the aforementioned host
Code: Select all
define service{
use (...)-generic-service,srv-pnp
host_name (...)-CA
service_description DNV-Uptime
servicegroups (...)
check_command check_nrpe!CheckUpTime -a MinWarn=1h MinCrit=30m
}
3)The definition of the generic host
Code: Select all
define host{
use generic-host
name (...)-generic-host
active_checks_enabled 1
passive_checks_enabled 0
event_handler_enabled 1
flap_detection_enabled 1
failure_prediction_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
obsess_over_host 0
check_command check-host-alive
max_check_attempts 3
contact_groups (...)
normal_check_interval 5
notifications_enabled 1
max_check_attempts 3
retry_check_interval 1
notification_interval 0
notification_period 24x7
notification_options d,r
check_freshness 0
first_notification_delay 0
}
4) The definition of the generic service:
Code: Select all
define service{
name (...)-generic-service
use generic-service
active_checks_enabled 1
passive_checks_enabled 0
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
notifications_enabled 0
obsess_over_service 0
contact_groups (...)
check_period 24x7
notification_options c,r
stalking_options w,c,u
check_freshness 0
event_handler_enabled 1
flap_detection_enabled 1
failure_prediction_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_period 24x7
notification_interval 0
first_notification_delay 0
}
Finally, there's an image attached with the notifications shown on Nagios GUI.
I have ommited some names for professional reasons.
I should only be receiving notifications for hosts but I am getting for services as well.
I know I am missing something, probably it's something obvious, but right now I am in the dark.
Thank you
Re: Receiving Nagios notifications after disabling it
Posted: Wed Mar 25, 2015 2:53 pm
by jdalrymple
Your config looks good. The next question is going to sound stupid but I have to ask anyway because I don't see anything wrong ...
Did you reload your configs after making the changes?
Re: Receiving Nagios notifications after disabling it
Posted: Thu Mar 26, 2015 5:32 am
by Sacotram
I've done that twice at least!! And afterwards I waited sometime to see if I was getting any notifications.
One thing also odd is that when I go to the Nagios GUI and open a service page, I see the notifications disabled in red and when the page refreshes the notification sign changes from disabled to enabled green. It shouldn't do that!!!
Anyway I will do a reload again now and let you know...
Thanks
Re: Receiving Nagios notifications after disabling it
Posted: Thu Mar 26, 2015 3:41 pm
by lmiltchev
Check the service definitions in the "objects.cache" to see if the notifications are disabled. You are not using anything like chef or puppet, are you?
Re: Receiving Nagios notifications after disabling it
Posted: Fri Mar 27, 2015 5:50 am
by Sacotram
Hello again!
Sorry for taking so long to respond. I needed to wait to verify if the changes prevailed, which they did after restarting nagios service several times.
So far so good, but I will take lmiltchev's advice and check objects.cache.
Though everything is fine now, I still don't understand why it took several restarts of nagios service for changes to be effective.
Thank you very much for all your help.