[[email protected] ~]# groupadd -g 201 zabbix [[email protected] ~]# useradd -g zabbix -u 201 -s /sbin/nologin zabbix [[email protected] ~]# tar xf zabbix-2.4.5.tar.gz [[email protected] ~]# cd zabbix-2.4.5 #開始編譯安裝zabbix用戶端 [[email protected] zabbix-2.4.5]# ./configure --prefix=/usr/local/zabbix --enable-agent [[email protected] zabbix-2.4.5]# make && make install #建立zabbix的日志目錄 [[email protected] zabbix-2.4.5]# mkdir /var/log/zabbix [iy[email protected] zabbix-2.4.5]# chown zabbix.zabbix /var/log/zabbix #複制zabbix_agentd啟動檔案到/etc/init.d目錄下 [[email protected] zabbix-2.4.5]# cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/ [iy[email protected] zabbix-2.4.5]# chmod 755 /etc/init.d/zabbix_agentd #在iptables中放行10050和10051端口 [[email protected] zabbix-2.4.5]# iptables -I INPUT -p tcp -m multiport --dports 10050:10051 -j ACCEPT [iyun[email protected] zabbix-2.4.5]# service iptables save #儲存iptables規則 iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ] #檢視iptables結果 [[email protected] zabbix-2.4.5]# iptables -L -n Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports 10050:10051 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT) target prot opt source destination REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT) target prot opt source destination #修改啟動檔案和配置軟連接配接 [[email protected] zabbix-2.4.5]# sed -i "[email protected]=/usr/[email protected]=/usr/local/[email protected]" /etc/init.d/zabbix_agentd [[email protected] zabbix-2.4.5]# ln -s /usr/local/zabbix/etc/ /etc/zabbix [[email protected] zabbix-2.4.5]# ln -s /usr/local/zabbix/bin/* /usr/bin [[email protected] zabbix-2.4.5]# ln -s /usr/local/zabbix/sbin/* /usr/sbin/ #/etc/zabbix/zabbix_agentd.conf,這裡的IP位址寫的是zabbix_server端的IP位址 [[email protected] zabbix-2.4.5]# sed -i "[email protected][email protected][email protected]" /etc/zabbix/zabbix_agentd.conf [[email protected] zabbix-2.4.5]# sed -i "[email protected][email protected]=192.168.3.28:[email protected]" /etc/zabbix/zabbix_agentd.conf [[email protected] zabbix-2.4.5]# sed -i "[email protected]/[email protected]/log/zabbix/[email protected]" /etc/zabbix/zabbix_agentd.conf [[email protected] zabbix-2.4.5]# sed -i "s@^# UnsafeUserParamet[email protected]=1\[email protected]" /etc/zabbix/zabbix_agentd.conf #設定zabbix_agentd開機自動啟動,并啟動zabbix_agentd服務 [[email protected] zabbix-2.4.5]# chkconfig zabbix_agentd on [[email protected] zabbix-2.4.5]# service zabbix_agentd start Starting zabbix_agentd: [ OK ] |