Redis Collector
Redis collector script
Each inspection starts with a bash collector that runs on the target DB host. The script is zero-dependency, writes plain text, and is safe to run in production.
Or with curl
curl -O https://dbcheck.org/collector/redis.sh chmod +x redis.sh
Requirements
- Redis 5.0+ / 6.x / 7.x / 8.x(含 Redis Stack)
bash4+ ·redis-cli能直连本机- 有密码的实例:设置环境变量
REDISCLI_AUTH(密码不进命令行历史、不落盘) - 无需 sudo / root;只读采集,不写任何 key
- 主从每个节点各跑一次,输出文本约 50-200 KB
Run it
export REDISCLI_AUTH='***' # 如有密码;无密码可不设 ./redis_check.sh 127.0.0.1 6379 \ > redis_$(hostname -s)_6379_$(date +%Y%m%d).log 2>&1 # 参数:host / port / db(也可走 REDIS_HOST / REDIS_PORT / REDIS_DB 环境变量)。 # 主从每个节点各跑一次,把所有 .log 一起上传。
Output
建议把 stdout 重定向到带主机名 + 端口 + 日期的文件:
redis_<hostname>_<port>_<YYYYMMDD>.log
例:redis_demo-redis_6379_20261004.log。引擎会自动识别主从拓扑。