方案1:調用阿里雲yum源安裝(配置阿里雲yum源就不說了)
yum install zabbix-agent --安裝agent
service zabbix-agent start /status
chkconfig zabbix-agent --開機啓動
修改配置文件:
主動模式一定要設置hostname,並且和web配置的名稱一致,不然沒有數據
路徑:/etc/zabbix/zabbix_agentd.conf
Hostname=客戶機ip
HostnameItem=system.hostname
Server=22.22.22.22 (server端ip)
ServerActive=22.22.22.22(這一項是主動模式必填)
方案2:自己配置agent
1、創建用戶
Groupadd zabbix
useradd -g zabbix zabbix
cd /usr/local
mkdir zabbix
將文件放到/usr/local/zabbix/下即可
-------------------------------------------------------------------------
修改配置文件:
/usr/local/zabbix/conf/zabbix_agentd.conf
LogFile=/tmp/zabbix_agentd.log
EnableRemoteCommands=1
Server=20.58.8.30,20.58.8.27,10.230.20.220,10.230.20.221
ServerActive=20.58.8.30,20.58.8.27,10.230.20.220,10.230.20.221
StartAgents=5
Hostname=自己服務器IP地址
BufferSend=30
BufferSize=1024
Timeout=30(數據返回時間限制最大30秒)
啓動agent
#/usr/local/zabbix/sbin/zabbix_agentd -c /usr/local/zabbix/conf/zabbix_agentd.conf
開機啓動設置
#vim /etc/rc.local
#/usr/local/zabbix/sbin/zabbix_agentd -c /usr/local/zabbix/conf/zabbix_agentd.conf