Munin monitoring for multiplay servers


(ASD) #1

Hi,

i use munin http://munin-monitoring.org/ for monitoring my servers
as I now have a DB server with multiplay I wrote a munin plugin for counting the players on my server and draw a nice graphic
https://munin.auz.at/euve112179/euve112179/dirtybombusers.html (not much data collected right now)

I’m sure all programmers will cry because of this dirty code but … hey it works :stuck_out_tongue:

if you like… use it (and modify the URL and maybe the name :slight_smile: )

dirty code inside

#!/bin/ksh
#################################################################

case $1 in
config)
echo “graph_title Number of Players in AuZ DirtyBomb server
graph_args -r --lower-limit 0
graph_vlabel players
graph_category stuff
players.draw AREA
players.colour e5e500
players.label Players online”

exit 0;;
esac

#################################################################
#---------------------------------------------------------------#

#tempfile mit PID im namen verwenden
tempfile=/tmp/munin_db_players_monitor_tempfile_$$

#aktuelle daten holen
wget https://clanforge.multiplay.co.uk/servers/6335951767/view -O $tempfile >> /dev/null 2>&1

#player rausgreifen
currenplayers=$(cat ${tempfile}| grep “Players:” | awk ‘{print $1}’ | sed ‘s!<___dt>Players:<___/dt><___dd>!!g’)

#und rein in die rrd
echo "players.value "${currenplayers};

#tempfile entsorgen
rm -f $tempfile

please remove “___” from the code above I inserted it as the forum starts interpreting the code and breaking the text

Regards
ASD