Last active
March 13, 2018 10:55
-
-
Save erickvasilev/cc9fdc2a78e3cb22429abec8fd350eb4 to your computer and use it in GitHub Desktop.
Check if high load
This file contains 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 | |
trigger=2.30 | |
load=`cat /proc/loadavg | awk '{print $1}'` | |
response=`echo | awk -v T=$trigger -v L=$load 'BEGIN{if ( L > T){ print "greater"}}'` | |
if [[ $response = "greater" ]] | |
then | |
reboot | |
else | |
echo $load | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment