Nagios database host Related information query

Source: Internet
Author: User

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 * fromnagios_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 * FROMnagios_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 |

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.