zabbix表結構 前端
一、acknowledgesmysql
記錄告警的確認信息sql
二、actionsexpress
記錄了當觸發器觸發時,須要採用的動做。後端
mysql> desc actions;
+---------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+---------------------+------+-----+---------+-------+
| actionid | bigint(20) unsigned | NO | PRI | 0 | | | name | varchar(255) | NO | | | | | eventsource | int(11) | NO | MUL | 0 | | | evaltype | int(11) | NO | | 0 | | | status | int(11) | NO | | 0 | | | esc_period | int(11) | NO | | 0 | | | def_shortdata | varchar(255) | NO | | | | | def_longdata | blob | NO | | NULL | | | recovery_msg | int(11) | NO | | 0 | | | r_shortdata | varchar(255) | NO | | | | | r_longdata | blob | NO | | NULL | | +---------------+---------------------+------+-----+---------+-------+
actionid:動做ID
name:動做名稱
eventsource:
三、alerts 報警信息表(好比郵件報警信息)api
mysql> desc alerts;
+-------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+---------------------+------+-----+---------+-------+ | alertid | bigint(20) unsigned | NO | PRI | 0 | | | actionid | bigint(20) unsigned | NO | MUL | 0 | | | eventid | bigint(20) unsigned | NO | MUL | 0 | | | userid | bigint(20) unsigned | NO | MUL | 0 | | | clock | int(11) | NO | PRI | 0 | | | mediatypeid | bigint(20) unsigned | NO | MUL | 0 | | | sendto | varchar(100) | NO | | | | | subject | varchar(255) | NO | | | | | message | blob | NO | | NULL | | | status | int(11) | NO | MUL | 0 | | | retries | int(11) | NO | | 0 | | | error | varchar(128) | NO | | | | | esc_step | int(11) | NO | | 0 | | | alerttype | int(11) | NO | | 0 | | +-------------+---------------------+------+-----+---------+-------+
alertid: 報警IDsession
actionid: 動做IDapp
eventid: 事件IDflex
userid: 報警用戶idui
clock: 報警事件,時間戳格式
mediatypeid: 報警類型
sendto:報警信息的發送地址
subject:報警標題
message:報警內容
status:發送狀態。2失敗,1成功,0發送中
retries:重發次數
error:錯誤信息
esc_step:操做類型,0成功報警,1失敗報警
alerttype:報警類型,0郵件報警
三、application 系類:應用集表
application_template
applications
四、audit
auditlog
auditlog_details
autoreg_host
五、conditions 動做條件信息表
六、config
config表保存了全局的參數,前端包括後端也是,不少狀況下會查詢改表的參數的,例如用戶的自定義主題、
登錄認證類型等,很是重要.
不過對咱們作數據分析意義不大
七、dbversion
八、dchecks
dhosts
drules
dservices
九、escalations
十、events
十一、expressions
十二、functions 觸發器表達式
1三、globalmacro
globalvars
1四、graph_discovery
graph_theme
graphs
graphs_items
1五、groups 組名和組ID
mysql> desc groups ; +----------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+---------------------+------+-----+---------+-------+ | groupid | bigint(20) unsigned | NO | PRI | 0 | | | name | varchar(64) | NO | MUL | | | | internal | int(11) | NO | | 0 | | +----------+---------------------+------+-----+---------+-------+
internal:不知道
flag: 0主機,1模板
group_discovery
group_prototype
1六、history歷史表信息
相似表還有:history_log、history_str、history_str_sync、history_sync、history_text、history_unit、history_unit_sync
mysql> desc history;
+--------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+---------------------+------+-----+---------+-------+ | itemid | bigint(20) unsigned | NO | PRI | 0 | | | clock | int(11) | NO | PRI | 0 | | | value | double(16,4) | NO | | 0.0000 | | +--------+---------------------+------+-----+---------+-------+ mysql> desc history_str; +--------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+---------------------+------+-----+---------+-------+ | itemid | bigint(20) unsigned | NO | MUL | 0 | | | clock | int(11) | NO | | 0 | | | value | varchar(255) | NO | | | | +--------+---------------------+------+-----+---------+-------+
這些表與監控項表 items中value_type關聯.
0:numeric float 1:character 2:log 3:numeric unsigned 4:text
value_type 爲0,表示監控項存於表history
value_type 爲1,表示監控項存於表history_str
value_type 爲2,表示監控項存於表history_log
value_type 爲3,表示監控項存於表history_uint
value_type 爲4,表示監控項存於表history_text
1七、host_discovery
host_inventory
hostmacro
1八、hosts 主機信息
hosts_groups 主機羣組的關聯信息
hosts_templates
mysql> desc hosts;
+--------------------+---------------------+------+-----+-----------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+---------------------+------+-----+-----------+-------+
| hostid | bigint(20) unsigned | NO | PRI | 0 | | | proxy_hostid | bigint(20) unsigned | NO | MUL | 0 | | | host | varchar(64) | NO | MUL | | | | dns | varchar(64) | NO | | | | | useip | int(11) | NO | | 1 | | | ip | varchar(39) | NO | | 127.0.0.1 | | | port | int(11) | NO | | 10050 | | | status | int(11) | NO | MUL | 0 | | | disable_until | int(11) | NO | | 0 | | | error | varchar(128) | NO | | | | | available | int(11) | NO | | 0 | | | errors_from | int(11) | NO | | 0 | | | lastaccess | int(11) | NO | | 0 | | | inbytes | bigint(20) unsigned | NO | | 0 | | | outbytes | bigint(20) unsigned | NO | | 0 | | | useipmi | int(11) | NO | | 0 | | | ipmi_port | int(11) | NO | | 623 | | | ipmi_authtype | int(11) | NO | | 0 | | | ipmi_privilege | int(11) | NO | | 2 | | | ipmi_username | varchar(16) | NO | | | | | ipmi_password | varchar(20) | NO | | | | | ipmi_disable_until | int(11) | NO | | 0 | | | ipmi_available | int(11) | NO | | 0 | | | snmp_disable_until | int(11) | NO | | 0 | | | snmp_available | int(11) | NO | | 0 | | | maintenanceid | bigint(20) unsigned | NO | | 0 | | | maintenance_status | int(11) | NO | | 0 | | | maintenance_type | int(11) | NO | | 0 | | | maintenance_from | int(11) | NO | | 0 | | | ipmi_ip | varchar(64) | NO | | 127.0.0.1 | | | ipmi_errors_from | int(11) | NO | | 0 | | | snmp_errors_from | int(11) | NO | | 0 | | | ipmi_error | varchar(128) | NO | | | | | snmp_error | varchar(128) | NO | | | | +--------------------+---------------------+------+-----+-----------+-------+
host : 主機名稱
status:主機狀態,檢測中
1九、interface 主機-接口信息
hostid:主機ID
ip:ip信息
port:端口
20、items監控項信息表
mysql> desc items ;
+-----------------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------+---------------------+------+-----+---------+-------+ | itemid | bigint(20) unsigned | NO | PRI | 0 | | | type | int(11) | NO | | 0 | | | snmp_community | varchar(64) | NO | | | | | snmp_oid | varchar(255) | NO | | | | | snmp_port | int(11) | NO | | 161 | | | hostid | bigint(20) unsigned | NO | MUL | 0 | | | description | varchar(255) | NO | | | | | key_ | varchar(255) | NO | | | | | delay | int(11) | NO | | 0 | | | history | int(11) | NO | | 90 | | | trends | int(11) | NO | | 365 | | | lastvalue | varchar(255) | YES | | NULL | | | lastclock | int(11) | YES | | NULL | | | prevvalue | varchar(255) | YES | | NULL | | | status | int(11) | NO | MUL | 0 | | | value_type | int(11) | NO | | 0 | | | trapper_hosts | varchar(255) | NO | | | | | units | varchar(10) | NO | | | | | multiplier | int(11) | NO | | 0 | | | delta | int(11) | NO | | 0 | | | prevorgvalue | varchar(255) | YES | | NULL | | | snmpv3_securityname | varchar(64) | NO | | | | | snmpv3_securitylevel | int(11) | NO | | 0 | | | snmpv3_authpassphrase | varchar(64) | NO | | | | | snmpv3_privpassphrase | varchar(64) | NO | | | | | formula | varchar(255) | NO | | 1 | | | error | varchar(128) | NO | | | | | lastlogsize | int(11) | NO | | 0 | | | logtimefmt | varchar(64) | NO | | | | | templateid | bigint(20) unsigned | NO | MUL | 0 | | | valuemapid | bigint(20) unsigned | NO | | 0 | | | delay_flex | varchar(255) | NO | | | | | params | text | NO | | NULL | | | ipmi_sensor | varchar(128) | NO | | | | | data_type | int(11) | NO | | 0 | | | authtype | int(11) | NO | | 0 | | | username | varchar(64) | NO | | | | | password | varchar(64) | NO | | | | | publickey | varchar(64) | NO | | | | | privatekey | varchar(64) | NO | | | | | mtime | int(11) | NO | | 0 | | +-----------------------+---------------------+------+-----+---------+-------+
items_applications
item_discovery
2一、media 用戶媒介信息 與media_type 媒介類型表相關
mysql> desc media; +-------------+---------------------+------+-----+-----------------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+---------------------+------+-----+-----------------+-------+ | mediaid | bigint(20) unsigned | NO | PRI | 0 | | | userid | bigint(20) unsigned | NO | MUL | 0 | | | mediatypeid | bigint(20) unsigned | NO | MUL | 0 | | | sendto | varchar(100) | NO | | | | | active | int(11) | NO | | 0 | | | severity | int(11) | NO | | 63 | | | period | varchar(100) | NO | | 1-7,00:00-23:59 | | +-------------+---------------------+------+-----+-----------------+-------+
2二、operations 動做的運行記錄
2三、opmessage 動做操做信息
opmessage_grp
opmessage_usr
2四、profiles 保存了一些用戶的基本配置
2五、rights 保存了用戶的權限信息
2六、sessions 保存了每一個用戶的sessions,在登錄、註銷的時候均會操做 該張表的。2五、triggers 觸發器2六、user 用戶信息