linux抓取load average数据
Posted wuzhiyi
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux抓取load average数据相关的知识,希望对你有一定的参考价值。
#!/bin/bash echo ‘‘ > ~/getLoad/1minute.txt echo ‘‘ > ~/getLoad/5minute.txt echo ‘‘ > ~/getLoad/15minute.txt #get load average data oneminute=`uptime |awk ‘{print $8}‘` fiveminute=`uptime |awk ‘{print $9}‘` fifteenminute=`uptime |awk ‘{print $10}‘` SECONDS=0 # echo ${oneminute:0:4} while [ $SECONDS -le 1200 ] do echo ${oneminute:0:4} >> ~/getLoad/1minute.txt echo ${fiveminute:0:4} >> ~/getLoad/5minute.txt echo ${fifteenminute} >> ~/getLoad/15minute.txt sleep 2 done
以上是关于linux抓取load average数据的主要内容,如果未能解决你的问题,请参考以下文章