1. 创建用户
[[email protected] ~]# groupadd zabbix [[email protected] ~]# useradd -g zabbix zabbix
2. 安装zabbix_3.2
[[email protected] ~]# tar -zxvf zabbix-3.2.7.tar.gz [[email protected] ~]# cd zabbix-3.2.7 [[email protected] zzabbix-3.2.7]# ./configure --prefix=/usr/local/zabbix --enable-agent [[email protected] zabbix-3.2.7]# make && make install
3. 配置启动服务
[[email protected] zabbix-3.2.7]# cp misc/init.d/fedora/core/zabbix_agentd /etc/rc.d/init.d/ [[email protected] zabbix-3.2.7]# chmod +x /etc/rc.d/init.d/zabbix_agentd [[email protected] zabbix-3.2.7]# vim /etc/rc.d/init.d/zabbix_agentd #修改BASEDIR=/usr/local/zabbix #zabbix安装目录 [[email protected] zabbix-3.2.7]# chkconfig --add zabbix_agentd [[email protected] zabbix-3.2.7]# chkconfig zabbix_agentd on
4. 修改配置文件
[[email protected] zabbix-3.2.7]# vim /usr/local/zabbix/etc/zabbix_agentd.conf #修改以下内容 Server=192.168.10.175 #服务端IP ServerActive=192.168.10.175 #服务端IP Hostname=localhost #客户端主机名 [[email protected] zabbix-3.2.7]# vim /etc/services #在文件末尾加入以下内容 zabbix-agent 10050/tcp # Zabbix Agent zabbix-agent 10050/udp # Zabbix Agent
5. 配置防火墙iptables
[[email protected] zabbix-3.2.7]# iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 10050 -j ACCEPT [[email protected] zabbix-3.2.7]# service iptables save [[email protected] zabbix-3.2.7]# service iptables restart
6. 启动服务
[[email protected] zabbix-3.2.7]# service zabbix_agentd start
7. 检测服务端和客户端是否联通
在服务端执行以下命令
[[email protected] ~]# /usr/local/zabbix-3.2.7/bin/zabbix_get -s192.168.10.169 -p10050 -k"system.uptime" #IP为客户端IP 116923 #生成随机数就说明客户端配置成功
再在zabbix服务端添加主机即可
时间: 2024-11-10 05:54:02