使用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'
相關文章
相關標籤/搜索