部署zabbix监控mysql (二) 安装zabbix agent

ZabbixAgent 安装配置

1)下载安装zabbixagent 软件

# wget http://iweb.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.8/zabbix-2.4.8.tar.gz

[root@192~]# tar xf zabbix-2.4.8.tar.gz

[root@192~]# 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

[root@192~]# iptables -A INPUT -p tcp -m tcp --dport 10050 -j ACCEPT

[root@192~]# service iptables save

iptables:Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

[root@192~]#

5)启动zabbix_agentd

[root@192~]# /etc/init.d/zabbix_agentd start

StartingZabbix Agent:                                     [  OK  ]

6)开机自启动

[root@192~]# chkconfig --add zabbix_agentd

[root@192~]# chkconfig --level 35  zabbix_agentdon

[root@192~]#

7)测试zabbixagent 是否正常工作

[root@192~]# /usr/local/zabbix/sbin/zabbix_agentd -c/usr/local/zabbix/etc/zabbix_agent.conf -t system.uptime

system.uptime                                 [u|1574020]

[root@192~]#

 

 

 

 


你可能感兴趣的:(mysql,部署,zabbix)