From b0724c728855aaf7f053bf4cbc7de5237d6aa958 Mon Sep 17 00:00:00 2001 From: newrain Date: Wed, 16 Jun 2021 17:53:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=B3=BB=E7=BB=9F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- osMonitor.sh | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/osMonitor.sh b/osMonitor.sh index 697a221..c78f28a 100644 --- a/osMonitor.sh +++ b/osMonitor.sh @@ -20,7 +20,7 @@ function memory(){ } #3、swap使用情况 #返回数值 -function memory(){ +function swap(){ free -m |awk 'NR==3{print $3}' } @@ -103,3 +103,34 @@ function crontab(){ sudo crontab -l -u $1 } +case $1 in +Disk) + disk +;; +Memory) + memory +;; +Swap) + swap +;; +CPULoad) + cpuLoad $2 # 1 5 15 +;; +FileMD5) + fileMD5 +;; +Uptime) + uptime $2 # upTime idleTime idle +;; +Conns) + conns $2 # all [1-9]* +;; +Ports) + ports $2 # portList port +;; +Services) + services $2 # servicesList service +;; +Crontab) + crontab $2 # user +esac \ No newline at end of file