Recently I've set up a Munin monitoring platform to get an in-depth overview for my running services and servers. Here's how to monitor your Minecraft server using Munin monitoring.
Someday, I had the great idea to add and track my Bukkit (Minecraft) server somehow on that Munin instance as well. Due to JSONAPI — which provides hundreds of API-calls through HTTP, TCP and WebSocket streams — it is pretty easy to get the necessary informations for the Munin plugin.
So I started to gather some informations about plugin development in Munin and six hours later my Munin looked like this:
In the picture above you can see the three PHP-based plugins which track that lets you track:
- TPS (ticks per second)
- RAM usage
- players currently online
You can grab them via my GitHub repo or you just follow this little tutorial how to set those up. Please note that the paths and Munin folders might be different if you compiled Munin from source or run a different distribution than Debian.
Clone the git repo:
git clone git://github.com/frdmn/munin-bukkit-plugins.git
Adjust the variables in each plugin file
- Make sure the PHP binary in the Shebang line is executable
- Perform your configuration (see above)
Move the plugins into the Munin plugin directory:
mv mcjson* /usr/share/munin/plugins/
Change the ownership:
chown munin:munin /usr/share/munin/plugins/mcjson*
Make sure they are executable:
chmod 755 /usr/share/munin/plugins/mcjson*
Enable the plugins:
ln -s /usr/share/munin/plugins/mcjson* /etc/munin/plugins/
Restart your munin-node:
service munin-node restart
Run your cron:
su - munin --shell=/bin/sh -c /usr/bin/munin-cron
You did it! Point your browser to your Munin instance and enjoy the nice Bukkit graphs! :)
Update, March 27, 07:29 am
I took a look at my MySQL tables again to find some more useful resources that I can turn into neat fancy graphs and came across the SQL data of UltraBans and Statistician. Both plugins became very essential for my Minecraft server: UltraBans is responsible and bedrock of our Hall of Shame because it stores the ban entries in SQL tables and not in flat-files. Statistician is a detailed stats tracking plugin and allows us our statistics frontend.
So I wrote five SQL based plugins:
(screenshot coming tomorrow)
- hostile mob kills (via Statistician)
- neutral mob kills (via Statistician)
- passive mob kills (via Statistician)
- new players per day (via Statistician)
- kicks/bans/mutes/etc. per day (via UltraBans)
You can find them in the existing repository on GitHub. The configuration and installation is pretty much the same like the JSONAPI ones above. Just change the MySQL credentials in each plugin, enable them, restart Munin and you are done!