ZabbixAgent 安装配置
(1)下载安装zabbixagent 软件
# wget http://iweb.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.8/zabbix-2.4.8.tar.gz
[[email protected]~]# tar xf zabbix-2.4.8.tar.gz
[[email protected]~]# cd zabbix-2.4.8
[[email protected]]# ./configure --prefix=/usr/local/zabbix --enable-agent
[[email protected]]# make && make install
[[email protected]]# cp misc/init.d/fedora/core5/zabbix_agentd /etc/init.d/
(2)配置zabbix_agentd
[[email protected]]# groupadd zabbix
[[email protected]]# useradd -g zabbix zabbix
[[email protected]]# mkdir -p /usr/local/zabbix/logs
[[email protected]]# chown zabbix.zabbix /usr/local/zabbix/ -R
[[email protected]]# vim /usr/local/zabbix/etc/zabbix_agentd.conf
[[email protected]]# cat /usr/local/zabbix/etc/zabbix_agentd.conf | egrep -v "^#|^$"
PidFile=/usr/local/zabbix/logs/zabbix_agentd.pid
LogFile=/usr/local/zabbix/logs/zabbix_agentd.log
Server=192.168.1.214
ListenPort=10050
ServerActive=192.168.1.214
Hostname=Zabbix_agent212
Timeout=15
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
[[email protected]]#
(3)配置zabbixagent 系统启动脚本
[[email protected]]# vim /etc/init.d/zabbix_agentd
prog="Zabbix Agent"
ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_agentd"
CONF_FILE="/usr/local/zabbix/etc/zabbix_agentd.conf"
start(){
…
daemon $ZABBIX_BIN -c $CONF_FILE
…
}
(4)防火墙设置,开启防火墙端口10050
[[email protected]~]# iptables -A INPUT -p tcp -m tcp --dport 10050 -j ACCEPT
[[email protected]~]# service iptables save
iptables:Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
[[email protected]~]#
(5)启动zabbix_agentd
[[email protected]~]# /etc/init.d/zabbix_agentd start
StartingZabbix Agent: [ OK ]
(6)开机自启动
[[email protected]~]# chkconfig --add zabbix_agentd
[[email protected]~]# chkconfig --level 35 zabbix_agentdon
[[email protected]~]#
(7)测试zabbixagent 是否正常工作
[[email protected]~]# /usr/local/zabbix/sbin/zabbix_agentd -c/usr/local/zabbix/etc/zabbix_agent.conf -t system.uptime
system.uptime [u|1574020]
[[email protected]~]#