需求批量查询 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