码迷,mamicode.com
首页 > 其他好文 > 详细

统计单日计算节点系统负荷、内存利用率和磁盘利用率 平均值和峰值

时间:2016-04-22 18:08:43      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

cat 192.168.101.* | grep load | awk ‘{sum+=$4} END {print "average=", sum/NR}‘

cat 192.168.101.* | grep Memory | awk ‘{sum+=$3} END {print "average=", sum/NR}‘

cat 192.168.101.* | grep os-root | awk ‘{sum+=$5} END {print "average=", sum/NR}‘

 

cat 192.168.101.* | grep load | awk ‘BEGIN {max = 0} {if ($4>max) max=$4 fi} END {print "max=", max}‘

cat 192.168.101.* | grep Memory | awk ‘BEGIN {max = 0} {if ($3>max) max=$3 fi} END {print "max=", max}‘

cat 192.168.101.* | grep os-root | awk ‘BEGIN {max = 0} {if ($5>max) max=$5 fi} END {print "max=", max}‘

 

标橙色一条有错误,如下:

[root@XXXX]# cat 192.168.101.* | grep load
system load average: 0.73
system load average: 1.32
system load average: 0.59
system load average: 1.55
system load average: 1.92
system load average: 1.28
system load average: 1.00
system load average: 0.29
system load average: 2.42
system load average: 1.14
system load average: 0.45
system load average: 0.10
system load average: 2.01
system load average: 1.40
system load average: 1.21
system load average: 0.82
system load average: 14.61
system load average: 3.40
system load average: 0.17
system load average: 2.39
system load average: 0.16
system load average: 3.25
system load average: 1.15
system load average: 0.26
system load average: 0.17

[root@XXXX]# cat 192.168.101.* | grep load | awk ‘BEGIN {max = 0} {if ($4>max) max=$4 fi} END {print "max=", max}‘

max= 3.40

结果竟然是3.40而不是14.61

待探究

 

统计单日计算节点系统负荷、内存利用率和磁盘利用率 平均值和峰值

标签:

原文地址:http://www.cnblogs.com/cmss/p/5422304.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!