当前位置:网站首页>Zabbix: 将收集到值映射为易读的语句
Zabbix: 将收集到值映射为易读的语句
2022-07-27 06:10:00 【TechForGeek】
Zabbix 是运维中常用的一款开源监控系统。在 Zabbix 中,要从被监控的主机收集数据,需要创建 Item。Zabbix 内置了很多不同类型的 Item,常用的 Item 类型为 Zabbix agent,这种类型的 Item 通过与部署在被监控主机上的 Zabbix agent 通信来收集数据。
Zabbix agent 类型的 Item 支持很多 Item keys, 不同的 Item keys 用来收集不同的数据。例如 agent.hostname 用来收集被监控主机的主机名,proc.mem 用来收集进程的内存使用情况。所有支持的 Item keys 可以参考对应的 Zabbix 文档[1]。
Zabbix agent 类型的 Item keys 中,很多只返回一个数值,用不同的数值来表示被监控主机的不同状态。例如 net.tcp.port 用来检查被监控主机的指定端口是否开放,它返回数值 0 或 1: 0 表示不能连接到指定端口,1表示可以连接到指定端口。
对于通过数值来表示不同状态的 Item,在 Zabbix 的 Latest data 中查看收集到的数据时,有时候我们并不能很清楚地记得,不同的数值表示什么样的含义,就不得不去查阅 Zabbix 文档。如果能够将数值映射为人类易读的语句,那就方便多了。
其实,Zabbix 已经支持这样的功能了,就是 Zabbix 的 Value mapping[2],它可以将 Numeric (unsigned), Numeric (float) 和 Character 类型的值映射为人类易读的语句。
要使用 Value mapping,首先需要创建创建一个 Value map,操作步骤如下:
进入到 Zabbix 控制台,选择 Administration => Genernal
在 General 页面的右上角的下拉列表里,选择 Value mapping
在 Value mapping 页面的右上角,选择 Create value map
填写名称及需要的 Mappings 后,点击 Add 创建即可
下面是我创建的 Value map 的示例图:

之后,在创建 Item (或者修改现有的Item)时,设置 Show value 字段的值为你刚刚创建的 Value map 即可:

设置完成后,在 Zabbix 的 Latest data 中查看对应的 Item,就可以看到收集的数值已经映射为人类易读的语句了:
参考:
[1]: https://www.zabbix.com/documentation/4.0/en/manual/config/items/itemtypes/zabbix_agent
[2]: https://www.zabbix.com/documentation/4.0/en/manual/config/items/mapping
一如既往,如果你对文章中的内容有任何疑问,或者是发现文章中有任何错误,都可以通过留言告诉我;如果你喜欢我的文章,欢迎关注我的微信公众号 Tech For Geek。

边栏推荐
- Firefox browser, when accessing Tencent cloud server, failed to establish a secure connection.
- Netease Yunxin appeared at the giac global Internet architecture conference to decrypt the practice of the new generation of audio and video architecture in the meta universe scene
- 零号培训平台课程-2、SSRF基础
- Pytorch model
- Music website management system based on SSM
- 想sink 到 redis-hash 里面 把 对象的属性和值都写进去 ,大佬们有Demo 吗?
- 请教大佬们一个问题,pgsqlcdc任务运行一段时间就不能监测变化了,重启就可以了,这个该从哪方面入
- 2021 interview question of php+go for Zhongda factory (1)
- py2exe qt界面风格变成了win98解决方案
- Book borrowing management system based on SSM
猜你喜欢

内部类--看这篇就懂啦~

Book borrowing management system based on SSM

Digital image processing -- Chapter 3 gray scale transformation and spatial filtering

Generics -- learn it, and there are many benefits

SQLite 常用功能整合

Student status management system based on SSM

Music website management system based on SSM

Digital image processing Chapter 1 Introduction

使用pip命令切换不同的镜像源

jjwt 生成token
随机推荐
Instruction set x digital technology accelerates the digital transformation of government and enterprises, and builds Unicorn enterprise alliance in DT field
Which C4d cloud rendering platform to cooperate with?
Neural network parameter initialization
(转帖)eureka、consul、nacos的对比2
Algorithm -- Fibonacci sequence (kotlin)
C4D云渲染平台选哪家合作?
35. Search insert position
Watermelon book learning notes - Chapter 4 decision tree
Digital image processing Chapter 1 Introduction
Campus news release management system based on SSM
tableau prep连接maxcompute,只是书写很简单的sql,为啥报这个错误呢?
py2exe qt界面风格变成了win98解决方案
word-wrap:break-word 换行在各浏览器兼容的问题
请问 mysql timestamp(6) 用flink-sql接过来是 null,这点有办法处理不
Gbase 8C product introduction
Generics -- learn it, and there are many benefits
内部类--看这篇就懂啦~
Consideration on how the covariance of Kalman filter affects the tracking effect of deepsort
想sink 到 redis-hash 里面 把 对象的属性和值都写进去 ,大佬们有Demo 吗?
二叉树--天然的查找语义(1)基础篇