https://www.cnblogs.com/yaoyaojcy/p/10367945.html
1. 查看目前zabbix系統所有數據表:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
[root@localhost /]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id
is
170786
Server version: 5.5.60-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type
'help;'
or
'\h'
for
help. Type
'\c'
to clear the current input statement.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
| zabbix |
+--------------------+
5 rows
in
set
(0.01 sec)
MariaDB [(none)]> use zabbix
Reading table information
for
completion of table and column names
You can turn off
this
feature to
get
a quicker startup with -A
Database changed
MariaDB [zabbix]> show tables;
+----------------------------+
| Tables_in_zabbix |
+----------------------------+
| acknowledges |
| actions |
| alerts |
| application_discovery |
| application_prototype |
| application_template |
| applications |
| auditlog |
| auditlog_details |
| autoreg_host |
| conditions |
| config |
| corr_condition |
| corr_condition_group |
| corr_condition_tag |
| corr_condition_tagpair |
| corr_condition_tagvalue |
| corr_operation |
| correlation |
| dashboard |
| dashboard_user |
| dashboard_usrgrp |
| dbversion |
| dchecks |
| dhosts |
| drules |
| dservices |
| escalations |
| event_recovery |
| event_suppress |
| event_tag |
| events |
| expressions |
| functions |
| globalmacro |
| globalvars |
| graph_discovery |
| graph_theme |
| graphs |
| graphs_items |
| group_discovery |
| group_prototype |
| history |
| history_log |
| history_str |
| history_text |
| history_uint |
| host_discovery |
| host_inventory |
| hostmacro |
| hosts |
| hosts_groups |
| hosts_templates |
| housekeeper |
| hstgrp |
| httpstep |
| httpstep_field |
| httpstepitem |
| httptest |
| httptest_field |
| httptestitem |
| icon_map |
| icon_mapping |
| ids |
| images |
|
interface
|
| interface_discovery |
| item_application_prototype |
| item_condition |
| item_discovery |
| item_preproc |
| items |
| items_applications |
| maintenance_tag |
| maintenances |
| maintenances_groups |
| maintenances_hosts |
| maintenances_windows |
| mappings |
| media |
| media_type |
| opcommand |
| opcommand_grp |
| opcommand_hst |
| opconditions |
| operations |
| opgroup |
| opinventory |
| opmessage |
| opmessage_grp |
| opmessage_usr |
| optemplate |
| problem |
| problem_tag |
| profiles |
| proxy_autoreg_host |
| proxy_dhistory |
| proxy_history |
| regexps |
| rights |
| screen_user |
| screen_usrgrp |
| screens |
| screens_items |
| scripts |
| service_alarms |
| services |
| services_links |
| services_times |
| sessions |
| slides |
| slideshow_user |
| slideshow_usrgrp |
| slideshows |
| sysmap_element_trigger |
| sysmap_element_url |
| sysmap_shape |
| sysmap_url |
| sysmap_user |
| sysmap_usrgrp |
| sysmaps |
| sysmaps_elements |
| sysmaps_link_triggers |
| sysmaps_links |
| tag_filter |
| task |
| task_acknowledge |
| task_check_now |
| task_close_problem |
| task_remote_command |
| task_remote_command_result |
| timeperiods |
| trends |
| trends_uint |
| trigger_depends |
| trigger_discovery |
| trigger_tag |
| triggers |
| users |
| users_groups |
| usrgrp |
| valuemaps |
| widget |
| widget_field |
+----------------------------+
144 rows
in
set
(0.00 sec)
MariaDB [zabbix]>
|
2. 查看hosts數據表
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
MariaDB [zabbix]> show create table hosts \G;
*************************** 1. row ***************************
Table: hosts
Create Table: CREATE TABLE `hosts` (
`hostid` bigint(20) unsigned NOT NULL,
`proxy_hostid` bigint(20) unsigned DEFAULT NULL,
`host` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`status`
int
(11) NOT NULL DEFAULT
'0'
,
`disable_until`
int
(11) NOT NULL DEFAULT
'0'
,
`error` varchar(2048) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`available`
int
(11) NOT NULL DEFAULT
'0'
,
`errors_from`
int
(11) NOT NULL DEFAULT
'0'
,
`lastaccess`
int
(11) NOT NULL DEFAULT
'0'
,
`ipmi_authtype`
int
(11) NOT NULL DEFAULT
'-1'
,
`ipmi_privilege`
int
(11) NOT NULL DEFAULT
'2'
,
`ipmi_username` varchar(16) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`ipmi_password` varchar(20) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`ipmi_disable_until`
int
(11) NOT NULL DEFAULT
'0'
,
`ipmi_available`
int
(11) NOT NULL DEFAULT
'0'
,
`snmp_disable_until`
int
(11) NOT NULL DEFAULT
'0'
,
`snmp_available`
int
(11) NOT NULL DEFAULT
'0'
,
`maintenanceid` bigint(20) unsigned DEFAULT NULL,
`maintenance_status`
int
(11) NOT NULL DEFAULT
'0'
,
`maintenance_type`
int
(11) NOT NULL DEFAULT
'0'
,
`maintenance_from`
int
(11) NOT NULL DEFAULT
'0'
,
`ipmi_errors_from`
int
(11) NOT NULL DEFAULT
'0'
,
`snmp_errors_from`
int
(11) NOT NULL DEFAULT
'0'
,
`ipmi_error` varchar(2048) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`snmp_error` varchar(2048) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`jmx_disable_until`
int
(11) NOT NULL DEFAULT
'0'
,
`jmx_available`
int
(11) NOT NULL DEFAULT
'0'
,
`jmx_errors_from`
int
(11) NOT NULL DEFAULT
'0'
,
`jmx_error` varchar(2048) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`name` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`flags`
int
(11) NOT NULL DEFAULT
'0'
,
`templateid` bigint(20) unsigned DEFAULT NULL,
`description` text COLLATE utf8_bin NOT NULL,
`tls_connect`
int
(11) NOT NULL DEFAULT
'1'
,
`tls_accept`
int
(11) NOT NULL DEFAULT
'1'
,
`tls_issuer` varchar(1024) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`tls_subject` varchar(1024) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`tls_psk_identity` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`tls_psk` varchar(512) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`proxy_address` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`auto_compress`
int
(11) NOT NULL DEFAULT
'1'
,
PRIMARY KEY (`hostid`),
KEY `hosts_1` (`host`),
KEY `hosts_2` (`status`),
KEY `hosts_3` (`proxy_hostid`),
KEY `hosts_4` (`name`),
KEY `hosts_5` (`maintenanceid`),
KEY `c_hosts_3` (`templateid`),
CONSTRAINT `c_hosts_3` FOREIGN KEY (`templateid`) REFERENCES `hosts` (`hostid`) ON DELETE CASCADE,
CONSTRAINT `c_hosts_1` FOREIGN KEY (`proxy_hostid`) REFERENCES `hosts` (`hostid`),
CONSTRAINT `c_hosts_2` FOREIGN KEY (`maintenanceid`) REFERENCES `maintenances` (`maintenanceid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
1 row
in
set
(0.00 sec)
ERROR: No query specified
|
3. 查看interface數據表
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
MariaDB [zabbix]> show create table
interface
\G;
*************************** 1. row ***************************
Table:
interface
Create Table: CREATE TABLE `
interface
` (
`interfaceid` bigint(20) unsigned NOT NULL,
`hostid` bigint(20) unsigned NOT NULL,
`main`
int
(11) NOT NULL DEFAULT
'0'
,
`type`
int
(11) NOT NULL DEFAULT
'0'
,
`useip`
int
(11) NOT NULL DEFAULT
'1'
,
`ip` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
'127.0.0.1'
,
`dns` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`port` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
'10050'
,
`bulk`
int
(11) NOT NULL DEFAULT
'1'
,
PRIMARY KEY (`interfaceid`),
KEY `interface_1` (`hostid`,`type`),
KEY `interface_2` (`ip`,`dns`),
CONSTRAINT `c_interface_1` FOREIGN KEY (`hostid`) REFERENCES `hosts` (`hostid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
1 row
in
set
(0.00 sec)
ERROR: No query specified
|
目前zabbix系統監控2台主機:
查看一下hostid 10263 信息:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
MariaDB [zabbix]>
select
*
from
interface
a inner
join
hosts b
on
a.hostid=b.hostid
where
a.hostid=10263 \G;
*************************** 1. row ***************************
interfaceid: 3
hostid: 10263
main: 1
type: 2
useip: 1
ip: 172.18.100.25
dns:
port: 161
bulk: 1
hostid: 10263
proxy_hostid: NULL
host: CARLOS_test_100.25
status: 0
disable_until: 0
error:
available: 0
errors_from: 0
lastaccess: 0
ipmi_authtype: -1
ipmi_privilege: 2
ipmi_username:
ipmi_password:
ipmi_disable_until: 0
ipmi_available: 0
snmp_disable_until: 0
snmp_available: 1
maintenanceid: NULL
maintenance_status: 0
maintenance_type: 0
maintenance_from: 0
ipmi_errors_from: 0
snmp_errors_from: 0
ipmi_error:
snmp_error:
jmx_disable_until: 0
jmx_available: 0
jmx_errors_from: 0
jmx_error:
name: CARLOS_test_100.25
flags: 0
templateid: NULL
description:
tls_connect: 1
tls_accept: 1
tls_issuer:
tls_subject:
tls_psk_identity:
tls_psk:
proxy_address:
auto_compress: 1
|
4. 查看items數據表
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
MariaDB [zabbix]> show create table items \G;
*************************** 1. row ***************************
Table: items
Create Table: CREATE TABLE `items` (
`itemid` bigint(20) unsigned NOT NULL,
`type`
int
(11) NOT NULL DEFAULT
'0'
,
`snmp_community` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`snmp_oid` varchar(512) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`hostid` bigint(20) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`key_` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`delay` varchar(1024) COLLATE utf8_bin NOT NULL DEFAULT
'0'
,
`history` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
'90d'
,
`trends` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
'365d'
,
`status`
int
(11) NOT NULL DEFAULT
'0'
,
`value_type`
int
(11) NOT NULL DEFAULT
'0'
,
`trapper_hosts` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`units` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`snmpv3_securityname` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`snmpv3_securitylevel`
int
(11) NOT NULL DEFAULT
'0'
,
`snmpv3_authpassphrase` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`snmpv3_privpassphrase` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`formula` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`error` varchar(2048) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`lastlogsize` bigint(20) unsigned NOT NULL DEFAULT
'0'
,
`logtimefmt` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`templateid` bigint(20) unsigned DEFAULT NULL,
`valuemapid` bigint(20) unsigned DEFAULT NULL,
`
params
` text COLLATE utf8_bin NOT NULL,
`ipmi_sensor` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`authtype`
int
(11) NOT NULL DEFAULT
'0'
,
`username` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`password` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`publickey` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`privatekey` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`mtime`
int
(11) NOT NULL DEFAULT
'0'
,
`flags`
int
(11) NOT NULL DEFAULT
'0'
,
`interfaceid` bigint(20) unsigned DEFAULT NULL,
`port` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`description` text COLLATE utf8_bin NOT NULL,
`inventory_link`
int
(11) NOT NULL DEFAULT
'0'
,
`lifetime` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
'30d'
,
`snmpv3_authprotocol`
int
(11) NOT NULL DEFAULT
'0'
,
`snmpv3_privprotocol`
int
(11) NOT NULL DEFAULT
'0'
,
`state`
int
(11) NOT NULL DEFAULT
'0'
,
`snmpv3_contextname` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`evaltype`
int
(11) NOT NULL DEFAULT
'0'
,
`jmx_endpoint` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`master_itemid` bigint(20) unsigned DEFAULT NULL,
`timeout` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
'3s'
,
`url` varchar(2048) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`query_fields` varchar(2048) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`posts` text COLLATE utf8_bin NOT NULL,
`status_codes` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
'200'
,
`follow_redirects`
int
(11) NOT NULL DEFAULT
'1'
,
`post_type`
int
(11) NOT NULL DEFAULT
'0'
,
`http_proxy` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`headers` text COLLATE utf8_bin NOT NULL,
`retrieve_mode`
int
(11) NOT NULL DEFAULT
'0'
,
`request_method`
int
(11) NOT NULL DEFAULT
'0'
,
`output_format`
int
(11) NOT NULL DEFAULT
'0'
,
`ssl_cert_file` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`ssl_key_file` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`ssl_key_password` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT
''
,
`verify_peer`
int
(11) NOT NULL DEFAULT
'0'
,
`verify_host`
int
(11) NOT NULL DEFAULT
'0'
,
`allow_traps`
int
(11) NOT NULL DEFAULT
'0'
,
PRIMARY KEY (`itemid`),
UNIQUE KEY `items_1` (`hostid`,`key_`),
KEY `items_3` (`status`),
KEY `items_4` (`templateid`),
KEY `items_5` (`valuemapid`),
KEY `items_6` (`interfaceid`),
KEY `items_7` (`master_itemid`),
CONSTRAINT `c_items_5` FOREIGN KEY (`master_itemid`) REFERENCES `items` (`itemid`) ON DELETE CASCADE,
CONSTRAINT `c_items_1` FOREIGN KEY (`hostid`) REFERENCES `hosts` (`hostid`) ON DELETE CASCADE,
CONSTRAINT `c_items_2` FOREIGN KEY (`templateid`) REFERENCES `items` (`itemid`) ON DELETE CASCADE,
CONSTRAINT `c_items_3` FOREIGN KEY (`valuemapid`) REFERENCES `valuemaps` (`valuemapid`),
CONSTRAINT `c_items_4` FOREIGN KEY (`interfaceid`) REFERENCES `
interface
` (`interfaceid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
|
查看當前zabbix系統items數量:
1
|
select
count(*)
from
interface
a inner
join
hosts b
on
a.hostid=b.hostid inner
join
items c
on
c.hostid=a.hostid
where
a.hostid=10263 \G;
|
查看當前zabbix系統單台主機key值與cpu相關:
1
2
|
select
c.key_,b.hostid,a.ip
from
interface
a inner
join
hosts b
on
a.hostid=b.hostid inner
join
items c
on
c.hostid=a.hostid
where
a.hostid=
10263 and c.key_ like
"%cpu%"
\G;
|
查看一下與主機相關聯的模板數:
1
|
show tables like
"%host%"
;
|
1
|
select
*
from
hosts_templates;
|
以上顯示主機hostid=10263一共關聯6個模板,在zabbix頁面確認一下:
5. 查看目前zabbix系統history表:
1
|
select
*
from
history
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
MariaDB [zabbix]>
select
*
from
items
where
itemid=28565 and value_type=0 \G;
*************************** 1. row ***************************
itemid: 28565
type: 3
snmp_community:
snmp_oid:
hostid: 10263
name: ICMP response time
key_: icmppingsec
delay: 60s
history: 90d
trends: 365d
status: 0
value_type: 0
trapper_hosts:
units:
snmpv3_securityname:
snmpv3_securitylevel: 0
snmpv3_authpassphrase:
snmpv3_privpassphrase:
formula:
error:
lastlogsize: 0
logtimefmt:
templateid: 28511
valuemapid: NULL
params
:
ipmi_sensor:
authtype: 0
username:
password:
publickey:
privatekey:
mtime: 0
flags: 0
interfaceid: 3
port:
description:
inventory_link: 0
lifetime: 30d
snmpv3_authprotocol: 0
snmpv3_privprotocol: 0
state: 0
snmpv3_contextname:
evaltype: 0
jmx_endpoint:
master_itemid: NULL
timeout: 3s
url:
query_fields:
posts:
status_codes: 200
follow_redirects: 1
post_type: 0
http_proxy:
headers:
retrieve_mode: 0
request_method: 0
output_format: 0
ssl_cert_file:
ssl_key_file:
ssl_key_password:
verify_peer: 0
verify_host: 0
allow_traps: 0
|
6. 查看目前zabbix系統triggers表:

自學Zabbix之路15.1 Zabbix數據庫表結構簡單解析-Hosts表、Hosts_groups表、Interface表
說在前面:
- 數據庫中的表的名稱都是復數,比如存放Host信息的表的名字是Hosts等。
- 數據庫操作有風險,一旦出問題會造成Zabbix crash。需要謹慎操作。
- 普通的查詢可以在備庫上進行。兩邊數據是實時同步的。
概述:
- Zabbix數據庫共有108個表,表的名稱都是復數的。
- 針對Zabbix中的每一個資源,都有一張表與其對應,比如hosts表,items表等。
- 每一張表中都有一個id字段,如hosts表中的hostid,items中的itemid等。而資源之間的關聯關系是通過外鍵來完成的。
- 資源之間的關聯關系是通過外鍵來完成的。比如host和item的關聯關系,就是在items表中使用hostid與hosts表中的資源進行關聯。
1. Hosts表
“host”就是一台被監控的對象。
Hosts表結構如下:
- Hostid:唯一標識Host在Zabbix及數據庫中的id。不同表之間的關聯也要用id。
- Proxy_hostid:若啟用“proxy-server”架構,才會出現被監控機器的proxy_hostid。
- Host:被監控機器的名字。
- Dns:DNS的名稱。
- Useip:是否用ip監控。
- Port:監控的端口。
- Status:機器目前的狀態。“0”為正常監控,“1”為disable。
- disable_util,error,available,errors_from(ipmi_disable_util,ipmi_error…和 snmp_disable_until…都是此類):這幾個都是Zabbix Poller會去修改的值。我看了下poller.c的代碼,當poller在第一次取不到值(根據值的類型不同會更新相應的列,Item類型為snmp就會更新snmp_XXX,默認為“zabbix”類型)的時候,會等15秒(CONFIG_UNREACHABLE_DELAY)來重試,並且日志會顯示“first network error”,如果15秒后依然取不到值,zabbix會在數據庫更新這個host取不到值的信息,即這幾列。並且日志里顯示“another network error”。
- Lastacess:表示proxy最后一次工作的時間。這里的“工作”指Zabbix Server收到Proxy數據。
- Ipmi*、snmp*、jmx*為使用這三種監控方式時的監控記錄。
- maintenanceid,maintenance_*:這是Zabbix另一個機制Maintaince有關,用於使Host 置於維護狀態而不會報警。
簡單針對Host的操作:
更新機器的proxy。找到proxy的hostid,更新對用host的proxy_hostid:
select hostid from hosts where host='ProxyA' and ip='0.0.0.0'; -- get hostid: 1234
update hosts set proxy_hostid=1234 where host='Host_To_Update_Proxy';
得到更新的Host狀態(enable/disable)如下:
update hosts set status='0' where host='Host_To_Enable';
update hosts set status='1' where host='Host_To_Disable';
2.Hosts_groups 表
hosts_groups保存了host(主機)與host groups(主機組)的關聯關系。
這部分信息可以在我們自己做一些批量查詢,例如查詢關聯到某個主機組的所有設備的IP 、存活狀態等,進一步去查詢該批量設備的load、IO、mem等統計信息。
3.Interface表
Interface表用於存儲每一個host的接口信息,此表與hosts表分離,方便了用戶修改信息與管理。
自學Zabbix之路15.2 Zabbix數據庫表結構簡單解析-Items表
Items表記錄了item的所有設置。在Zabbix中,最多的操作就是對items的。如添加監控項、刪除監控項、更新監控配置等。