1.下载
选择对应的ZABBIX VERSION
版本:
下载zip
文件或查看安装说明:
官网 的安装说明:
2.agent
2.1 准备
下载对应版本的zip
文件并解压,选择一个文件夹放置zabbix_agentd.exe
和配置文件zabbix_agentd.conf
。例如:
# 1.在 e 盘创建 zabbix 文件夹E E:\zabbix # 拷贝解压包内 bin\zabbix_agentd.exe 和 conf\zabbix_agentd.conf 文件到 e:\zabbix
# 2.修改 zabbix_agentd.conf 文件 # 日志文件【默认在C:盘】 LogFile=E:\zabbix\zabbix_agentd.log # zabbix-server 服务的IP地址【如果Server部署在云服务器则需要配置云服务器的外网IP】 Server=127.0.0.1 ServerActive=127.0.0.1 # making sure to specify a correct "Hostname" parameter Hostname="Hostname"
Hostname
配置参数的影响:
页面没有配置相应的Hostname
会报错:
# 配置 Hostname=Windows host # 报错 no active checks on server [xxx.xxx.x.xxx:10051]: host [Windows host] not found # 原因 # Web 上未配置 Name 是 Windows host 的 Hosts
2.2 安装
使用以下命令安装 zabbix agent 作为 Windows 服务。
# 安装命令 E:\> E:\zabbix\zabbix_agentd.exe -c E:\zabbix\zabbix_agentd.conf -i zabbix_agentd [xxxx]: 'Zabbix Agentd' installed successfully
打开任务管理器,启动agent
服务。
2.3 其他操作
可以在一台主机上运行多个agent实例。单个实例可以使用默认配置文件,也可以使用命令行中指定的配置文件。对于多个实例,每个agent实例必须有自己的配置文件(其中一个实例可以使用默认配置文件)。Zabbix agent 可以使用以下命令行参数:
Parameter | Description |
UNIX and Windows agent | |
-c --config | Path to the configuration file. You may use this option to specify a configuration file that is not the default one. On UNIX, default is /usr/local/etc/zabbix_agentd.conf or as set by compile-time variables –sysconfdir or –prefix On Windows, default is c:\zabbix_agentd.conf |
-p --print | Print known items and exit. Note: To return user parameter results as well, you must specify the configuration file (if it is not in the default location). |
-t --test | Test specified item and exit. Note: To return user parameter results as well, you must specify the configuration file (if it is not in the default location). |
-h --help | Display help information |
-V --version | Display version number |
UNIX agent only | |
-R --runtime-control | Perform administrative functions. See runtime control. |
Windows agent only | |
-m --multiple-agents | Use multiple agent instances (with -i,-d,-s,-x functions). To distinguish service names of instances, each service name will include the Hostname value from the specified configuration file. |
Windows agent only (functions) | |
-i --install | Install Zabbix Windows agent as service |
-d --uninstall | Uninstall Zabbix Windows agent service |
-s --start | Start Zabbix Windows agent service |
-x --stop | Stop Zabbix Windows agent service |
Specific examples of using command line parameters:
- printing all built-in agent items with values
- testing a user parameter with “mysql.ping” key defined in the specified configuration file
- installing a “Zabbix Agent” service for Windows using the default path to configuration file c:\zabbix_agentd.conf
- installing a “Zabbix Agent [Hostname]” service for Windows using the configuration file zabbix_agentd.conf located in the same folder as agent executable and make the service name unique by extending it by Hostname value from the config file
3.agent2
安装方式跟agent
一致,但是同样的配置,图表还是有区别的:
- agent主机信息
- agent2的主机信息