欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

【ZABBIX】自动发现实例

时间:2023-05-18
自动发现实例

前提 前提

我们使用自动发现功能是为了节省新增监控项、触发器的时间,zabbix自动识别会新增哪些监控项,常用语,cpu,每个cpu的利用率。文件系统,每个挂载目录的使用情况等。

现在有一个监控项,通过脚本获取到线路的track的状态,要对获取的数据进行监控项展示,json数据如下。

[ { "naq_entry":"线路名称", "trackid":"1", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"2", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"3", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"4", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"5", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"6", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"7", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"8", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"9", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"10", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"11", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"12", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"13", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"15", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"16", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"17", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"18", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"19", "State":"Positive", "Local IP":"2.2.2.2" }, { "naq_entry":"线路名称", "trackid":"20", "State":"Positive", "Local IP":"2.2.2.2" }]

一、在监控项上,“创建自动发现规则”

二、“键值"随便写一个不重复的

三、定义"LLD macros”,把json的监控项变成宏名称,被下一步监控项模型引用

四、新建监控项模型,"键值"项,必须不能一直,所以加了一个名称[宏名称]

五、监控项模型中,根据JSONPath获得数据,当TRACKID匹配到1时,自动获取TRACKID=1的json中名称

$[?(@.trackid==’{#TRACKID}’)].naq_entry.first()


六、保存后即可等待监控项的采集后,自动发现即根据监控项模型,生成监控项。

七、触发器配置(未开始)。

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。