这几天给生产环境的redis监控client connection数。 写了个cron定时去client信息发到公司的一个chat工具的hook。
脚本大概如下
connection_cnt=`redis-cli -h127.0.0.1 -P3306 -a xxxx info clients | grep connected_clients | cut -d":" -f2`
curl -X POST -d '{"bot":"redis watch dog", "boticon":"/path/to/image", "text":"rediscount:"'$connection_cnt'}'
结果发过来的数据总是前后颠倒。 要么被切掉。
connection_cnt=`redis-cli -h127.0.0.