root/trunk/src/trinitycore/monitor-mangosd @ 5

Revision 2, 459 bytes (checked in by yumileroy, 17 years ago)

[svn] * Proper SVN structure

Original author: Neo2003
Date: 2008-10-02 16:23:55-05:00

Line 
1#!/bin/bash
2# Massive Network Game Object Server
3# Monitoring Script
4
5pid=`ps ax | awk '($5 ~ /mangos-worldd/) { print $1 }'`
6cpu=`top -b -n 1 -p $pid | awk '($12 ~ /mangos-worldd/) { print $9 }'`
7#echo $pid
8#echo $cpu
9intcpu=${cpu%.*}
10#echo $intcpu
11if [ "$intcpu" -gt "95" ]
12then
13        kill -9 $pid
14        echo "Killed MaNGOS for exceeding it's cpu limit."
15        echo `date` ", Killed MaNGOS for $intcpu% CPU Usage." >> serverlog
16else
17        echo "MaNGOS Passes the cpu test."
18fi
Note: See TracBrowser for help on using the browser.