Page 1 of 2

XI Contact Group alerting question - How?

Posted: Wed Dec 14, 2016 3:10 pm
by chris_rr
Hi,

Doing a PoC for nagiosXI, and while I can easily see how to get alerts sent to users, i'd like to be able to turn off alerts for individual users and just use contact groups.. however..
I see no way to configure alerts to send to a contact group other than going individually through each and every host and service and selecting the contact group. As that's too ridiculous to be the only way.. can somebody tell me what I'm missing here?

thanks
Christopher

Re: XI Contact Group alerting question - How?

Posted: Wed Dec 14, 2016 3:59 pm
by avandemore
If the hosts or services use a template, they can inherit from the template:

https://assets.nagios.com/downloads/nag ... tance.html

Or create a hostgroup or servicegroup and have it use a template.

Re: XI Contact Group alerting question - How?

Posted: Wed Dec 14, 2016 4:19 pm
by chris_rr
To clarify, when I'm editing contacts in the XI gui, I have the options in the Alert Setting tab to choose what that user gets an alert for - hosts, services, what level, etc.

I don't see anything similar for Contact Groups unless i'm editing a host or service's notification parameters.

Re: XI Contact Group alerting question - How?

Posted: Thu Dec 15, 2016 3:34 am
by eloyd
When a host or service triggers an alert, it sends its alerts to all contacts and contactgroups defined on that host or service. Each contactgroup can potentially inherit other contractgroups, but eventually all contactgroups contain contacts. So eventually, all alerts are sent to one or more contacts.

At that point, the individual contact's preferences are applied, so if a service sends a warning to someone who doesn't want to get warning messages for services, then they won't get it.

So in the end, only the notification methods/preferences for contacts matters, as all contactgroups are expanded until they are simply a list of contacts.

Does that help?

Re: XI Contact Group alerting question - How?

Posted: Thu Dec 15, 2016 12:25 pm
by dwhitfield
In addition to what @eloyd mentioned, there is information on contact groups at https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Please let us know if you have additional questions.

Re: XI Contact Group alerting question - How?

Posted: Thu Dec 15, 2016 12:38 pm
by chris_rr
Let's take an example I'll be trying to build:

10 users, 3 contact groups (A, B, C)

3 users are in contact group A.

We have hostgroups A, B, C.

I want all the hosts+services to alert users in contact group A. Those users should see no other alerts.

This doesn't actually appear to be easy to do in XI via the GUI at all. The template suggestion would mean I'd have to create 83 (at current XI count I see) templates x # of hostgroups.

Basically a page that can edit a contactgroup like you can edit a contact would go a long way.

Re: XI Contact Group alerting question - How?

Posted: Thu Dec 15, 2016 1:31 pm
by eloyd
This is my fast solution, so it may not be exactly what you want:

You have three contact groups A, B, C (I'll call them cg-A, cg-B, and cg-C).

Create three host templates ht-A, ht-B, ht-C
Assign cg-A to ht-A
Assign cg-B to ht-B
Assign cg-C to ht-C

Create three service templates st-A, st-B, st-C
Assign cg-A to st-A
Assign cg-B to st-B
Assign cg-C to st-C

Assign st-A to all your services via the generic-service template and/or xi-generic-service template (templates can have templates).
Assing ht-A to all your hosts vai the generic-host and/or xi-generic-host templates
Assign st-B to the services that you want to notify cg-B
Assign ht-B to the hosts that you want to notify ht-B
Assign st-C to the services that you want to notify cg-C
Assign ht-C to the services that you want to notify cg-C

Done.

Re: XI Contact Group alerting question - How?

Posted: Thu Dec 15, 2016 4:25 pm
by bwallace
Well put, Mr Loyd! OP, certainly let us know if there are additional questions.

Re: XI Contact Group alerting question - How?

Posted: Thu Dec 15, 2016 4:36 pm
by chris_rr
That doesn't quite work for "all services associated with this host". Looks good for "All services of this type" tho.

One this this doesn't seem to work AT ALL for is passive services - so you can't edit passive services to manage alert settings or contact groups. Is that correct?

Re: XI Contact Group alerting question - How?

Posted: Thu Dec 15, 2016 5:07 pm
by eloyd
Ohhhh. "all services of this host" is not a valid selector. Unless you make a service template for every service that's supposed to be on host X, then assign those services to st-X. There's no way to do what you want directly, since hosts and services aren't really connected*.

And you're wrong about passive services. Just because Nagios didn't schedule or execute the service check doesn't mean it can't alert.


*Personally, I think it's time for Nagios Core 5 (I know, easy to ask for, hard to contribute) that makes everything an object and there's no difference between service and host or contact or dependency and you can just link things together however you want. This type of infrastructure would allow you to do what you want, but it's not there yet.