shell查看redis 连接数分布

  sre, 开发

#!/bin/bash

host=1
port=2

echo host:port
redis-cli -h host -pport client list | awk '{print 2}'|
cut -d = -f 2| cut -d : -f 1 | sort | uniq -c | sort -rn |
awk '{"host "2 | getline h; print 1 "\t"2 "\t" h;}'| awk '{print 1 "\t"2 "\t" $7}'

LEAVE A COMMENT

Captcha Code