List Hosts/Services using Individual Contacts for alerts?
List Hosts/Services using Individual Contacts for alerts?
We tend to use Contact Groups to send alert notifications, however, I've discovered a few Hosts/Services where other Administrators have been using Other Individual Contacts. I'm looking for a suggestion on how to list all Hosts/Services that are using Individual Contacts for notifications?
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
Nagios Fusion 2024R1.0.2
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: List Hosts/Services using Individual Contacts for alerts
I believe the below 2 queries should get you the info you need from the nagiosql database
Hosts
Services
Code: Select all
mysql -pnagiosxi nagiosqlCode: Select all
SELECT host_name
FROM tbl_contact, tbl_host, tbl_lnkHostToContact
WHERE tbl_host.id = tbl_lnkHostToContact.idMaster
GROUP BY host_nameCode: Select all
SELECT tbl_host.host_name, service_description
FROM tbl_contact, tbl_host, tbl_service, tbl_lnkServiceToContact, tbl_lnkServiceToHost
WHERE tbl_service.id = tbl_lnkServiceToHost.idMaster
AND tbl_host.id = tbl_lnkServiceToHost.idSlave
AND tbl_service.id = tbl_lnkServiceToContact.idMaster
GROUP BY tbl_host.host_name, service_description