当前位置:网站首页>ZABBIX agent adds a user-defined monitoring item -- Ping to destination IP link monitoring
ZABBIX agent adds a user-defined monitoring item -- Ping to destination IP link monitoring
2022-07-20 08:21:00 【⎛⎝⎠⎞ world】
cause :
A friend's need : headquarters and Branch Inter site data walk SDWAN, But sometimes there is a link failure , The route is not switched in time , It will cause users to disconnect . So I want to pass Zabbix monitor headquarters To Link state of the branch and Alarms are easy to handle in time .
You want the monitored end to execute a Zabbix There is no predefined detection , Need to use Zabbix The user-defined parameter function of provides this method . We can configure the file on the client side zabbix_angentd.conf It's equipped with UserParameter .
Configuration method :
Windows Next zabbix_agentd.conf To configure :
# Log file address
LogFile=D:\zabbix_agentd.log
# If set to pure passive mode , It can be commented out , It doesn't matter if you don't comment , Write zabbix server Of IP Or domain name
Server=1199.1858.2372.1155
# Active mode zabbix server Of IP Or domain name
ServerActive=1199.1858.2372.1155
# The use of host names is not configured , Need and zabbix server The hostname in is the same
Hostname=Nuzis-Host
# client agent Pattern : Set to 0 Indicates active mode is enabled , Don't listen on the local port
StartAgents=0
# Allow unsafe characters
#UnsafeUserParameters=1
# interval 60s Refresh the active monitoring configuration information time , Default 120s
RefreshActiveChecks=60
# Whether to run zabbix server Execute remote commands on this server ,0 - disabled;1 - enabled
EnableRemoteCommands=1
# Record the execution of the prototype shell Command log , The level of warrning;0 - disabled;1 - enabled
LogRemoteCommands=1
# Customized monitoring items
UserParameter=testping,echo "This is Test Ping!!!!"
Linux Next zabbix_agentd.conf To configure :
[[email protected] zabbix]# vim zabbix_agentd.conf
# PID Process documents
PidFile=/var/run/zabbix/zabbix_agentd.pid
# Log Log files
LogFile=/var/log/zabbix/zabbix_agentd.log
# Active mode zabbix server Of IP Or domain name
ServerActive=1199.1858.2372.1155
# The use of host names is not configured , Need and zabbix server The hostname in is the same
Hostname=Nuzis-Host
Hostname=centos777-111199
# client agent Pattern : Set to 0 Indicates active mode is enabled , Don't listen on the local port
StartAgents=0
# Whether to run zabbix server Execute remote commands on this server ,0 - disabled;1 - enabled
EnableRemoteCommands=1
# Record the execution of the prototype shell Command log , The level of warrning;0 - disabled;1 - enabled
LogRemoteCommands=1
# Centos7 By default root user , If it is zabbix Users do not need this sentence
AllowRoot=1
# Allow unsafe characters
#UnsafeUserParameters=1
# interval 60s Refresh the active monitoring configuration information time , Default 120s
RefreshActiveChecks=60
# Custom configuration files , Different configurations are written to different files , then include.
Include=/etc/zabbix/zabbix_agentd.d/*.conf
# Customized monitoring items
UserParameter=ifNumber,/etc/init.d/network status |awk 'NR==4'|awk -v RS="@#$j" '{print gsub(/ /,"&")+1}'
Zabbix Server To configure :
1- Add host
2- Add monitor
3- confirm zabbix-agent Running normally
4- Monitor the panel to view the latest data
5- Because the data is Zabbix-agent interval 60s( Default 120s) Active push to Zabbix Server Of , So if the monitoring item status is Unavailable 、Unsupported item key etc. , You can do it manually Disable and enable .
6- After that, you should be able to obtain data normally
ping Link monitoring will be written another day
quote :
1 Expand Zabbix Agents
https://www.zabbix.com/documentation/current/zh/manual/config/items/userparameters/extending_agent
5 User defined parameters
https://www.zabbix.com/documentation/current/zh/manual/config/items/userparameters
Expand Zabbix Data collection function 3 A simple step
https://www.bilibili.com/video/BV1HC4y1p7Ty?vd_source=4acf3ac765f3de8aafa9708391370c68
zabbix_Agent Monitoring configuration description - Chen Haoran 201 - Blog Garden
https://www.cnblogs.com/irockcode/p/6843303.html
【Zabbix ActiveMode】Zabbix Agent Active mode monitoring - Simple books
https://www.jianshu.com/p/ddc7f2dc51ae
zabbix Realization from zabbix_agent ping To Destination IP Data collection of - Let's have a look
http://t.zoukankan.com/xianguang-p-6874752.html
边栏推荐
猜你喜欢
. Net full scene development has finally arrived
Common settings for Alfred
Jenkins重启后项目丢失 (含 jenkins plugins下载地址)
Yolov5 realizes smoking behavior detection
基于STM32F103,用蜂鸣器播放歌曲
It's too voluminous. A company has completely opened its core system (smart system) that has been operating for many years
pytorch 目标检测竞赛(一)数据分析
私有云盘搭建
pytorch mmdetection2.0安装训练测试(coco训练集)
CyclicBarrier
随机推荐
Linear structure understanding
YOLOv5苹果香蕉检测
Based on STM32F103, play songs with buzzer
小程序页面生成链接通过短信发送
全局异常统一处理
three. JS create distortion slider
How to debug the dynamic code generated by C emit?
C # use objects comparer to compare objects
swing窗体打jar包后找不到图片的问题
Basic introduction to multithreading (with sample code)
opencv之图片处理看这一篇就够了(一)
【YOLOv5实现玩手机检测】
Zabbix-Sender 增加自定义监控项-- Ping 到目的地链路监控--bat脚本循环运行
珍惜时间,提高效率
CyclicBarrier
pytorch 目标检测数据处理(二)提取困难样本,低ap样本
Upgrade the pit stepped in php8
Yolov5 realizes smoking behavior detection
pytorch 实现数据增强分类 albumentations的使用
idea svn主干合并分支版本Missing ranges异常Error:svn: E195016