mysql> select a.host_object_id,a.display_name,a.address,b.hostgroup_id,b.alias from nagios_hosts a,nagios_hostgroups b,nagios_hostgroup_members c where c.host_object_id=a.host_object_id and c.hostgroup_id=b.hostgroup_id order by b.hostgroup_id;
+----------------+--------------+----------------+--------------+--------------------------+
| host_object_id | display_name | address | hostgroup_id | alias |
+----------------+--------------+----------------+--------------+--------------------------+
| 1 | localhost | 127.0.0.1 | 246 | All Servers |
| 2 | nagios-host | 192.168.21.103 | 246 | All Servers |
| 223 | zcliushh | 192.168.21.109 | 246 | All Servers |
| 1 | localhost | 127.0.0.1 | 247 | Debian GNU/Linux Servers |
| 1 | localhost | 127.0.0.1 | 248 | HTTP servers |
| 2 | nagios-host | 192.168.21.103 | 249 | sa Servers |
| 1 | localhost | 127.0.0.1 | 250 | SSH servers |
+----------------+--------------+----------------+--------------+--------------------------+
7 rows in set (0.00 sec)
mysql> select * from nagios_hostgroups;
+--------------+-------------+-------------+---------------------+--------------------------+
| hostgroup_id | instance_id | config_type | hostgroup_object_id | alias |
+--------------+-------------+-------------+---------------------+--------------------------+
| 246 | 1 | 1 | 211 | All Servers |
| 247 | 1 | 1 | 212 | Debian GNU/Linux Servers |
| 248 | 1 | 1 | 213 | HTTP servers |
| 249 | 1 | 1 | 214 | sa Servers |
| 250 | 1 | 1 | 215 | SSH servers |
+--------------+-------------+-------------+---------------------+--------------------------+
5 rows in set (0.00 sec)
mysql> select * from nagios_hostgroup_members;
+---------------------+-------------+--------------+----------------+
| hostgroup_member_id | instance_id | hostgroup_id | host_object_id |
+---------------------+-------------+--------------+----------------+
| 311 | 1 | 246 | 1 |
| 312 | 1 | 246 | 2 |
| 313 | 1 | 246 | 223 |
| 314 | 1 | 247 | 1 |
| 315 | 1 | 248 | 1 |
| 316 | 1 | 249 | 2 |
| 317 | 1 | 250 | 1 |
+---------------------+-------------+--------------+----------------+
7 rows in set (0.00 sec)
mysql> select * from nagios_hosts;
| host_object_id | alias | display_name | address |