Zabbix-Sender 增加自定义监控项-- Ping 到目的地链路监控--bat脚本循环运行
前言:
普通情况监控使用 UserParameter 即可,默认120s/次 上报到zabbix server(最小值60s/次)。
Zabbix-sender 模式配置:
zabbix-sender 通过 自定义配置 主动向 Zabbix_Server 上报 采集 到的数据,可以通过 定时任务或者bat脚本来灵活控制数据的采集和上报。
D:\zabbix-agent-win-5.4.12
├─bin
│ └─dev
└─conf
目录: D:\zabbix-agent-win-5.4.12
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2022/6/19 2:50 bin
d----- 2022/6/19 2:50 conf
-a---- 2022/6/19 2:40 2595840 gping.exe
-a---- 2022/6/19 2:24 5054464 sender_ping.exe
-a---- 2022/6/19 2:04 145 sender_ping.ini
-a---- 2022/6/19 2:04 145 while_sender_ping.bat
zabbix-sender.exe在/bin目录下
循环运行脚本 while_sender_ping.bat:
@echo
:while
start D:\zabbix-agent-win-5.4.12\sender_ping.exe
timeout /t 30 # 循环30s运行一次
goto :while
sender_ping.ini 配置文件:
[sender_argv]
zabbix_servers_ip = 19.1.22.11 # 配置zabbix服务器地址
ping_ip = 100.100.100.189 # 配置需要检测的 IP 地址
agent_hostname = Nuzissss-Hooooodost # zabbix-agent安装主机名,需和server端主机名相同
key = test_sender_average;test_sender_loss # 在server自定义的采集器 监控项值
gping.exe 使用方法和返回值:
// 默认ping 4 个包.使用方法:
gping 114.114.114.114
// 如果网络不通,则回显往返行程的估计时间平均值999,和丢包率 100。字符串 :999 100
// 如果网络通,则回显实际的往返行程的估计时间平均值,和丢包率。字符串 :20 0
sender_ping.exe 则调用 zabbix-sender.exe 命令,循环向zabbix-server发送两个监控项值:test_sender_average;test_sender_loss。两个键值之间使用英文分号” ; “隔开:
D:\Desktop\zabbix_agent-5.4.12-windows-amd64\bin>zabbix_sender.exe -s Nuzissdfw-Hodsf3dsfst -z 19.1.22.11 -k test_sender_average -o 90
服务器端配置:
1、创建主机名称
2-创建监控项
3-查看上报的数据
4-创建图形
5-添加到仪表盘:
验证:
引用:
windows服务器的计划任务精确到秒级 – 编织梦想的猫
http://www.884358.com/windows-schtasks-second/
【Windows】设置定时任务 - 知乎
https://zhuanlan.zhihu.com/p/430602325
windows定时任务 - CSDN
https://www.csdn.net/tags/OtTagg5sNDE4MjQtYmxvZwO0O0OO0O0O.html
Windows定时任务 多个触发器 每隔一段时间(最小到秒级)执行一次指定的Python脚本_白水的博客-程序员ITS401_计划任务每隔一小时执行一次 - 程序员ITS401
https://its401.com/article/baishuiniyaonulia/104403387
Windows 任务计划程序:计划任务每 10 秒运行一次 | 多个触发器
https://qa.1r1g.cn/superuser/ask/20541181/
bat 脚本的几种休眠方式 | 记得要微笑
https://chenxuehu.com/article/2020/06/7603.html
让bat批处理以管理员权限运行的实现方法_DOS/BAT_脚本之家
https://www.jb51.net/article/193692.htm
Go语言实现ping命令 - 简书
https://www.jianshu.com/p/48ffe3c58dcb/
golang的ping检测主机存活_南宫乘风的博客-CSDN博客_golang ping
https://blog.csdn.net/heian_99/article/details/121628241
zabbix 实现 从zabbix_agent ping到 目的地IP的数据收集 - 走看看
http://t.zoukankan.com/xianguang-p-6874752.html
zabbix agent 自定义 UserParameter - Mr黄瑞 - 博客园
https://www.cnblogs.com/Mrhuangrui/p/7426775.html
编写python脚本,使用zabbix进行监控_夏目-的博客-CSDN博客_zabbix调用python脚本
https://blog.csdn.net/cyt0906/article/details/108105391
zabbix 自定义监控项如用ping监测链路【userparameter.conf】_wzlsunice88的博客-CSDN博客_zabbix监控ping
https://blog.csdn.net/wzlsunice88/article/details/115122222
1 扩展Zabbix Agents
https://www.zabbix.com/documentation/current/zh/manual/config/items/userparameters/extending_agent
5 用户自定义参数
https://www.zabbix.com/documentation/current/zh/manual/config/items/userparameters
Multiple servers for active agent? Sure! - Zabbix Blog
https://blog.zabbix.com/multiple-servers-for-active-agent-sure/858/
Zabbix Advance - zabbix User parameters 用户自定义监控项-UserParameter_Fei-Huang的博客-CSDN博客
https://blog.csdn.net/Huangfei10086/article/details/105662995
Zabbix UserParameter 用户自定义监控项(Windows) - 简书
https://www.jianshu.com/p/645197a4307a
扩展Zabbix数据收集功能的3个简单步骤_哔哩哔哩_bilibili
https://www.bilibili.com/video/BV1HC4y1p7Ty?vd_source=4acf3ac765f3de8aafa9708391370c68
Zabbix sender - 简书
https://www.jianshu.com/p/41f451d9d562
zabbix_sender用法实例 - 走看看
http://t.zoukankan.com/irockcode-p-6781834.html
zabbix_sender用法实例_我家小宝_朱朱的博客-CSDN博客_zabbix_sender
https://blog.csdn.net/zhuchunyan_aijia/article/details/110264383
zabbix_sender用法实例 - 走看看
http://t.zoukankan.com/irockcode-p-6781834.html
Python自做的一个zabbix_sender程序_小朩的博客-CSDN博客_python zabbix_sender
https://blog.csdn.net/qq_55723966/article/details/122805019
zabbix设置邮件报警_自己人5的博客-CSDN博客_zabbix邮件告警
https://blog.csdn.net/qq_36134608/article/details/123493358
zabbix 5.4 添加报警动作_alfiy的博客-CSDN博客_zabbix添加动作
https://blog.csdn.net/alfiy/article/details/124353234
Zabbix Agent编写自定义ping lost_weixin_33929309的博客-CSDN博客
https://blog.csdn.net/weixin_33929309/article/details/91847219
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步