1. 程式人生 > >zabbix-agent安裝和配置

zabbix-agent安裝和配置

1、準備環境:

參考:從部署包安裝zabbix3.4

2、安裝zabbix-agent(192.168.1.17)

2.1、下載安裝包

[[email protected] ~]# rpm -i https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

2.2、安裝zabbix-agent

[[email protected] ~]# yum -y install zabbix-agent zabbix-sender

2.3、配置/etc/zabbix/zabbix_agentd.conf

主要修改三個引數:“Server”、“ServerActive”、“Hostname”。

“Server”和“ServerActive”對應Zabbix伺服器的IP地址。

“Hostname”對應zabbix-agent的IP地址。

[[email protected] ~]# yum -y install zabbix-agent zabbix-sender

Server=Zabbix伺服器的IP地址
ServerActive=Zabbix伺服器的IP地址
Hostname=本機IP地址

注意:

如果內網環境中有DNS解析伺服器,以上三個引數建議填寫“主機名稱”。

2.3、啟動zabbix-agent

[[email protected] ~]# systemctl enable zabbix-agent
[[email protected] ~]# systemctl start zabbix-agent
[[email protected] ~]# systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since 日 2018-09-16 20:20:52 CST; 10min ago
 Main PID: 1548 (zabbix_agentd)
   CGroup: /system.slice/zabbix-agent.service
           ├─1548 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
           ├─1549 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
           ├─1550 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
           ├─1551 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
           ├─1552 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
           └─1553 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

9月 16 20:20:52 redis.dev systemd[1]: Starting Zabbix Agent...
9月 16 20:20:52 redis.dev systemd[1]: PID file /run/zabbix/zabbix_agentd.pid not readable (yet?) after start.
9月 16 20:20:52 redis.dev systemd[1]: Started Zabbix Agent.