redis连接数检查

#!/usr/bin/bash
ops_counts=`/usr/local/bin/redis-cli info|grep instantaneous_ops_per_sec |awk -F: '{print $2}'`
ops_count=`echo $ops_counts |awk '{print int($0)}'`

times=`date +'%Y-%m-%d_%H:%M:%S'`

if [ $ops_count -gt 50000 ];then echo $ops_count >> /home/duia/test; /usr/local/bin/redis-cli MONITOR >> /home/duia/redis_ops_$times.log;fi
echo $ops_count |awk '{if ($1 > 50000) print $1}'

posted @ 2022-04-28 11:08  风儿飘  阅读(85)  评论(0编辑  收藏  举报