mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Added several Minecraft/Bukkit plugins (depending on JSONAPI, Statistician and Ultrabans) to show the current online players, the RAM usage, the current TPS (ticks per second), hostile/neutral/passive mob kills per day, new players/visitors per day and kicks/ban/mutes/jail/unban/etc. per day - http://s.frd.mn/XJsryR for more informations
This commit is contained in:
parent
46d1dcc987
commit
bed5815230
8 changed files with 758 additions and 0 deletions
55
plugins/minecraft/minecraft-jsonapi-players
Normal file
55
plugins/minecraft/minecraft-jsonapi-players
Normal file
|
@ -0,0 +1,55 @@
|
|||
#!/usr/bin/php
|
||||
<?php
|
||||
/**
|
||||
* Bukkit player online Munin plugin
|
||||
* ---------------------------------
|
||||
*
|
||||
* Shows the current online players
|
||||
* (parsed via JSONAPI)
|
||||
*
|
||||
* Read more about my plugins on my blog:
|
||||
* http://s.frd.mn/XJsryR
|
||||
*
|
||||
* Author: Jonas Friedmann (http://frd.mn)
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* JSONAPI configuration
|
||||
*/
|
||||
|
||||
$hostname = 'your-hostname';
|
||||
$username = 'your-username';
|
||||
$password = 'your-password';
|
||||
$salt = 'your-salt';
|
||||
$port = 20059;
|
||||
|
||||
/**
|
||||
* !!! DO NOT EDIT THIS PART BELOW !!!
|
||||
*/
|
||||
|
||||
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
||||
{
|
||||
print("graph_title Bukkit / JSONAPI - players online
|
||||
graph_category bukkit_jsonapi
|
||||
graph_vlabel players
|
||||
graph_args --base 1000 -l 0
|
||||
players.type GAUGE
|
||||
players.label players
|
||||
");
|
||||
exit();
|
||||
}
|
||||
|
||||
// Include JSONAPI.php SDK (get this file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php)
|
||||
require('/var/cache/munin/JSONAPI.php');
|
||||
|
||||
// Prepare API call
|
||||
$api = new JSONAPI($hostname, $port, $username, $password, $salt);
|
||||
$result = $api->call("getPlayerCount");
|
||||
|
||||
// Check for success
|
||||
if ($result['result'] == 'success'){
|
||||
// Print values
|
||||
print('players.value ' . $result['success'] . "\n");
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue