1.下载地址:
https://www.zabbix.com/download_agents#tab:40LTS
解压之后会看到两个目录
conf目录存放是agent配置文件
bin文件存放windows下32位和64位安装程序
2.配置zabbix_agentd.win.conf
找到conf下的配置文件 zabbix_agentd.win.conf ,修改LogFile、Server、ServerActive 、Hostname这几个参数。具体配置如下:
LogFile=G:\zabbix\zabbix_agentd.log
Server=10.1.5.25 // zabbix server的ip地址
ServerActive=10.1.5.251 // zabbix 主动监控server的ip地址
Hostname=Windows host //主机名,必须唯一,区分大小写。Hostname必须和zabbix web上配置的一直,否则zabbix主动监控无法正常工作
3.安装agent
G:\zabbix\zabbix_agent\bin\zabbix_agentd.exe -i -c G:\zabbix\zabbix_agent\conf\zabbix_agentd.win.conf
控制台信息如下:
zabbix_agentd.exe [10540]: service [Zabbix Agent] installed successfully zabbix_agentd.exe [10540]: event source [Zabbix Agent] installed successfully
4.启动agent客户端
G:\zabbix\zabbix_agent\bin\zabbix_agentd.exe -c G:\zabbix\zabbix_agent\conf\zabbix_agentd.win.conf -s
控制台信息如下:
zabbix_agentd.exe [3176]: service [Zabbix Agent] started successfully
查看window端口使用情况
netstat -ano|findstr "10050"
5.windows系统防火墙中开放端口10050
控制面板-->选择windows 防火墙-->高级设置-->设置入站规则-->新建规则
6.设置开机启动
7.创建主机,查看监控效果
configuration(组态,配置)–>Hosts(主机)–>Create host(创建主机)
连接模板
选择Template OS Windows模板
查看结果
附:安装遇到的问题
后台日志:
5044:20190418:150223.704 no active checks on server [10.1.5.254:10051]: host [Windows host] not found
问题分析:
a. 服务端ping zabbix-agent没问题
服务端telnet zabbix-agent的10050端口也是通的,说明agent机器没问题
b.在服务端获取agent的数据
./zabbix_get -s 1.1.1.1 -p 10050 -k "system.cpu.load[all,avg1]" 数据获取正常
agent 上去查看 zabbix agentd 进程正常运行
问题解决:
最后发现是自己的防火墙没关,关闭防火墙刷新页面就可以了