标签:shell
#!/bin/bashtop -n 1 | awk -F ‘[ %]+‘ ‘NR==3 {print $2}‘df -h | grep $data_name | awk -F ‘[ %]+‘ ‘{print $5}‘free -m | awk -F ‘[ :]+‘ ‘NR==2{print $2}‘free -m | awk -F ‘[ :]+‘ ‘NR==3{print $3}‘awk ‘BEGIN{printf "%.0f\n",(‘$mem_used‘/‘$mem_total‘)*100}‘date ‘+%F %T‘利用shell监控cpu、磁盘、内存使用率,达到警报阈值发邮件进行通知
标签:shell
原文地址:http://blog.51cto.com/12962336/2092699