zabbix5.0使用自带模板监控kafka,memcached,Rabbitmq
Posted 宋鹏超
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zabbix5.0使用自带模板监控kafka,memcached,Rabbitmq相关的知识,希望对你有一定的参考价值。
一、环境介绍
服务端安装zabbix服务参考 https://blog.51cto.com/qidian510/4919061
二、实现对客户端centos6系统的kafka服务监控
1、服务端补充安装zabbix-java-gateway
yum install -y zabbix-java-gateway
tar zxf jdk-8u121-linux-x64.gz -C /usr/local/
cat /etc/profile.d/java.sh
#!/bin/bash
export JAVA_HOME=/usr/local/jdk1.8.0_121
export PATH=$JAVA_HOME/bin:$PATH
export JRE_HOME=/usr/local/jdk1.8.0_121
export CLASSPATH=/usr/local/jdk1.8.0_121/lib/tools.jar:/usr/local/jdk1.8.0_121/lib/dt.jar
source /etc/profile
vim /etc/zabbix/zabbix_java_gateway.conf
LISTEN_IP="0.0.0.0"
LISTEN_PORT=10052
PID_FILE="/var/run/zabbix/zabbix_java.pid"
START_POLLERS=5
TIMEOUT=3
vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=Zabbix@123
JavaGateway=192.168.142.132
JavaGatewayPort=10052
StartJavaPollers=5
systemctl restart zabbix-java-gateway
systemctl restart zabbix-server
2、kafka_2.11-2.0.0客户端配置
vim /usr/local/kafka_2.11-2.0.0/bin/kafka-server-start.sh
if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then
export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
export JMX_PORT="12345" #增加JMX端口监控
fi
cd /usr/local/kafka_2.11-2.0.0/bin
./zookeeper-server-start.sh ../config/zookeeper.properties 1>/dev/null 2>&1 &
./kafka-server-start.sh ../config/server.properties 1>/dev/null 2>&1 &
yum install -y ntpdate
ntpdate -u cn.pool.ntp.org
echo "*/20 * * * * /usr/sbin/ntpdate -u cn.pool.ntp.org >/dev/null &" >> /var/spool/cron/root?
wget https://repo.zabbix.com/zabbix/5.0/rhel/6/x86_64/zabbix-agent-5.0.19-1.el6.x86_64.rpm --no-check-certificate
rpm -ivh zabbix-agent-5.0.19-1.el6.x86_64.rpm
sed -i s/Server=127.0.0.1/Server=192.168.142.132/g /etc/zabbix/zabbix_agentd.conf
sed -i s/ServerActive=127.0.0.1/ServerActive=192.168.142.132/g /etc/zabbix/zabbix_agentd.conf
service zabbix-agent start && chkconfig zabbix-agent on
3、模板挂载
三、实现对客户端centos6系统的memcached服务监控
1、客户端配置
wget https://repo.zabbix.com/zabbix/5.0/rhel/6/x86_64/zabbix-agent2-5.0.19-1.el6.x86_64.rpm --no-check-certificate
rpm -ivh zabbix-agent2-5.0.19-1.el6.x86_64.rpm
ntpdate -u cn.pool.ntp.org
echo "*/20 * * * * /usr/sbin/ntpdate -u cn.pool.ntp.org >/dev/null &" >> /var/spool/cron/root?
vim /etc/zabbix/zabbix_agent2.conf
Server=192.168.142.132
ServerActive=192.168.142.132
Hostname=Zabbix server
Include=/etc/zabbix/zabbix_agent2.d/*.conf
ControlSocket=/tmp/agent.sock
service zabbix-agent2 start
2、模板配置并挂载
注意:memcache使用的zabbix-agent2客户端工具
四、实现对客户端centos6系统的Rabbitmq服务监控
1、Rabbitmq客户端配置
ntpdate -u cn.pool.ntp.org
echo "*/20 * * * * /usr/sbin/ntpdate -u cn.pool.ntp.org >/dev/null &" >> /var/spool/cron/root?
wget https://repo.zabbix.com/zabbix/5.0/rhel/6/x86_64/zabbix-agent-5.0.19-1.el6.x86_64.rpm --no-check-certificate
rpm -ivh zabbix-agent-5.0.19-1.el6.x86_64.rpm
sed -i s/Server=127.0.0.1/Server=192.168.142.132/g /etc/zabbix/zabbix_agentd.conf
sed -i s/ServerActive=127.0.0.1/ServerActive=192.168.142.132/g /etc/zabbix/zabbix_agentd.conf
service zabbix-agent start && chkconfig zabbix-agent on
cd /root/rabbitmq_server-3.6.10/sbin
./rabbitmqctl add_user zbx_monitor zabbix #授权zbx_monitor用户
./rabbitmqctl set_user_tags zbx_monitor administrator
2、模板挂载
以上是关于zabbix5.0使用自带模板监控kafka,memcached,Rabbitmq的主要内容,如果未能解决你的问题,请参考以下文章