Report on child relationships

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
smetzler
Posts: 27
Joined: Mon Apr 15, 2019 11:06 am

Report on child relationships

Post by smetzler »

Hello,

I was wondering if there is an easy way to get a report of all child relationships (hosts) for a parent host. For example, I want to generate a list of every device (host) connected to a switch. All of the hosts are entered correctly but we have so many, I am trying to simply get a list of all child devices off a single switch. I tried using the Hypermap but we have too many devices.

Thank you,

Shane
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Report on child relationships

Post by cdienger »

This should do the trick(replace 'localhost' with the actual parent host):

Code: Select all

echo "select nagios_hosts.display_name from ((nagios_objects INNER JOIN nagios_host_parenthosts ON nagios_objects.object_id=nagios_host_parenthosts.parent_host_object_id)INNER JOIN nagios_hosts ON nagios_host_parenthosts.host_id = nagios_hosts.host_id) where nagios_objects.name1='localhost';" | mysql -uroot -pnagiosxi -Dnagios
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
smetzler
Posts: 27
Joined: Mon Apr 15, 2019 11:06 am

Re: Report on child relationships

Post by smetzler »

Thank you for the code and I apologize for the following newbie question, but where do I run that from? The SSH console?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Report on child relationships

Post by cdienger »

Yes, run it from the command line of the XI machine.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
smetzler
Posts: 27
Joined: Mon Apr 15, 2019 11:06 am

Re: Report on child relationships

Post by smetzler »

Thank you so much! That worked perfectly!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Report on child relationships

Post by cdienger »

Glad to hear!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked