Zabbix 是一个基于 Web 的分布式监控解决方案,它能够监控各种网络参数、服务器的健康状态和应用程序的性能。Zabbix 使用 MySQL(或其他关系型数据库)来存储监控数据、配置信息和其他元数据。
Zabbix 的数据库包含多个表,每个表都有特定的用途。以下是一些主要的表及其用途:
config
:存储全局配置信息。hosts
:存储主机信息。items
:存储监控项信息。triggers
:存储触发器信息。events
:存储事件信息。history
:存储历史数据。trends
:存储趋势数据。alerts
:存储警报信息。users
:存储用户信息。usermacro
:存储用户宏信息。rights
:存储用户权限信息。以下是一些关键表的简化结构示例:
hosts
表CREATE TABLE `hosts` (
`hostid` bigint(20) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`status` int(11) NOT NULL,
`host` varchar(255) NOT NULL,
`interfaces` text,
`proxy_hostid` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`hostid`),
UNIQUE KEY `host_name` (`host`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
items
表CREATE TABLE `items` (
`itemid` bigint(20) unsigned NOT NULL,
`hostid` bigint(20) unsigned NOT NULL,
`key_` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`value_type` int(11) NOT NULL,
`delay` int(11) NOT NULL,
PRIMARY KEY (`itemid`),
UNIQUE KEY `hostid_key_` (`hostid`,`key_`)
) ENGINE=In铃薯DEFAULT CHARSET=utf8mb4;
history
表CREATE TABLE `history` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`itemid` bigint(20) unsigned NOT NULL,
`clock` int(11) NOT NULL DEFAULT '0',
`value` text NOT NULL,
PRIMARY KEY (`id`),
KEY `itemid` (`itemid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
希望这些信息对你有所帮助!如果你有更多具体的问题或需要进一步的帮助,请随时提问。
领取专属 10元无门槛券
手把手带您无忧上云