Zabbix监控Redis
环境:
Centos 7.3
Zabbix version : 3.0.2
Redis version : 3.2.5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| [root@localhost ~] [root@localhost scripts] check_redis.sh [root@localhost scripts] #!/bin/bash PORT='6379' STATUS_redis=`/bin/redis-cli -h '192.168.1.1' -p $PORT -a redis_password ping` if [ "$STATUS_redis" == 'PONG' ];then echo '1' else echo '0' fi [root@localhost scripts] [root@localhost ~] [root@localhost zabbix_agentd.d] UserParameter=redis_status[*],/bin/redis-cli -h '192.168.1.1' -p $1 -a redis_password info | grep -w $2 | awk -F':' '{print $NF}' UserParameter=redis_ping,sh /etc/zabbix/scripts/check_redis.sh [root@localhost zabbix_agentd.d] [root@localhost ~] [root@localhost ~] 1 [root@localhost ~] 1210708664 [root@localhost ~]
|
把修改后的模版链接到主机上
参考:http://blog.hackroad.com/operations-engineer/linux_server/11019.html
http://www.cnblogs.com/gnuhpc/p/4609592.html
附件:
Zabbix监控redis模版6379
注:这个redis监控脚本需要根据实际情况修改
本文出自”Jack Wang Blog”:http://www.yfshare.vip/2017/09/10/Zabbix监控redis/