Hosts and services as they correlate to contact groups

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
wjoyner
Posts: 32
Joined: Thu Mar 22, 2018 7:28 am

Hosts and services as they correlate to contact groups

Post by wjoyner »

Is there a way to get a complete list in nagios of what contact group is assigned to a host?
From what I can see the problem overview would show the host/service and who gets alerted based on contact group.
If you look up the specific contact group, it only shows the group members, not the host/service association.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Hosts and services as they correlate to contact groups

Post by tgriep »

The following mysql query will show the running hosts and the contact_groups that are assigned to them.
Run it as root and it will output a table that you can use to get that information.

Code: Select all

/usr/bin/mysql -u root -pnagiosxi  -e 'SELECT  nagios.nagios_hosts.host_object_id,nagios.nagios_host_contactgroups.host_id,nagios.nagios_host_contactgroups.contactgroup_object_id,nagios.nagios_contactgroups.contactgroup_object_id,nagios.nagios_hosts.alias,nagios_hosts.display_name,nagios_contactgroups.alias FROM ((nagios.nagios_hosts INNER JOIN nagios.nagios_host_contactgroups ON nagios.nagios_hosts.host_id = nagios.nagios_host_contactgroups.host_id) INNER JOIN nagios.nagios_contactgroups ON nagios.nagios_host_contactgroups.contactgroup_object_id =  nagios.nagios_contactgroups.contactgroup_object_id);'
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked