*Some final clean up. Now it should be the same as before.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-24 12:14:52 -06:00
parent fb2cb07d87
commit e41ff462fa
7 changed files with 62 additions and 170 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
# Massive Network Game Object Server
# Monitoring Script
pid=`ps ax | awk '($5 ~ /mangos-worldd/) { print $1 }'`
cpu=`top -b -n 1 -p $pid | awk '($12 ~ /mangos-worldd/) { print $9 }'`
#echo $pid
#echo $cpu
intcpu=${cpu%.*}
#echo $intcpu
if [ "$intcpu" -gt "95" ]
then
kill -9 $pid
echo "Killed MaNGOS for exceeding it's cpu limit."
echo `date` ", Killed MaNGOS for $intcpu% CPU Usage." >> serverlog
else
echo "MaNGOS Passes the cpu test."
fi