|
|
@ -20,7 +20,7 @@ function memory(){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#3、swap使用情况 #返回数值 |
|
|
|
#3、swap使用情况 #返回数值 |
|
|
|
function memory(){ |
|
|
|
function swap(){ |
|
|
|
free -m |awk 'NR==3{print $3}' |
|
|
|
free -m |awk 'NR==3{print $3}' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -103,3 +103,34 @@ function crontab(){ |
|
|
|
sudo crontab -l -u $1 |
|
|
|
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 |