Windows Server上安装部署Zabbix agent(最新版)
来源:互联网 发布:淘宝怎么上架莆田鞋 编辑:程序博客网 时间:2024/05/24 23:14
Windows Server上安装部署Zabbix agent
下载并解压到指定目录
Zabbix下载页面:https://www.zabbix.com/download
当前最新版本zabbix-agent下载
https://www.zabbix.com/downloads/3.4.0/zabbix_agents_3.4.0.win.zip解压到C盘,并重命名目录为zabbix
# 到zabbix_agents_3.4.0.win.zip所在的目录下执行,笔者使用了git bash,如果没下载git,建议解压到C盘并重命名为zabbix unzip zabbix_agents_3.4.0.win -d C:/zabbix
- 查看zabbix-agent解压之后的目录结构
# 移动到C盘,执行下面命令查看> cd C:> tree zabbix
1、conf目录存放是agent配置文件
2、bin文件存放windows下32位和64位安装程序
配置zabbix-agent.win.conf
找到conf下的配置文件 zabbix_agentd.win.conf ,修改LogFile、Server、ServerActive 、Hostname这几个参数。具体配置如下:
# 移动到C盘的zabbix目录下conf目录下,编辑zabbix_agentd.win.conf,修改下面几个参数LogFile=C:\zabbix\zabbix_agentd.logServer=192.168.1.134ServerActive=192.168.1.134:10051Hostname=Win-server-2016
- 参数含义说明:
1、Server: zabbix server的ip地址,2、ServerActive: zabbix 主动监控server的ip地址,3、其中Server和ServerActive都指定zabbix Server的IP地址,不同的是,前者是被动后者是主动。也就是说Server这个配置是用来允许172.17.22.155这个ip来我这取数据。而ServerActive的172.17.22.155的意思是,客户端主动提交数据给他。4、Hostname 主机名,必须唯一,区分大小写。Hostname必须和zabbix web上配置的一直,否则zabbix主动监控无法正常工作。因为agent拿着这个主机名去问server,我有配置主动监控项吗?server拿着这个主机名去配置里面查询,然后返回信息。5、zabbix agent检测分为主动(agent active)和被动(agent)两种形式,主动与被动的说法均是相对于agent来讨论的。6、主动:agent请求server获取主动的监控项列表,并主动将监控项内需要检测的数据提交给server/proxy7、被动:server向agent请求获取监控项的数据,agent返回数据。
zabbix-agent 安装
参考:https://www.zabbix.com/documentation/3.4/manual/appendix/install/windows_agent
- 修改好配置文件后,用CMD(需有管理员权限)将Zabbix Agent安装为Windows系统的服务,在windows控制台下执行以下命令:
> C:\zabbix\bin\win64\zabbix_agentd.exe -i -c C:\zabbix\conf\zabbix_agentd.win.conf
- 控制台输出信息如下,表示安装成功:
zabbix_agentd.exe [4864]: service [Zabbix Agent] installed successfullyzabbix_agentd.exe [4864]: event source [Zabbix Agent] installed successfully
启动zabbix-agent客户端
> C:\zabbix\bin\win64\zabbix_agentd.exe -c C:\zabbix\conf\zabbix_agentd.win.conf -s
- 控制台输出下面信息,表示安装成功:
zabbix_agentd.exe [11052]: service [Zabbix Agent] started successfully
- 查看Windows端口监听情况
C:\zabbix\bin\win64>netstat -ano | findstr "10050"TCP 0.0.0.0:10050 0.0.0.0:0 LISTENING 10624......... #此处省略,详情见下图TCP [::]:10050 [::]:0 LISTENING 10624C:\zabbix\bin\win64>tasklist | findstr "10624"zabbix_agentd.exe 10624 Services 0 11,892 K
- 查看任务管理器
- 查看zabbix_agent的启动日志zabbix_agentd.log:
12660:20171218:194616.210 Starting Zabbix Agent [Win-server-2016]. Zabbix 3.4.0 (revision 71462). 12660:20171218:194616.220 **** Enabled features **** 12660:20171218:194616.231 IPv6 support: YES 12660:20171218:194616.241 TLS support: NO 12660:20171218:194616.250 ************************** 12660:20171218:194616.262 using configuration file: C:\zabbix\conf\zabbix_agentd.win.conf 12660:20171218:194616.282 agent #0 started [main process] 9412:20171218:194616.295 agent #1 started [collector] 8968:20171218:194616.306 agent #2 started [listener #1] 12644:20171218:194616.315 agent #3 started [listener #2] 11580:20171218:194616.327 agent #5 started [active checks #1] 12864:20171218:194616.337 agent #4 started [listener #3] 11580:20171218:194616.360 no active checks on server [192.168.1.134:10051]: host [Win-server-2016] not found 11580:20171218:194816.501 no active checks on server [192.168.1.134:10051]: host [Win-server-2016] not found
Windows server 系统防火墙开放10050端口
控制面板–windows 防火墙–高级设置–入站规则–新建规则, 详细步骤参考下图:
根据上图步骤,依次添加,完成入站规则的添加
- 设置zabbix_agentd服务自启动
win+R,运行services.msc,默认是自动
zabbix_agentd.exe命令说明
$ ./zabbix_agentd.exe -husage: zabbix_agentd.exe [-c config-file] zabbix_agentd.exe [-c config-file] -p zabbix_agentd.exe [-c config-file] -t item-key zabbix_agentd.exe [-c config-file] -i [-m] zabbix_agentd.exe [-c config-file] -d [-m] zabbix_agentd.exe [-c config-file] -s [-m] zabbix_agentd.exe [-c config-file] -x [-m] zabbix_agentd.exe -h zabbix_agentd.exe -VA Zabbix daemon for monitoring of various server parameters.Options: -c --config config-file Path to the configuration file (default: "C:\zabbix_agentd.conf") -f --foreground Run Zabbix agent in foreground -p --print Print known items and exit -t --test item-key Test specified item and exit -m --multiple-agents For -i -d -s -x functions service name will include Hostname parameter specified in configuration fileFunctions: -i --install Install Zabbix agent as service -d --uninstall Uninstall Zabbix agent from service -s --start Start Zabbix agent service -x --stop Stop Zabbix agent service -h --help Display this help message -V --version Display version numberExample: zabbix_agentd -c C:\zabbix\zabbix_agentd.conf
批处理脚本agentd.bat
笔者参考别人文章的脚本,下面为Windows批处理脚本zabbix-agentd.bat对客户端服务器上的zabbix_agentd进行安装、启动、停止、卸载
- 前提:
- 1、解压zabbix_agents_3.4.0.win.zip 到C:\zabbix目录
- 2、手动修改过参数文件c:\zabbix\conf\zabbix_agentd.win.conf
- zabbix-agentd.bat脚本内容如下:
@echo offCHCP 65001echo ****************************************echo *****Zabbix Agentd Operation************echo ****************************************echo ** a. start Zabbix Agentd********echo ** b. stop Zabbix Agentd********echo ** c. restart Zabbix Agentd********echo ** d. install Zabbix Agentd********echo ** e. uninstall Zabbix Agentd********echo ** f. exit Zabbix Agentd********echo ****************************************:loopchoice /c abcdef /M "please choose"if errorlevel 6 goto :exit if errorlevel 5 goto uninstallif errorlevel 4 goto installif errorlevel 3 goto restartif errorlevel 2 goto stopif errorlevel 1 goto start:startc:\zabbix\bin\win64\zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -sgoto loop:stopc:\zabbix\bin\win64\zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -xgoto loop:restartc:\zabbix\bin\win64\zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -xc:\zabbix\bin\win64\zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -sgoto loop:installc:\zabbix\bin\win64\zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -igoto loop:uninstallc:\zabbix\bin\win64\zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -dgoto loop:exitexit
在Zabbix Web UI创建主机,查看监控结果
Configuration – Hosts – Create hosts
创建主机并关联模板比较简单,笔者没做详细记录
- 查看监控结果
安装心得
根据自己环境定义zabbix的解压目录,注意防火墙问题,配置文件问题
- 参考:https://www.cnblogs.com/xqzt/p/5130469.html
阅读全文
0 0
- Windows Server上安装部署Zabbix agent(最新版)
- Zabbix agent 在windows上安装部署
- Windows安装 Zabbix agent
- 部署zabbix agent监控windows
- CentOS 安装zabbix-server和zabbix-agent
- Zabbix agent 在windows平台上的安装
- Zabbix应用之Server/Agent部署
- Zabbix学习之Server/Agent部署
- Zabbix agent安装部署及连接proxy
- zabbix-2.0.0 server & agent安装
- zabbix-2.0.0 server & agent安装
- ubantu 安装zabbix (server和agent)
- 在Linux上安装zabbix agent
- zabbix-agent windows linux客户端安装
- zabbix在windows下安装agent监控
- CentOS7.2部署Zabbix Server及Agent进行平台监控
- CentOS 6.5 安装部署zabbix(Agent客户端篇)
- 安装Zabbix Agent
- hrbust2363 Symmys(manacher+dp)
- 程序设计入门4 子序列的和
- <url-pattern>写成/和/*的区别
- 71A. Way Too Long Words
- CZJ-Superman HNUST 1880
- Windows Server上安装部署Zabbix agent(最新版)
- JSON
- Java中的低耦合高内聚法则
- Go GIF 动画
- 51nod-1284 2 3 5 7的倍数 (容斥原理)
- ZCMU2016: 不存在的树 (2017浙江中医药校赛) (树链剖分)
- AXI 的乱序操作
- 使用 Spring Boot Admin 来监控你的服务
- 史上最简单的SpringCloud教程 | 第七篇: 高可用的分布式配置中心(Spring Cloud Config)