others linux服务器运维 django3 监控 k8s golang 数据库 大数据 前端 devops 理论基础 java oracle 运维日志

zabbix 从数据库中查看监控数据

访问量:1108 创建时间:2021-09-08
###查看主机id
MariaDB [zabbix]> select  host,hostid  from  hosts  where  host= 'Zabbix server';
+---------------+--------+
| host          | hostid |
+---------------+--------+
| Zabbix server |  10084 |
+---------------+--------+
###查看监控项id
MariaDB [zabbix]> select  itemid, name ,key_  from  items  where  hostid=10084 and key_= "net.if.out[ens32]";
+--------+-----------------------------------+-------------------+
| itemid | name                              | key_              |
+--------+-----------------------------------+-------------------+
|  28611 | Outgoing network traffic on ens32 | net.if.out[ens32] |
+--------+-----------------------------------+-------------------+
### 查询数据
select clock ,value from  history_uint   where  itemid='28611' and from_unixtime(clock)>='2021-09-07' and from_unixtime(clock)< '2021-09-09'
登陆评论: 使用GITHUB登陆