当前位置:首页 > 开发 > 系统架构 > shell > 正文

自写简单Redis内存统计shell

发表于: 2015-03-20   作者:商人shang   来源:转载   浏览:
摘要: #!/bin/bash address="192.168.150.128:6666,192.168.150.128:6666" hosts=(${address//,/ }) sfile="staticts.log" for hostitem in ${hosts[@]} do ipport=(${hostitem
#!/bin/bash
address="192.168.150.128:6666,192.168.150.128:6666"  
hosts=(${address//,/ })  

sfile="staticts.log"

for hostitem in ${hosts[@]}  
do  
    ipport=(${hostitem//:/ })  
    host=${ipport[0]}
    port=${ipport[1]}

    echo $host":"$port >> $sfile

    echo "dbsize:" >> $sfile
    redis-cli -h $host -p $port dbsize >> $sfile

    redis-cli -h $host -p $port info | grep used_memory:  >> $sfile


    redis-cli -h $host -p $port info | grep used_memory_human: >> $sfile


    redis-cli -h $host -p $port info | grep used_memory_peak:  >> $sfile


    redis-cli -h $host -p $port info | grep used_memory_peak_human:  >> $sfile


    echo -e "\n\n\n\n" >> $sfile
done  

 

自写简单Redis内存统计shell

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号