Hostgroup services


#1

I have a few services defined with host groups.

define service{
        hostgroup_name windows-servers
        use check_services
        }

This has greatly simplified the management of any services which can be checked across broad categories - my configuration files are down to around 1000 lines from over 10000.
I would like to disable notifications for a few specific hosts in these group as follows, where myhost is a member of windows-servers.

define service{
        use check_services
        host_name myhost
        notification_options n 
        notifications_enabled 0
        }

Unfortunately the notification options aren’t taking. Any suggestions? I really don’t want to pull these hosts out of my main groups or have to create a bunch of groups specific to each service.


#2

nagios.sourceforge.net/docs/3_0/ … ml#service

notification_options [w,u,c,r,f,s]

It doesn’t work because n is no valid option. :slight_smile:


#3

Luca, thanks. Goes to show me not to trust the internet 100%. :stuck_out_tongue:
The issue is still existing however, even with only using the ‘notifications_enabled 0’ option. Any further suggestions?
Edit - nagios -v returns “Warning: Duplicate definition found for service” for the service in question.


#4

Check that the notifications are in fact disabled…
If you have retention enabled it may happen that you disable them in the config but they continue to be active.


#5

Luca, setting use_retained_program_state=0 in the main config file did the trick, although I wish it didn’t require turning off all retention.
Thanks a ton.


#6

You can turn it on again now… probably turning those notifications off from the interface would have donw the trick… thsi can be done for one or two hosts… if it’s lots probably turning retention off and after a restart on again is better…


#7

I found another solution which may be of some benefit under nagios.sourceforge.net/docs/3_0/ … ricks.html.
I’m just posting here in case anyone runs across this post researching the issue.

define service{
hostgroup_name windows-servers
host_name !myhost
use check_services
}

define service{
use check_services
host_name myhost
notifications_enabled 0
}