I need a script that checks for the CPU load average ("uptime") every 3 minutes, and after 3 checks that all of the are higher then "10". I would like to restart my Java server (that is another script that already works fine).
When I restart my java server it takes a few minutes to restart and the load average jumps to 15 for a 10 minutes.
Basically I think I need a "while" script, that will trigger the restart script. and in the restart script, I should kill the while script before restarting, and start again when finished restarting.
I know what I need - but I don't even know where to begin.
Please help! Thanks!