aboutsummaryrefslogtreecommitdiff
path: root/src/trinitycore/monitor-mangosd
diff options
context:
space:
mode:
authorpanaut0lordv <panaut0lordv@gmail.com>2009-03-20 22:17:39 +0100
committerpanaut0lordv <panaut0lordv@gmail.com>2009-03-20 22:17:39 +0100
commite409fb63e9fd47f4c586ab43ca4b42b9ca58b423 (patch)
tree760385782ea4fc140e62c6f127509f77d691a47a /src/trinitycore/monitor-mangosd
parentf3a543bef3690dae643653ff97120db17ba13d34 (diff)
mangosd->trinitycore & realmd->trinityrealm
--HG-- branch : trunk
Diffstat (limited to 'src/trinitycore/monitor-mangosd')
-rw-r--r--src/trinitycore/monitor-mangosd18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/trinitycore/monitor-mangosd b/src/trinitycore/monitor-mangosd
new file mode 100644
index 00000000000..a740ae5e8fa
--- /dev/null
+++ b/src/trinitycore/monitor-mangosd
@@ -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