Zabbix-Agent 客户端安装配置
1、安装Zabbix官方的yum源
[root@crazy-acong ~]# rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
2、安装 zabbix-agent
[root@crazy-acong ~]# yum install -y zabbix zabbix-agent
3、iptables 配置
[root@crazy-acong ~]# vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT -A OUTPUT -m state --state NEW -m tcp -p tcp --dport 10051 -j ACCEPT [root@crazy-acong ~]# service iptables restart
4、配置 zabbix_agentd.conf
# 默认配置 [root@crazy-acong ~]# egrep -v '^#|^$' /etc/zabbix/zabbix_agentd.conf PidFile=/var/run/zabbix/zabbix_agentd.pid LogFile=/var/log/zabbix/zabbix_agentd.log LogFileSize=0 Server=127.0.0.1 # 被动模式,允许哪台服务器连接 agent,可同时允许多个服务器连接,例如: Server=127.0.0.1,192.168.1.100 ServerActive=127.0.0.1 # 主动模式,向哪台服务器传送数据 Hostname=Zabbix server Include=/etc/zabbix/zabbix_agentd.d/
# 修改完之后的配置文件 [root@crazy-acong ~]# cat /etc/zabbix/zabbix_agentd.conf PidFile=/var/run/zabbix/zabbix_agentd.pid LogFile=/var/log/zabbix/zabbix_agentd.log LogFileSize=0 Server=127.0.0.1,192.168.1.105 ServerActive=192.168.1.105:10051 Hostname=Zabbix server Include=/etc/zabbix/zabbix_agentd.d/ UnsafeUserParameters=1
5、启动 zabbix_agentd 服务
[root@crazy-acong ~]# /etc/init.d/zabbix-agent start [root@crazy-acong ~]# netstat -lnpt | grep zabbix_agentd tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 1499/zabbix_agentd tcp 0 0 :::10050 :::* LISTEN 1499/zabbix_agentd [root@crazy-acong ~]# chkconfig zabbix-agent on