zabbix--客户端部署(新手入门)
zabbix--客户端部署
机器环境部署:我准备的一台zabbix客户端#可以准备多台 ip:
- 安装软件包
[root@server1 ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
[root@server1 ~]# yum install zabbix-agent -y
- 设置开机自启并且查看端口号
[root@server2 ~]# systemctl enable --now zabbix-agent.service
#安装net-tools查端口号工具
[root@server2 ~]# yum install net-tools -y
[root@server2 ~]# netstat -tnlp|grep zabbix
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 7671/zabbix_agentd
tcp6 0 0 :::10050 :::* LISTEN 7671/zabbix_agentd
- 注意时间正确及时区
[root@server2 ~]# yum install ntpdate -y
[root@server2 ~]# ntpdate -u ntp.aliyun.com
#客户端和服务端都进行时间校准
###时区####
[root@server2 ~]# mv /etc/localtime{,.bak}
[root@server2 ~]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@server2 ~]# date
2022年 02月 27日 星期日 10:43:02 CST
- 修改配置文件查看配置信息
[root@server2 ~]# vim /etc/zabbix/zabbix_agentd.conf
# 主要修改以下三个参数
Server=192.168.232.169 ServerActive=192.168.232.169
Hostname=server2
- 重启zabbix-agent
[root@server2 ~]# systemctl restart zabbix-agent.service
验证zabbix-agent的连通性
- 通过服务端上通过命令,获取数据
在服务端安装然后采集客户端信息
[root@server1 ~]# yum install zabbix-get -y
[root@server1 ~]# zabbix_get -s '192.168.232.142' -p 10050 -k 'system.hostname'
server2
这样大家客户端就部署好了 希望对大家有所帮助,初学者请多指教