diff options
| author | megamage <none@none> | 2008-12-24 12:14:52 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2008-12-24 12:14:52 -0600 |
| commit | e41ff462fa9b2d5fc7419378a0c1d7d9bcab827a (patch) | |
| tree | 0ab55bb888b09f2393b948b18a15987d0800b836 /src/trinitycore | |
| parent | fb2cb07d87e34c55c98d7d3e351e1cd993f5a49b (diff) | |
*Some final clean up. Now it should be the same as before.
--HG--
branch : trunk
Diffstat (limited to 'src/trinitycore')
| -rw-r--r-- | src/trinitycore/monitor-mangosd | 18 | ||||
| -rw-r--r-- | src/trinitycore/resource.h | 15 | ||||
| -rw-r--r-- | src/trinitycore/run-mangosd | 14 |
3 files changed, 47 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 diff --git a/src/trinitycore/resource.h b/src/trinitycore/resource.h new file mode 100644 index 00000000000..7e7d8e4b76f --- /dev/null +++ b/src/trinitycore/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by TrinityCore.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/src/trinitycore/run-mangosd b/src/trinitycore/run-mangosd new file mode 100644 index 00000000000..f307bd9e1ad --- /dev/null +++ b/src/trinitycore/run-mangosd @@ -0,0 +1,14 @@ +#!/bin/bash +# Trinity Server +# autorestart Script + +while : +do + echo "TrinityCore daemon restarted" + echo `date` >> crash.log & + ./mangosd | tail -n 20 >> crash.log + echo " " >> crash.log & + pid=`ps ax | awk '($5 ~ /trinitycore/) { print $1 }'` + wait $pid + echo `date` ", TrinityCore daemon crashed and restarted." >> serverlog +done |
