2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

comment format renewal

This commit is contained in:
Jonas Friedmann 2013-03-28 16:06:49 +01:00 committed by Steve Schnepp
parent 22436814ea
commit 4192c14f76
8 changed files with 250 additions and 172 deletions

View File

@ -1,14 +1,22 @@
#!/usr/bin/php
<?php
###########################################################
## - Bukkit player online Munin plugin - ##
###########################################################
## Script by: ##
## Jonas Friedmann (@frdmn) ##
## http://blog.frd.mn ##
###########################################################
## JSONAPI ##
###########################################################
/**
* 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';
@ -16,9 +24,10 @@ $password = 'your-password';
$salt = 'your-salt';
$port = 20059;
###########################################################
## DON'T EDIT THIS ##
###########################################################
/**
* !!! DO NOT EDIT THIS PART BELOW !!!
*/
if ((count($argv) > 1) && ($argv[1] == 'config'))
{
print("graph_title Bukkit / JSONAPI - players online
@ -31,16 +40,16 @@ players.label players
exit();
}
## Include JSONAPI.php SDK (get this file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php)
// 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
// Prepare API call
$api = new JSONAPI($hostname, $port, $username, $password, $salt);
$result = $api->call("getPlayerCount");
## Check for success
// Check for success
if ($result['result'] == 'success'){
## Print values
// Print values
print('players.value ' . $result['success'] . "\n");
}
?>

View File

@ -1,14 +1,22 @@
#!/usr/bin/php
<?php
###########################################################
## - Bukkit RAM usage Munin plugin - ##
###########################################################
## Script by: ##
## Jonas Friedmann (@frdmn) ##
## http://blog.frd.mn ##
###########################################################
## JSONAPI ##
###########################################################
/**
* Bukkit RAM usage Munin plugin
* ---------------------------------
*
* Shows the current RAM usage of your Minecraft process
* an the total RAM (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';
@ -16,9 +24,10 @@ $password = 'your-password';
$salt = 'your-salt';
$port = 20059;
###########################################################
## DON'T EDIT THIS ##
###########################################################
/**
* !!! DO NOT EDIT THIS PART BELOW !!!
*/
if ((count($argv) > 1) && ($argv[1] == 'config'))
{
print("graph_title Bukkit / JSONAPI - RAM usage
@ -33,10 +42,10 @@ used.type GAUGE
exit();
}
## Include JSONAPI.php SDK (get this file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php)
// 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
// Prepare API call
$api = new JSONAPI($hostname, $port, $username, $password, $salt);
$result = $api->callMultiple(array(
"system.getJavaMemoryUsage",
@ -46,9 +55,9 @@ $result = $api->callMultiple(array(
array(),
));
## Check for success
// Check for success
if ($result['result'] == 'success'){
## Print values
// Print values
print('used.value ' . round($result['success'][0]['success']/1000,2) . "\n");
print('total.value ' . round($result['success'][1]['success']/1000,2) . "\n");
}

View File

@ -1,14 +1,22 @@
#!/usr/bin/php
<?php
###########################################################
## - Bukkit TPS Munin plugin - ##
###########################################################
## Script by: ##
## Jonas Friedmann (@frdmn) ##
## http://blog.frd.mn ##
###########################################################
## JSONAPI ##
###########################################################
/**
* Bukkit TPS Munin plugin
* ---------------------------------
*
* Shows the current TPS (ticks per second) of your
* Minecraft server (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';
@ -16,9 +24,10 @@ $password = 'your-password';
$salt = 'your-salt';
$port = 20059;
###########################################################
## DON'T EDIT THIS ##
###########################################################
/**
* !!! DO NOT EDIT THIS PART BELOW !!!
*/
if ((count($argv) > 1) && ($argv[1] == 'config'))
{
print("graph_title Bukkit / JSONAPI - ticks per second (TPS)
@ -31,16 +40,16 @@ tps.label TPS
exit();
}
## Include JSONAPI.php SDK (get this file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php)
// 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
// Prepare API call
$api = new JSONAPI($hostname, $port, $username, $password, $salt);
$result = $api->call("system.getServerClockDebug");
## Check for success
// Check for success
if ($result['result'] == 'success'){
## Print values
// Print values
print('tps.value ' . round($result['success']['clockRate'], 2) . "\n");
}
?>

View File

@ -1,14 +1,23 @@
#!/usr/bin/php
<?php
###########################################################
## - Bukkit hostile mob kills per day Munin plugin - ##
###########################################################
## Script by: ##
## Jonas Friedmann (@frdmn) ##
## http://frd.mn ##
###########################################################
## MySQL ##
###########################################################
/**
* Bukkit/MySQL Munin plugin
* ---------------------------------
* Hostile mob kills per day
*
* Shows the daily kills of hostile mobs
* via Statistician (http://s.frd.mn/14qKXTM)
*
* Read more about my plugins on my blog:
* http://s.frd.mn/XJsryR
*
* Author: Jonas Friedmann (http://frd.mn)
*
*/
/**
* MySQL configuration
*/
$hostname = 'localhost';
$username = 'sql';
@ -16,9 +25,10 @@ $password = 'pass';
$database = 'sql';
$port = 3306;
###########################################################
## DON'T EDIT THIS ##
###########################################################
/**
* !!! DO NOT EDIT THIS PART BELOW !!!
*/
if ((count($argv) > 1) && ($argv[1] == 'config'))
{
print("graph_title Bukkit / Statistician - hostile mob kills per day

View File

@ -1,14 +1,23 @@
#!/usr/bin/php
<?php
###########################################################
## - Bukkit neutral mob kills per day Munin plugin - ##
###########################################################
## Script by: ##
## Jonas Friedmann (@frdmn) ##
## http://frd.mn ##
###########################################################
## MySQL ##
###########################################################
/**
* Bukkit/MySQL Munin plugin
* ---------------------------------
* Neutral mob kills per day
*
* Shows the daily kills of neutral mobs
* via Statistician (http://s.frd.mn/14qKXTM)
*
* Read more about my plugins on my blog:
* http://s.frd.mn/XJsryR
*
* Author: Jonas Friedmann (http://frd.mn)
*
*/
/**
* MySQL configuration
*/
$hostname = 'localhost';
$username = 'sql';
@ -16,9 +25,10 @@ $password = 'pass';
$database = 'sql';
$port = 3306;
###########################################################
## DON'T EDIT THIS ##
###########################################################
/**
* !!! DO NOT EDIT THIS PART BELOW !!!
*/
if ((count($argv) > 1) && ($argv[1] == 'config'))
{
print("graph_title Bukkit / Statistician - neutral mob kills per day
@ -37,43 +47,43 @@ snowman.label killed snowmen
exit();
}
## Construct 'minumum' timstamp
// Construct 'minumum' timstamp
$current = mktime();
$today = mktime(0, 0, 0, date("n", $current), date("j", $current), date("Y", $current));
## Initiate connection
// Initiate connection
$connection = mysqli_connect($hostname, $username, $password, $database, $port);
## Check connection
// Check connection
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
## Select queries for enderman and return the amount of rows
// Select queries for enderman and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Enderman'")) {
## Print values
// Print values
print('enderman.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for wolf kills and return the amount of rows
// Select queries for wolf kills and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Wolf'")) {
## Print values
// Print values
print('wolf.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for zombie pigman kills and return the amount of rows
// Select queries for zombie pigman kills and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Zombie Pigman'")) {
## Print values
// Print values
print('zombiepigman.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for zombie snowman kills and return the amount of rows
// Select queries for zombie snowman kills and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Snowman'")) {
## Print values
// Print values
print('snowman.value ' . mysqli_num_rows($result) . "\n");
}
## Close connection
// Close connection
mysqli_close($connection);
?>

View File

@ -1,14 +1,23 @@
#!/usr/bin/php
<?php
###########################################################
## - Bukkit passive mob kills per day Munin plugin - ##
###########################################################
## Script by: ##
## Jonas Friedmann (@frdmn) ##
## http://frd.mn ##
###########################################################
## MySQL ##
###########################################################
/**
* Bukkit/MySQL Munin plugin
* ---------------------------------
* Passive mob kills per day
*
* Shows the passive kills of neutral mobs
* via Statistician (http://s.frd.mn/14qKXTM)
*
* Read more about my plugins on my blog:
* http://s.frd.mn/XJsryR
*
* Author: Jonas Friedmann (http://frd.mn)
*
*/
/**
* MySQL configuration
*/
$hostname = 'localhost';
$username = 'sql';
@ -16,9 +25,10 @@ $password = 'pass';
$database = 'sql';
$port = 3306;
###########################################################
## DON'T EDIT THIS ##
###########################################################
/**
* !!! DO NOT EDIT THIS PART BELOW !!!
*/
if ((count($argv) > 1) && ($argv[1] == 'config'))
{
print("graph_title Bukkit / Statistician - passive mob kills per day
@ -47,73 +57,73 @@ villager.label killed villager
exit();
}
## Construct 'minumum' timstamp
// Construct 'minumum' timstamp
$current = mktime();
$today = mktime(0, 0, 0, date("n", $current), date("j", $current), date("Y", $current));
## Initiate connection
// Initiate connection
$connection = mysqli_connect($hostname, $username, $password, $database, $port);
## Check connection
// Check connection
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
## Select queries for bat kills and return the amount of rows
// Select queries for bat kills and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Bat'")) {
## Print values
// Print values
print('bat.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for chicken kills and return the amount of rows
// Select queries for chicken kills and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Chicken'")) {
## Print values
// Print values
print('chicken.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for mooshroom kills and return the amount of rows
// Select queries for mooshroom kills and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'MushroomCow'")) {
## Print values
// Print values
print('mooshroom.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for cow kills and return the amount of rows
// Select queries for cow kills and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Cow'")) {
## Print values
// Print values
print('cow.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for ocelot kills and return the amount of rows
// Select queries for ocelot kills and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Ocelot'")) {
## Print values
// Print values
print('ocelot.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for pig kills and return the amount of rows
// Select queries for pig kills and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Pig'")) {
## Print values
// Print values
print('pig.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for sheep and return the amount of rows
// Select queries for sheep and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Sheep'")) {
## Print values
// Print values
print('sheep.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for squid kills and return the amount of rows
// Select queries for squid kills and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Squid'")) {
## Print values
// Print values
print('squid.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for villager and return the amount of rows
// Select queries for villager and return the amount of rows
if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Villager'")) {
## Print values
// Print values
print('villager.value ' . mysqli_num_rows($result) . "\n");
}
## Close connection
// Close connection
mysqli_close($connection);
?>

View File

@ -1,14 +1,23 @@
#!/usr/bin/php
<?php
###########################################################
## - Bukkit new players per day Munin plugin - ##
###########################################################
## Script by: ##
## Jonas Friedmann (@frdmn) ##
## http://frd.mn ##
###########################################################
## MySQL ##
###########################################################
/**
* Bukkit/MySQL Munin plugin
* ---------------------------------
* New players per day
*
* Shows the new players / visitors per day
* via Statistician (http://s.frd.mn/14qKXTM)
*
* Read more about my plugins on my blog:
* http://s.frd.mn/XJsryR
*
* Author: Jonas Friedmann (http://frd.mn)
*
*/
/**
* MySQL configuration
*/
$hostname = 'localhost';
$username = 'sql';
@ -16,9 +25,10 @@ $password = 'pass';
$database = 'sql';
$port = 3306;
###########################################################
## DON'T EDIT THIS ##
###########################################################
/**
* !!! DO NOT EDIT THIS PART BELOW !!!
*/
if ((count($argv) > 1) && ($argv[1] == 'config'))
{
print("graph_title Bukkit / Statistician - new players per day
@ -31,25 +41,25 @@ players.label new players
exit();
}
## Construct 'minumum' timstamp
// Construct 'minumum' timstamp
$current = mktime();
$today = mktime(0, 0, 0, date("n", $current), date("j", $current), date("Y", $current));
## Initiate connection
// Initiate connection
$connection = mysqli_connect($hostname, $username, $password, $database, $port);
## Check connection
// Check connection
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
## Select queries return the amount of rows
// Select queries return the amount of rows
if ($result = mysqli_query($connection, "SELECT player_name FROM players WHERE firstever_login > $today")) {
## Print values
// Print values
print('players.value ' . mysqli_num_rows($result) . "\n");
}
## Close connection
// Close connection
mysqli_close($connection);
?>

View File

@ -1,14 +1,24 @@
#!/usr/bin/php
<?php
###########################################################
## - Bukkit shame per day Munin plugin - ##
###########################################################
## Script by: ##
## Jonas Friedmann (@frdmn) ##
## http://frd.mn ##
###########################################################
## MySQL ##
###########################################################
/**
* Bukkit/MySQL Munin plugin
* ---------------------------------
* Kicks/bans/jails/etc. per day
*
* Shows the amount and kind of shame that
* happens on your server via Ultrabans
* (http://s.frd.mn/14qLR2B)
*
* Read more about my plugins on my blog:
* http://s.frd.mn/XJsryR
*
* Author: Jonas Friedmann (http://frd.mn)
*
*/
/**
* MySQL configuration
*/
$hostname = 'localhost';
$username = 'sql';
@ -16,9 +26,10 @@ $password = 'pass';
$database = 'sql';
$port = 3306;
###########################################################
## DON'T EDIT THIS ##
###########################################################
/**
* !!! DO NOT EDIT THIS PART BELOW !!!
*/
if ((count($argv) > 1) && ($argv[1] == 'config'))
{
print("graph_title Bukkit / Ultrabans - shame per day
@ -47,76 +58,76 @@ mute.label mutes
exit();
}
## Construct 'minumum' timstamp
// Construct 'minumum' timstamp
$current = mktime();
$today = mktime(0, 0, 0, date("n", $current), date("j", $current), date("Y", $current));
## Initiate connection
// Initiate connection
$connection = mysqli_connect($hostname, $username, $password, $database, $port);
## Check connection
// Check connection
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
## Select queries for unbans return the amount of rows
// Select queries for unbans return the amount of rows
if ($result = mysqli_query($connection, "SELECT name FROM banlist WHERE type = 5 AND time > $today")) {
## Print values
// Print values
print('unban.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for kicks return the amount of rows
// Select queries for kicks return the amount of rows
if ($result = mysqli_query($connection, "SELECT name FROM banlist WHERE type = 3 AND time > $today")) {
## Print values
// Print values
print('kick.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for warnings return the amount of rows
// Select queries for warnings return the amount of rows
if ($result = mysqli_query($connection, "SELECT name FROM banlist WHERE type = 2 AND time > $today")) {
## Print values
// Print values
print('warning.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for bans return the amount of rows
// Select queries for bans return the amount of rows
if ($result = mysqli_query($connection, "SELECT name FROM banlist WHERE type = 0 AND time > $today")) {
## Print values
// Print values
print('ban.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for ipbans return the amount of rows
// Select queries for ipbans return the amount of rows
if ($result = mysqli_query($connection, "SELECT name FROM banlist WHERE type = 1 AND time > $today")) {
## Print values
// Print values
print('ipban.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for fines return the amount of rows
// Select queries for fines return the amount of rows
if ($result = mysqli_query($connection, "SELECT name FROM banlist WHERE type = 4 AND time > $today")) {
## Print values
// Print values
print('fine.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for jails return the amount of rows
// Select queries for jails return the amount of rows
if ($result = mysqli_query($connection, "SELECT name FROM banlist WHERE type = 6 AND time > $today")) {
## Print values
// Print values
print('jail.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for permbans return the amount of rows
// Select queries for permbans return the amount of rows
if ($result = mysqli_query($connection, "SELECT name FROM banlist WHERE type = 9 AND time > $today")) {
## Print values
// Print values
print('permban.value ' . mysqli_num_rows($result) . "\n");
}
## Select queries for mutes - part 1 return the amount of rows
// Select queries for mutes - part 1 return the amount of rows
if ($result = mysqli_query($connection, "SELECT name FROM banlist WHERE type = 7 AND time > $today")) {
## Store result
// Store result
$tmp1 = mysqli_num_rows($result);
}
## Select queries for mutes - part 2 return the amount of rows
// Select queries for mutes - part 2 return the amount of rows
if ($result = mysqli_query($connection, "SELECT name FROM banlist WHERE type = 8 AND time > $today")) {
## Store result
// Store result
$tmp2 = mysqli_num_rows($result);
}
@ -124,6 +135,6 @@ $mutes = $tmp1 + $tmp2;
print('mute.value ' . $mutes . "\n");
## Close connection
// Close connection
mysqli_close($connection);
?>