High CPU Usage Script
#!/bin/bash |
2 | while [ true ] ;do |
3 | used=`free -m |awk 'NR==3 {print $4}'` |
4 |
5 | if [ $used -lt 1000 ] && [ $used -gt 800 ]; then |
6 | echo "Free memory is below 1000MB. Possible memory leak!!!" | /bin/mail -s "HIGH MEMORY ALERT!!!" user@mydomain.com |
7 |
8 |
9 | fi |
10 | sleep 5 |
11 | done |
0 Comments
Post a Comment