windows上一键自动安装zabbix-agent
发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,一、简介zabbix是开源界流行的监控程序,C/S架构,运行多种系统平台安装,个人认为windows平台的 zabbix-agent安装最为烦琐,unix及linux平台通过自动化运维工具可一键远程安
千家信息网最后更新 2025年12月02日windows上一键自动安装zabbix-agent
一、简介
zabbix是开源界流行的监控程序,C/S架构,运行多种系统平台安装,个人认为windows平台的 zabbix-agent安装最为烦琐,unix及linux平台通过自动化运维工具可一键远程安装,而windows目前没有好的方法,所以就参考网上写了一个脚本(包含zabbix-agent 2.4.5客户端),一键安装并配置好防火墙。
二、安装脚本(配置文件)
请先修改脚本中zabbbix_server 为自己的zabbix服务器ip
@Echo offsetlocal enabledelayedexpansion:: 需要修改IP(填写自己zabbix服务器IP地址)set zabbix_server=10.168.118.91:: 替换配置文件中的server ipset conf_file=%~dp0\zabbix_agents_2.4.4.win\conf\zabbix_agentd.win.conffor /f "delims=" %%a in ('type "%conf_file%"') do ( set str=%%a set "str=!str:127.0.0.1=%zabbix_server%!" echo !str!>>"%conf_file%"_tmp.txt)move "%conf_file%" "%conf_file%"_bak.txtmove "%conf_file%"_tmp.txt "%conf_file%":: 32 bit or 64 bit process detectionIF "%PROCESSOR_ARCHITECTURE%%PROCESSOR_ARCHITEW6432%"=="x86" ( set _processor_architecture=32bit goto x86) ELSE ( set _processor_architecture=64bit goto x64):x86xcopy "%~dp0\zabbix_agents_2.4.4.win\bin\win32" c:\zabbix_x86 /e /i /ycopy "%conf_file%" c:\zabbix_x86\zabbix_agentd.conf /ysc stop "Zabbix Agent" >nul 2>nulsc delete "Zabbix Agent" >nul 2>nulc:\zabbix_x86\zabbix_agentd.exe -c c:\zabbix_x86\zabbix_agentd.conf -ic:\zabbix_x86\zabbix_agentd.exe -c c:\zabbix_x86\zabbix_agentd.conf -sgoto firewall:x64xcopy "%~dp0\zabbix_agents_2.4.4.win\bin\win64" c:\zabbix_x64 /e /i /ycopy "%conf_file%" c:\zabbix_x64\zabbix_agentd.conf /ysc stop "Zabbix Agent" >nul 2>nulsc delete "Zabbix Agent" >nul 2>nulc:\zabbix_x64\zabbix_agentd.exe -c c:\zabbix_x64\zabbix_agentd.conf -ic:\zabbix_x64\zabbix_agentd.exe -c c:\zabbix_x64\zabbix_agentd.conf -sgoto firewall:firewall:: Get windows Version numbersFor /f "tokens=2 delims=[]" %%G in ('ver') Do (set _version=%%G) For /f "tokens=2,3,4 delims=. " %%G in ('echo %_version%') Do (set _major=%%G& set _minor=%%H& set _build=%%I) Echo Major version: %_major% Minor Version: %_minor%.%_build%:: OS detectionIF "%_major%"=="5" ( IF "%_minor%"=="0" Echo OS details: Windows 2000 [%_processor_architecture%] IF "%_minor%"=="1" Echo OS details: Windows XP [%_processor_architecture%] IF "%_minor%"=="2" IF "%_processor_architecture%"=="32bit" Echo OS details: Windows 2003 [%_processor_architecture%] IF "%_minor%"=="2" IF "%_processor_architecture%"=="64bit" Echo OS details: Windows 2003 or XP 64 bit [%_processor_architecture%] :: 开启防火墙10050端口 netsh firewall delete portopening protocol=tcp port=10050 netsh firewall add portopening protocol=tcp port=10050 name=zabbix_10050 mode=enable scope=custom addresses=%zabbix_server%) ELSE IF "%_major%"=="6" ( IF "%_minor%"=="0" Echo OS details: Windows Vista or Windows 2008 [%_processor_architecture%] IF "%_minor%"=="1" Echo OS details: Windows 7 or Windows 2008 R2 [%_processor_architecture%] IF "%_minor%"=="2" Echo OS details: Windows 8 or Windows Server 2012 [%_processor_architecture%] IF "%_minor%"=="3" Echo OS details: Windows 8.1 or Windows Server 2012 R2 [%_processor_architecture%] IF "%_minor%"=="4" Echo OS details: Windows 10 Technical Preview [%_processor_architecture%] :: 开启防火墙10050端口 netsh advfirewall firewall delete rule name="zabbix_10050" netsh advfirewall firewall add rule name="zabbix_10050" protocol=TCP dir=in localport=10050 action=allow remoteip=%zabbix_server%)pauserd /s /q "%~dp0\zabbix_agents_2.4.4.win"del %0三、安装包及安装说明
安装包名zabbix_agents_auto_installer.win.zip 见附件
安装包中包含32和64位zabbix-agent和一份配置文件,以及自动安装脚本。
解压出来后找到AutoInstall.bat 脚本工具,双击就可以!会自动把zabbix-agent注册为系统服务并运行,添加10050被动端口。
附件:http://down.51cto.com/data/2366792
脚本
配置
平台
文件
端口
防火墙
服务
防火
一键
工具
服务器
系统
附件
运行
烦琐
监控程序
个人
地址
多种
客户
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
老年网络安全的软件
伯明翰大学论文数据库
数据库中db和dbms
中国网络安全讲解
神通数据库增字段数据迁移
江阴橙久网络技术有限公司好吗
视频服务器被黑客攻击
北京软件开发培训
检查服务器错误码
go使用什么数据库
java数据库 list
莱阳中心医院网络安全培训班
农行软件开发中心几面
上海蒙爱网络软件开发中心
数据库的原
上位机软件开发pdf
龚蔚中国网络安全
宿州视频点播软件开发
网上书店数据库实训项目答案
净化网络安全课件
东营人力资源hr软件开发
神通数据库增字段数据迁移
软件开发需要哪种岗位
查询本地数据库地址吗
蛋蛋网络技术
警惕严守网络安全
北理工网络安全博士日常
服务器共享文件如何转换本地磁盘
永劫无间迦南捏脸数据库
网络安全教育课课堂实录