Karp

批量查询redis ops
需求批量查询redis 实例的 ops#!/bin/bash time=`date "+%Y-%m-%d...
扫描右侧二维码阅读全文
20
2017/07

批量查询redis ops

需求批量查询redis 实例的 ops

#!/bin/bash
time=`date "+%Y-%m-%d_%H:%M:%S"`

for x in 10.44.67.15:121 10.44.101.11:401 10.44.15.112:906
do
    ip=${x%:*}
    port=${x#*:}
    ops=$(redis-cli -h $ip -p $port info stats |grep ops | cut -d : -f 2)
    echo $time $x "ops:" $ops
done
Last modification:July 20th, 2017 at 01:03 am

Leave a Comment