Contacts and contact groups

Hello Icinga Community :slight_smile:

I’m trying to figure out how I can see the relationship between contact groups-notification rules-services/hosts and contacts.

I will explain: :thinking:
If a user asks me to which hosts and services do they get notifications about, I have no way of knowing that.
On Icinga director > users/contacts, I can see the contact groups assigned to this user, but I can’t see where the groups are assigned to (host, services, service sets, etc.)

Is there a module, a search, or a command that can return these sorts of connections as there is no way of simply see this from the GUI.

I know that the versions running on my instance are a bit old, but from fiddling around with newer versions I could see the same problem.

BTW, I have one master with no nodes (satellites) and no fancy stuff - just a simple, all in one and one in all (:slight_smile:) server.

The boring details:

  • Icinga Web 2 version: 2.7.4
  • director: 1.8.0, doc/monitoring: 2.7.4, graphite: 1.1.0, incubator: 0.6.0, ipl: v0.5.0, reactbundle: 0.9.0
  • Web browser used: edge, chrome, firefox. etc.
  • Icinga 2 version: 2.12.2-1
  • PHP version used: 7.1.33
  • Server operating: CentOS 6.8 (Final)

Thank you,
IT guy

This is why I keep icingaweb2 roles and teams in Director synchronized.
In my case the answer is: every Host and Service you can see, can send you messages.

Hello @rivad,

Thank you for your answer, although I think I wasn’t clear enough, or didn’t understand your answer.

All hosts and services have checks that send notifications based on the threshold levels of these checks.

Now, if for example Jane Doe approaches me and asks for all the hosts and services that she might get notification from, I have no way of knowing that.

I can see her contact (not user) and to which contact-groups it is assigned, but there is no one place I can see which hosts and which services these groups are assigned to (apart from going over ~650 hosts and ~2000 services manually)

My Icinga is not synced to any AD nor do I manage users from other sources.
All contacts and contacts groups were created under Icinga Director.

Quick Edit: All contacts are defined as contacts only and not users that can login to Icinga.
They only get notifications for the relevant host or services for them with all the info contained in the message.
If they still require access to Icinga, they can use a view-only user.

Best regards,
Assaf

I think I got you the first time.

I only give users, the rights to see stuff if they’re in the notification group so I don’t need to hunt for the answer to your question.

I would try to break the problem apart.

Fist the easy query, in the icinga2 console search for the user in the notification for hosts and services.

Then search for the notification groups the user is a member of.

Then search for the hosts and services with notification groups from just found.

For a one shot thing and discovery use the console but for reproducibility use the REST API.

what about:

https://your-icinga/icingaweb2/monitoring/list/hosts?host_contact=*Nicolas*&modifyFilter=1

the username is case sensitive!
you can do the same for contactgroups and export to csv

this also works for services…

https://your-icinga/icingaweb2/monitoring/list/services?service_contact=*Nicolas*&modifyFilter=1

3 Likes

YES YES YES YES
Thank you @moreamazingnick !!!
You just made my life so much easier (relatively :smiley:)

Best regards,
IT guy

Hello @moreamazingnick,

This is working great with the examples you’ve provided.

I am trying to apply the same to contact groups, but my search is coming up empty.

What am I doing wrong:

https://your-icinga/icingaweb2/monitoring/list/hosts?host_contactgroup=*SomeGroup*&modifyFilter=1

Best regards,
IT guy

https://your-icigna/icingaweb2/monitoring/list/hosts?host_contactgroup=*test*&modifyFilter=1

works for me

is the contact group visible in the Notification part of your host?

Hello @moreamazingnick,

Sorry for the delay as I was engaged with other projects.
Yes, the contact group is visible in the Notification part of the host (and service).
For some reason nothing comes up when searching contact groups.

Best regards,
IT guy