Created
January 9, 2019 12:57
-
-
Save bing0o/51c179844eb4e5a1e1236660f41ff6d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| mem=$(free -m | awk 'NR==2{print $3*100/$2}' | awk -F. '{print $1}') | |
| disk=$(df -h | awk '$NF=="/"{print $5}' | awk -F% '{print $1}') | |
| cpu=$(top -bn1 | grep load | awk '{print $(NF-2)}' | awk -F. '{print $1}') | |
| if [ "$cpu" -ge "80" ] | |
| then | |
| notify-send -u critical "The CPU Almost Filled: $cpu" | |
| fi | |
| if [ "$disk" -ge "80" ] | |
| then | |
| notify-send -u critical "The DISC Almost Filled: $disk" | |
| fi | |
| if [ "$mem" -ge "80" ] | |
| then | |
| notify-send -u critical "The MEMORY Almost Filled: $mem" | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment