zabbix(四)--在被监控设备yum安装zabbix-agent
目录
1、安装yum源
rpm -ivh https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
2、安装zabbix-agent
yum install zabbix-agent
3、配置zabbix_agentd.conf
用yum安装的zabbix-agent默认的配置文件在/etc/zabbix/zabbix_agentd.conf
只要配置一个参数
### Option: Server
# List of comma delimited IP addresses, optionally in CIDR notation, or hostnames of Zabbix servers and Zabbix proxies.
# Incoming connections will be accepted only from the hosts listed here.
# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally and '::/0' will allow any IPv4 or IPv6 address.
# '0.0.0.0/0' can be used to allow any IPv4 address.
# Example: Server=127.0.0.1,192.168.1.0/24,::1,2001:db8::/32,zabbix.domain
# Mandatory: yes, if StartAgents is not explicitly set to 0
# Default:
# Server=
Server=192.168.0.225
这个参数需要配置zabbix-server的地址,当然配置地址段也行
4、启动zabbix-agent
systemctl start zabbix-agent
5、结果
在zabbix-web上,配置好监控的主机。
Availability ZBX可以看到就能变绿,这就可以进行监控了。
6、问题
如果遇到Availability ZBX是红色的时候
(1)看zabbix-agent是否起来
ps -ef | grep zabbix 或者查看10050端口是否起来,netstat -anpo | grep 10050
(2)如果已经起来就看防火墙是否限制端口
systemctl stop firewalld
或者放通防火墙的10050端口。