编辑python脚本redis_conn.py
#!/usr/bin/env python
#ending:utf-8
import redis
def redis_conn():
pool = redis.ConnectionPool(host="192.168.56.11",port=6379,db=3,password=123456)
conn = redis.Redis(connection_pool=pool)
data = conn.llen("system-log-5611")
print(data)
redis_conn()
安装python的redis支持模块
yum -y install epel-release
yum -y install python-pip
pip install redis
运行
然后可以通过zabbix调用这个脚本监控队列长度设置阀值报警