Defining different notification behavior for the same service on different hosts

Rob Blake rob.blake at gmail.com
Wed Jan 17 10:33:46 CET 2007


On 1/16/07, Scott Greenman <GreenmanSE at ldschurch.org> 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.
>
> Scott Greenman
>
> ------------------------------
>


I guess it really depends on how many different hosts your are monitoring
the service, but you could always template the service description and then
override the hostname and notifcation_enabled directives when you actually
come to use the service. It's probably overkill for monitoring on only 2
hosts, but if your scenario is applicable to a wider number of Hosts, it
could be an option.

Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070117/ed5fd3e4/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
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