使用shell脚本查询主机cpu、内存、硬盘使用情况(显示时间,IP,使用情况等)。

cpu: 代码: #!/bin/bash if [ uname != “Linux” ];then echo “操作系统不是Linux.” exit 1 fi which vmstat &>/dev/null if [ $? -ne 0 ];then echo “vmstat没装” exit 1 fi cpu_us=vmstat | awk '{print $13}' | sed -n '$p'
相关文章
相关标签/搜索