主机信息 | IP地址 |
---|---|
zabbix-server | 172.20.100.101 |
zabbix-client | 172.20.100.249 |
被监控的服务器上线需要安装zabbix-agent
1、更新zabbix yum源
CentOS/RHEL 7:
#rpm -Uvh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
CentOS/RHEL 6:
#rpm -Uvh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm
CentOS/RHEL 5:
#rpm -Uvh http://repo.zabbix.com/zabbix/3.0/rhel/5/x86_64/zabbix-release-3.0-1.el5.noarch.rpm
2、安装zabbix-agent
yum install zabbix-agent -y
3、配置zabbix-agent
vi /etc/zabbix/zabbix_agentd.conf
Server=172.16.100.101 #zabbix-server端IP
ServerActive=Server=172.16.100.101 #zabbix-server端IP
Hostname= name_172.16.100.249 #主动模式要一致
**小技巧:**HostnameItem=system.hostname #系统自动识别主机名
4、启动服务
systemctl start zabbix-agent.service
systemctl enable zabbix-agent.service
6、zabbix服务端安装zabbix-get安装
Zabbix-Get 是Zabbix 中的一个程序,用于Zabbix-Server 到Zabbix-Agent 的数据获取,通常可以用来检测验证Agent 的配置是否正确。
yum install zabbix-agent -y
7、启动服务
systemctl start zabbix-agent.service
systemctl enable zabbix-agent.service
8、zabbix服务器添加zabbix-client
“配置”—>“主机”—>“创建主机”
9、添加监控模板
10、返回“主机”页查看刚添加的主机,因为有时间延迟,过一会就会监控成功