Results 1 to 1 of 1
So, I'm trying to email myself when the load of the server is greater than 5. Here is my code, unfortunately, it doesn't work. I Get:
./action: line 8: [: ...
- 04-22-2011 #1Just Joined!
- Join Date
- Jul 2009
- Posts
- 24
Using Mail Variables and who for a result
So, I'm trying to email myself when the load of the server is greater than 5. Here is my code, unfortunately, it doesn't work. I Get:
./action: line 8: [: 0.28: integer expression expected
I'm guessing the 0.28 is the current load
Code:#!/bin/bash load=`w | awk 'NR == 1 {print}' | awk '{print $8}' | sed 's/,//'`; loadout=$load >> load.out warn=`echo CPANEL3 LOAD IS:`; LIMIT=5 # if [ "$load" -gt 0 ] then ; if [ $load -gt "0" ] then echo "$warn $load | mail -s "$warn $load" `cat mail`" fi #echo "SYSTEM Load is high" | mail -s "SYSTEM LOAD HIGH '$LOADOUT'" email@email.com < load.out #echo "SYSTEM LOAD IS:" > load.out |exec w | awk 'NR == 1 {print}' | awk '{print $8}' | sed 's/,//' >> load.out


Reply With Quote