Assign contact_group to a host without notifications

Jim Avery jim at jimavery.me.uk
Tue Jun 29 14:36:37 CEST 2010


On 29 June 2010 01:34, Matthew Angelo <bangers at gmail.com> wrote:
> Hi Nagios Users,
>
> We have a super modular config.  Essentially [almost] all Service Checks are
> defined to HostGroups, and then Hosts merely assign themselve to that
> HostGroup.
>
>
> #
> #
> # HostGroup {
> #     LINUX_SERVER
> #         check_cpu
> #         check_memory
> #         check_disk
> # }
> #
> #
> # Host {
> #     use TEAM1
> #     name MY_LINUXSERVER1
> #     hostgroup LINUX_SERVER
> # }
> #
> #
>
> "use TEAM1" is a Host Template definition which defines contact_group and
> notification period.
>
>
> How do I expand on this to allow another team (contact_group) read-only
> access or visibility into the Host service checks for MY_LINUXSERVER1.
> *without* notifiying them?
>
> I added:
>
> contact_groups          +TEAM2
>
> to the host definition.  However it is now also *alerting* to TEAM2 which I
> don't want.
>
>
> Think of TEAM1 as "LINUX team" and TEAM2 as the Application team which want
> visibility into a server, but not be alerted if disk space starts filling up
> on the Server itself.


I think whatever you do is going to be a bit messy.  It will probably
involve setting up two Nagios contact definitions for each physical
user (which is what I do in similar circumstances).

For example I would set up the contacts which your TEAM2 users log in
with to all have host_notification_options = n and
service_notification_options = n.  I would then set up separate
contacts (for example if the user logs in with "Fred", set up a
contact called "Fred-notify".  This 2nd contact can have
host_notification_options and service_notification_options = y.

You will then need to structure your contact groups so for example
contact group "TEAM2" contains user "Fred" and contact group
"TEAM2-notify" contains user "Fred-notify".

Those hosts you want TEAM2 to just see, you set contactgroups =
"+TEAM2" in the relevant host template.
Those hosts you want them to see and get notifications for, you set
contactgroups = "+TEAM2,TEAM2-notify" in the relevant host template.

Note that the user never has actually to log in using "Fred-notify" so
it doesn't need an entry in your htpasswd config  - we only set that
one up for the notifications.



You might be able to do something a little tidier using a custom
notification script, but doing that might make your configs less easy
for anyone coming from outside to understand.



I hope that helps rather than confuses things for you!

Cheers,

Jim

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
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