Receiving Nagios notifications after disabling it

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.
Sacotram
Posts: 20
Joined: Tue May 27, 2014 6:21 am

Receiving Nagios notifications after disabling it

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Receiving Nagios notifications after disabling it

Post by ssax »

Please post the config of a host and it's service that is still notifying.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Receiving Nagios notifications after disabling it

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Receiving Nagios notifications after disabling it

Post 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.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Receiving Nagios notifications after disabling it

Post by eloyd »

Whoops! I meant to ask that, too! :)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Sacotram
Posts: 20
Joined: Tue May 27, 2014 6:21 am

Re: Receiving Nagios notifications after disabling it

Post 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
Attachments
Example of last notifications shown on Nagios GUI
Example of last notifications shown on Nagios GUI
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Receiving Nagios notifications after disabling it

Post 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?
Sacotram
Posts: 20
Joined: Tue May 27, 2014 6:21 am

Re: Receiving Nagios notifications after disabling it

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Receiving Nagios notifications after disabling it

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Sacotram
Posts: 20
Joined: Tue May 27, 2014 6:21 am

Re: Receiving Nagios notifications after disabling it

Post 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.
Locked