servertweak
Verified User
- Joined
- Feb 3, 2005
- Messages
- 266
Find this this on another thread will be great to have in DA admin panel
Now again, found this from another thread and will like to see it on DA
#!/bin/bash
up=`uptime`;
echo $up >> /home/shell/chris/public_html/server_load.txt
up=`echo $up|awk '{split($0,a,"average:"); print a[2]}'`
#echo $up;
a=`echo $up|awk '{split($0,a,","); print a[1]}'|awk '{split($0,a,"."); print a[1]}'`
b=`echo $up|awk '{split($0,a,","); print a[2]}'|awk '{split($0,a,"."); print a[1]}'`
c=`echo $up|awk '{split($0,a,","); print a[3]}'|awk '{split($0,a,"."); print a[1]}'`
x=0;
if [ $a -gt 1 ]; then x=$(expr $x + 1); fi
if [ $b -gt 1 ]; then x=$(expr $x + 1); fi
if [ $c -gt 1 ]; then x=$(expr $x + 1); fi
if [ "$x" -eq 3 ]; then mail -s "Inertia $up" [email protected] < /home/shell/chris/public_html/server_load.txt; fi
Now again, found this from another thread and will like to see it on DA