Defining different notification behavior for the same service on different hosts

Andy Shellam (Mailing Lists) andy.shellam-lists at mailnetwork.co.uk
Wed Jan 17 11:18:44 CET 2007


As part of the "hackery" I would have the first (live) service have all 
options set, and the second (test-bed) service simply "use" the first 
service as a template, and override the "notifications_enabled" setting 
(and obviously the host too.)  That way you really only have one service 
to change should you need to.


Andreas Ericsson wrote:
> Scott Greenman wrote:
>   
>> I can't any way to have the same service on two hosts have different
>> notification rules.  Am I missing anything?
>>  
>> Say you have two hosts, 'A' and 'B'.  The service 'S' is defined as existing on
>> both hosts. 
>>  
>> If 'S' goes down on 'A', I want notifications sent.  If 'S' goes down on 'B', I
>> don't want any notifications sent.  
>>  
>> If I set the 'notifications_enabled' directive on the service to either on or
>> off, it's wrong for one host or the other.
>>  
>> If I set the 'notifications_enabled' directive on the two hosts, this only
>> affects host notifications, it seems to have no effect on service notifications
>> on those hosts.
>>  
>> To get what I want, It seems I'd have to create two services, one with
>> 'notifications_enabled' set to 1 and one with it set to 0 (zero).  
>>  
>> That would be a real pain because most of my services would have to be
>> duplicated this way.  We run one group of machines as our 'production'
>> environment where notifications are turned on and another group of machines as a
>> 'test' environment where notifications are turned off.  Both of these are
>> monitored by the same nagios server and both run the same set of services.
>>  
>> Unless someone can suggest an alternative, I am planning on having
>> notifications turned on for both environments, and add filtering in the script
>> defined as the 'service_notification_commands' for the contacts. This has the
>> down side that Nagios will show I sent notifications to both hosts, when some of
>> those notifications will have been filtered out by my script.
>>  
>> Any help or ideas would be greatly appreciated.
>>  
>>     
>
> Sounds sensible. Since the two services really have different options 
> defined, you can't keep them as one service without hackery. If the 
> hackery lets you maintain configuration in a very simple manner I'd say 
> it's worth it. Otherwise I'd go with creating two services.
>
>   


-- 
Andy Shellam
NetServe Support Team

the Mail Network
"an alternative in a standardised world"

p: +44 (0) 121 288 0832/0839
m: +44 (0) 7818 000834


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list