diff --git a/plugins/minecraft/jsonapi/mcjsonplayers b/plugins/minecraft/bukkit-jsonapi-players similarity index 92% rename from plugins/minecraft/jsonapi/mcjsonplayers rename to plugins/minecraft/bukkit-jsonapi-players index 49781c1b..69cd5ba0 100644 --- a/plugins/minecraft/jsonapi/mcjsonplayers +++ b/plugins/minecraft/bukkit-jsonapi-players @@ -11,7 +11,8 @@ * http://s.frd.mn/XJsryR * * Author: Jonas Friedmann (http://frd.mn) - * + * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins + * */ /** @@ -31,7 +32,7 @@ $port = 20059; if ((count($argv) > 1) && ($argv[1] == 'config')) { print("graph_title Bukkit / JSONAPI - players online -graph_category bukkit_jsonapi +graph_category bukkit graph_vlabel players graph_args --base 1000 -l 0 players.type GAUGE @@ -52,4 +53,4 @@ if ($result['result'] == 'success'){ // Print values print('players.value ' . $result['success'] . "\n"); } -?> \ No newline at end of file +?> diff --git a/plugins/minecraft/jsonapi/mcjsonramusage b/plugins/minecraft/bukkit-jsonapi-ramusage similarity index 93% rename from plugins/minecraft/jsonapi/mcjsonramusage rename to plugins/minecraft/bukkit-jsonapi-ramusage index 5255320a..64e5f243 100644 --- a/plugins/minecraft/jsonapi/mcjsonramusage +++ b/plugins/minecraft/bukkit-jsonapi-ramusage @@ -11,7 +11,8 @@ * http://s.frd.mn/XJsryR * * Author: Jonas Friedmann (http://frd.mn) - * + * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins + * */ /** @@ -31,7 +32,7 @@ $port = 20059; if ((count($argv) > 1) && ($argv[1] == 'config')) { print("graph_title Bukkit / JSONAPI - RAM usage -graph_category bukkit_jsonapi +graph_category bukkit graph_vlabel RAM usage in GB graph_args --base 1024 -l 0 total.label total @@ -61,4 +62,4 @@ if ($result['result'] == 'success'){ print('used.value ' . round($result['success'][0]['success']/1000,2) . "\n"); print('total.value ' . round($result['success'][1]['success']/1000,2) . "\n"); } -?> \ No newline at end of file +?> diff --git a/plugins/minecraft/jsonapi/mcjsontps b/plugins/minecraft/bukkit-jsonapi-tps similarity index 92% rename from plugins/minecraft/jsonapi/mcjsontps rename to plugins/minecraft/bukkit-jsonapi-tps index 226d3400..cf3b31db 100644 --- a/plugins/minecraft/jsonapi/mcjsontps +++ b/plugins/minecraft/bukkit-jsonapi-tps @@ -11,7 +11,8 @@ * http://s.frd.mn/XJsryR * * Author: Jonas Friedmann (http://frd.mn) - * + * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins + * */ /** @@ -31,7 +32,7 @@ $port = 20059; if ((count($argv) > 1) && ($argv[1] == 'config')) { print("graph_title Bukkit / JSONAPI - ticks per second (TPS) -graph_category bukkit_jsonapi +graph_category bukkit graph_vlabel ticks per second graph_args --base 1000 -l 0 tps.type GAUGE @@ -52,4 +53,4 @@ if ($result['result'] == 'success'){ // Print values print('tps.value ' . round($result['success']['clockRate'], 2) . "\n"); } -?> \ No newline at end of file +?> diff --git a/plugins/minecraft/jsonapi/mcsqls2killshostile b/plugins/minecraft/bukkit-statistician-killshostile similarity index 98% rename from plugins/minecraft/jsonapi/mcsqls2killshostile rename to plugins/minecraft/bukkit-statistician-killshostile index 46ec0617..e6370307 100644 --- a/plugins/minecraft/jsonapi/mcsqls2killshostile +++ b/plugins/minecraft/bukkit-statistician-killshostile @@ -12,7 +12,8 @@ * http://s.frd.mn/XJsryR * * Author: Jonas Friedmann (http://frd.mn) - * + * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins + * */ /** @@ -32,7 +33,7 @@ $port = 3306; if ((count($argv) > 1) && ($argv[1] == 'config')) { print("graph_title Bukkit / Statistician - hostile mob kills per day -graph_category bukkit_sql_kills +graph_category bukkit graph_vlabel hostile mob kills per day graph_args --base 1000 -l 0 blaze.type GAUGE @@ -158,4 +159,4 @@ if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $ ## Close connection mysqli_close($connection); -?> \ No newline at end of file +?> diff --git a/plugins/minecraft/jsonapi/mcsqls2killsneutral b/plugins/minecraft/bukkit-statistician-killsneutral similarity index 96% rename from plugins/minecraft/jsonapi/mcsqls2killsneutral rename to plugins/minecraft/bukkit-statistician-killsneutral index 2f222f92..ee9e14ae 100644 --- a/plugins/minecraft/jsonapi/mcsqls2killsneutral +++ b/plugins/minecraft/bukkit-statistician-killsneutral @@ -12,7 +12,8 @@ * http://s.frd.mn/XJsryR * * Author: Jonas Friedmann (http://frd.mn) - * + * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins + * */ /** @@ -32,7 +33,7 @@ $port = 3306; if ((count($argv) > 1) && ($argv[1] == 'config')) { print("graph_title Bukkit / Statistician - neutral mob kills per day -graph_category bukkit_sql_kills +graph_category bukkit graph_vlabel neutral mob kills per day graph_args --base 1000 -l 0 enderman.type GAUGE @@ -86,4 +87,4 @@ if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $ // Close connection mysqli_close($connection); -?> \ No newline at end of file +?> diff --git a/plugins/minecraft/jsonapi/mcsqls2killspassive b/plugins/minecraft/bukkit-statistician-killspassive similarity index 97% rename from plugins/minecraft/jsonapi/mcsqls2killspassive rename to plugins/minecraft/bukkit-statistician-killspassive index b0e5b430..f43cf369 100644 --- a/plugins/minecraft/jsonapi/mcsqls2killspassive +++ b/plugins/minecraft/bukkit-statistician-killspassive @@ -12,7 +12,8 @@ * http://s.frd.mn/XJsryR * * Author: Jonas Friedmann (http://frd.mn) - * + * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins + * */ /** @@ -32,7 +33,7 @@ $port = 3306; if ((count($argv) > 1) && ($argv[1] == 'config')) { print("graph_title Bukkit / Statistician - passive mob kills per day -graph_category bukkit_sql_kills +graph_category bukkit graph_vlabel passive mob kills per day graph_args --base 1000 -l 0 bat.type GAUGE @@ -126,4 +127,4 @@ if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $ // Close connection mysqli_close($connection); -?> \ No newline at end of file +?> diff --git a/plugins/minecraft/jsonapi/mcsqls2players b/plugins/minecraft/bukkit-statistician-players similarity index 94% rename from plugins/minecraft/jsonapi/mcsqls2players rename to plugins/minecraft/bukkit-statistician-players index 4b44d470..4f8c6d0b 100644 --- a/plugins/minecraft/jsonapi/mcsqls2players +++ b/plugins/minecraft/bukkit-statistician-players @@ -12,6 +12,7 @@ * http://s.frd.mn/XJsryR * * Author: Jonas Friedmann (http://frd.mn) + * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins * */ @@ -32,7 +33,7 @@ $port = 3306; if ((count($argv) > 1) && ($argv[1] == 'config')) { print("graph_title Bukkit / Statistician - new players per day -graph_category bukkit_sql +graph_category bukkit graph_vlabel new players per day graph_args --base 1000 -l 0 players.type GAUGE @@ -62,4 +63,4 @@ if ($result = mysqli_query($connection, "SELECT player_name FROM players WHERE f // Close connection mysqli_close($connection); -?> \ No newline at end of file +?> diff --git a/plugins/minecraft/jsonapi/mcsqlubshame b/plugins/minecraft/bukkit-ultrabans-shame similarity index 97% rename from plugins/minecraft/jsonapi/mcsqlubshame rename to plugins/minecraft/bukkit-ultrabans-shame index 302203c8..17257b19 100644 --- a/plugins/minecraft/jsonapi/mcsqlubshame +++ b/plugins/minecraft/bukkit-ultrabans-shame @@ -13,6 +13,7 @@ * http://s.frd.mn/XJsryR * * Author: Jonas Friedmann (http://frd.mn) + * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins * */ @@ -33,7 +34,7 @@ $port = 3306; if ((count($argv) > 1) && ($argv[1] == 'config')) { print("graph_title Bukkit / Ultrabans - shame per day -graph_category bukkit_sql +graph_category bukkit graph_vlabel amount of shame per day graph_args --base 1000 -l 0 unban.type GAUGE @@ -137,4 +138,4 @@ print('mute.value ' . $mutes . "\n"); // Close connection mysqli_close($connection); -?> \ No newline at end of file +?> diff --git a/plugins/minecraft/jsonapi/README.md b/plugins/minecraft/jsonapi/README.md deleted file mode 100644 index 3385293b..00000000 --- a/plugins/minecraft/jsonapi/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# munin-bukkit-plugins - -This repository contains some useful [Munin](http://munin-monitoring.org/) plugins to monitor and observe a [Bukkit](http://bukkit.org) server: - -* **mcjsonplayers** - players currently online -* **mcjsonramusage** - RAM usage -* **mcjsontps** - TPS (ticks per second) -* **mcsqls2killshostile** - hostile mob kills -* **mcsqls2killsneutral** - neutral mob kills -* **mcsqls2killspassive** - passive mob kills -* **mcsqls2players** - new players per day -* **mcsqlubshame** - kicks/bans/mutes/etc. per day - -mcjson* requires [JSONAPI](https://github.com/alecgorge/jsonapi/) -mcsqls2* requires [Statistician](http://dev.bukkit.org/server-mods/statisticianv2/) -mcsqlub* requires [Ultrabans](http://dev.bukkit.org/server-mods/ultrabans/) - -Read more in my [blog post](http://blog.frd.mn/munin-bukkit-plugins/). - -## Requirements - -* Web server with `PHP` support and Munin (2) -* Bukkit server with JSONAPI for the JSONAPI plugins (`mcjson*`) -* Bukkit server with Ultrabans for the Ultrabans plugins (`mcsqlub*`) -* Bukkit server with Statistician for the MySQL plugins (`mcsqls2*`) -* MySQL server for the SQL plugins - -## Configuration - -1. Clone this repository: `git clone git@github.com:frdmn/munin-bukkit-plugins.git` -1. Adjust the JSONAPI variables in the mcjson* files -1. Adjust the MySQL variables in the mcsql* files -1. Make sure the `PHP` binary in the Shebang line is executable - -## Installation - -1. Perform your configuration (see above) -1. Move the plugins into the Munin plugin directory: `mv mc* /usr/share/munin/plugins/` -1. Change the ownership: `chown munin:munin /usr/share/munin/plugins/mc*` -1. Make sure they are exectuable: `chmod 755 /usr/share/munin/plugins/mc*` -1. Enable the plugins: `ln -s /usr/share/munin/plugins/mc* /etc/munin/plugins/` -1. Restart your munin-node: `service munin-node restart` -1. Run your cron: `su - munin --shell=/bin/sh -c /usr/bin/munin-cron` - -## Alerts and limits? - -To setup alerts and limits add the following lines in your specific node in the `munin.conf` file: - - [kotor.yeahwh.at] - address 5.9.115.5 - [...] - mctps_main.warning 19.9: # Warning alert on < 19.9 - mctps_main.critical 19: # Critical alert on < 19.0 - mcplayer_main.warning 20 # Warning alert when there are 20 players online - mcplayer_main.critical 30 # Critical alert when there are more than 30 players online \ No newline at end of file diff --git a/plugins/minecraft/minecraft-jsonapi-players b/plugins/minecraft/minecraft-jsonapi-players deleted file mode 100644 index 39276e44..00000000 --- a/plugins/minecraft/minecraft-jsonapi-players +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/php - 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 -require($apisdk); - -// 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"); -} -?> \ No newline at end of file diff --git a/plugins/minecraft/minecraft-jsonapi-ramusage b/plugins/minecraft/minecraft-jsonapi-ramusage deleted file mode 100644 index 49644aec..00000000 --- a/plugins/minecraft/minecraft-jsonapi-ramusage +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/php - 1) && ($argv[1] == 'config')) -{ - print("graph_title Bukkit / JSONAPI - RAM usage -graph_category bukkit_jsonapi -graph_vlabel RAM usage in GB -graph_args --base 1024 -l 0 -total.label total -total.type GAUGE -used.label used -used.type GAUGE -"); - exit(); -} - -// Include JSONAPI.php -require($apisdk); - -// Prepare API call -$api = new JSONAPI($hostname, $port, $username, $password, $salt); -$result = $api->callMultiple(array( - "system.getJavaMemoryUsage", - "system.getJavaMemoryTotal" - ), array( - array(), - array(), -)); - -// Check for success -if ($result['result'] == 'success'){ - // Print values - print('used.value ' . round($result['success'][0]['success']/1000,2) . "\n"); - print('total.value ' . round($result['success'][1]['success']/1000,2) . "\n"); -} -?> \ No newline at end of file diff --git a/plugins/minecraft/minecraft-jsonapi-tps b/plugins/minecraft/minecraft-jsonapi-tps deleted file mode 100644 index 09a040f4..00000000 --- a/plugins/minecraft/minecraft-jsonapi-tps +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/php - 1) && ($argv[1] == 'config')) -{ - print("graph_title Bukkit / JSONAPI - ticks per second (TPS) -graph_category bukkit_jsonapi -graph_vlabel ticks per second -graph_args --base 1000 -l 0 -tps.type GAUGE -tps.label TPS -"); - exit(); -} - -// Include JSONAPI.php -require($apisdk); - -// Prepare API call -$api = new JSONAPI($hostname, $port, $username, $password, $salt); -$result = $api->call("system.getServerClockDebug"); - -// Check for success -if ($result['result'] == 'success'){ - // Print values - print('tps.value ' . round($result['success']['clockRate'], 2) . "\n"); -} -?> \ No newline at end of file diff --git a/plugins/minecraft/minecraft-sql-statistician-hostile-kills b/plugins/minecraft/minecraft-sql-statistician-hostile-kills deleted file mode 100644 index 151e770d..00000000 --- a/plugins/minecraft/minecraft-sql-statistician-hostile-kills +++ /dev/null @@ -1,161 +0,0 @@ -#!/usr/bin/php - 1) && ($argv[1] == 'config')) -{ - print("graph_title Bukkit / Statistician - hostile mob kills per day -graph_category bukkit_sql_kills -graph_vlabel hostile mob kills per day -graph_args --base 1000 -l 0 -blaze.type GAUGE -blaze.label killed blazes -spider.type GAUGE -spider.label killed spiders -creeper.type GAUGE -creeper.label killed creepers -ghast.type GAUGE -ghast.label killed ghasts -magmacube.type GAUGE -magmacube.label killed magma cubes -silverfish.type GAUGE -silverfish.label killed silverfish -skeleton.type GAUGE -skeleton.label killed skeletons -slime.type GAUGE -slime.label killed slimes -witch.type GAUGE -witch.label killed witches -zombie.type GAUGE -zombie.label killed zombies -irongolem.type GAUGE -irongolem.label killed iron golems -enderdragon.type GAUGE -enderdragon.label killed ender dragons -wither.type GAUGE -wither.label killed withers -"); - exit(); -} - -## Construct 'minumum' timstamp -$current = mktime(); -$today = mktime(0, 0, 0, date("n", $current), date("j", $current), date("Y", $current)); - -## Initiate connection -$connection = mysqli_connect($hostname, $username, $password, $database, $port); - -## Check connection -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -## Select queries for blaze kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Blaze'")) { - ## Print values - print('blaze.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for spider kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = '%Spider'")) { - ## Print values - print('spider.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for creeper kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = '%reeper%'")) { - ## Print values - print('creeper.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for ghast kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Ghast'")) { - ## Print values - print('ghast.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for magma cube kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'MagmaCube'")) { - ## Print values - print('magmacube.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for silverfish and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Silverfish'")) { - ## Print values - print('silverfish.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for skeleton kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Skeleton'")) { - ## Print values - print('skeleton.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for slime kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Slime'")) { - ## Print values - print('slime.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for witch kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Witch'")) { - ## Print values - print('witch.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for zombie kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Zombie'")) { - ## Print values - print('zombie.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for iron golem kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = '%ron%'")) { - ## Print values - print('irongolem.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for ender dragon kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'EnderDragon'")) { - ## Print values - print('enderdragon.value ' . mysqli_num_rows($result) . "\n"); -} - -## Select queries for wither kills and return the amount of rows -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Wither'")) { - ## Print values - print('wither.value ' . mysqli_num_rows($result) . "\n"); -} - -## Close connection -mysqli_close($connection); -?> \ No newline at end of file diff --git a/plugins/minecraft/minecraft-sql-statistician-neutral-kills b/plugins/minecraft/minecraft-sql-statistician-neutral-kills deleted file mode 100644 index 74fe17ff..00000000 --- a/plugins/minecraft/minecraft-sql-statistician-neutral-kills +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/php - 1) && ($argv[1] == 'config')) -{ - print("graph_title Bukkit / Statistician - neutral mob kills per day -graph_category bukkit_sql_kills -graph_vlabel neutral mob kills per day -graph_args --base 1000 -l 0 -enderman.type GAUGE -enderman.label killed endermen -wolf.type GAUGE -wolf.label killed wolf -zombiepigman.type GAUGE -zombiepigman.label killed zombie pigmen -snowman.type GAUGE -snowman.label killed snowmen -"); - exit(); -} - -// Construct 'minumum' timstamp -$current = mktime(); -$today = mktime(0, 0, 0, date("n", $current), date("j", $current), date("Y", $current)); - -// Initiate connection -$connection = mysqli_connect($hostname, $username, $password, $database, $port); - -// 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 -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Enderman'")) { - // Print values - print('enderman.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('wolf.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('zombiepigman.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('snowman.value ' . mysqli_num_rows($result) . "\n"); -} - -// Close connection -mysqli_close($connection); -?> \ No newline at end of file diff --git a/plugins/minecraft/minecraft-sql-statistician-newplayers b/plugins/minecraft/minecraft-sql-statistician-newplayers deleted file mode 100644 index 2cdf1e10..00000000 --- a/plugins/minecraft/minecraft-sql-statistician-newplayers +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/php - 1) && ($argv[1] == 'config')) -{ - print("graph_title Bukkit / Statistician - new players per day -graph_category bukkit_sql -graph_vlabel new players per day -graph_args --base 1000 -l 0 -players.type GAUGE -players.label new players -"); - exit(); -} - -// Construct 'minumum' timstamp -$current = mktime(); -$today = mktime(0, 0, 0, date("n", $current), date("j", $current), date("Y", $current)); - -// Initiate connection -$connection = mysqli_connect($hostname, $username, $password, $database, $port); - -// Check connection -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -// Select queries return the amount of rows -if ($result = mysqli_query($connection, "SELECT player_name FROM players WHERE firstever_login > $today")) { - // Print values - print('players.value ' . mysqli_num_rows($result) . "\n"); -} - -// Close connection -mysqli_close($connection); -?> \ No newline at end of file diff --git a/plugins/minecraft/minecraft-sql-statistician-passive-kills b/plugins/minecraft/minecraft-sql-statistician-passive-kills deleted file mode 100644 index 9d287316..00000000 --- a/plugins/minecraft/minecraft-sql-statistician-passive-kills +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/php - 1) && ($argv[1] == 'config')) -{ - print("graph_title Bukkit / Statistician - passive mob kills per day -graph_category bukkit_sql_kills -graph_vlabel passive mob kills per day -graph_args --base 1000 -l 0 -bat.type GAUGE -bat.label killed bats -chicken.type GAUGE -chicken.label killed chickens -cow.type GAUGE -cow.label killed cows -mooshroom.type GAUGE -mooshroom.label killed mooshrooms -ocelot.type GAUGE -ocelot.label killed magma ocelots -pig.type GAUGE -pig.label killed pigs -sheep.type GAUGE -sheep.label killed sheeps -squid.type GAUGE -squid.label killed squids -villager.type GAUGE -villager.label killed villager -"); - exit(); -} - -// Construct 'minumum' timstamp -$current = mktime(); -$today = mktime(0, 0, 0, date("n", $current), date("j", $current), date("Y", $current)); - -// Initiate connection -$connection = mysqli_connect($hostname, $username, $password, $database, $port); - -// 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 -if ($result = mysqli_query($connection, "SELECT id FROM killchart WHERE time > $today AND killed_creature_type = 'Bat'")) { - // Print values - print('bat.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('chicken.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('mooshroom.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('cow.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('ocelot.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('pig.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('sheep.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('squid.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('villager.value ' . mysqli_num_rows($result) . "\n"); -} - -// Close connection -mysqli_close($connection); -?> \ No newline at end of file diff --git a/plugins/minecraft/minecraft-sql-ultrabans-shame b/plugins/minecraft/minecraft-sql-ultrabans-shame deleted file mode 100644 index 4e184d21..00000000 --- a/plugins/minecraft/minecraft-sql-ultrabans-shame +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/php - 1) && ($argv[1] == 'config')) -{ - print("graph_title Bukkit / Ultrabans - shame per day -graph_category bukkit_sql -graph_vlabel amount of shame per day -graph_args --base 1000 -l 0 -unban.type GAUGE -unban.label unbans -kick.type GAUGE -kick.label kicks -warning.type GAUGE -warning.label warnings -ban.type GAUGE -ban.label bans -ipban.type GAUGE -ipban.label ipbans -fine.type GAUGE -fine.label fines -jail.type GAUGE -jail.label jails -permban.type GAUGE -permban.label permbans -mute.type GAUGE -mute.label mutes -"); - exit(); -} - -// Construct 'minumum' timstamp -$current = mktime(); -$today = mktime(0, 0, 0, date("n", $current), date("j", $current), date("Y", $current)); - -// Initiate connection -$connection = mysqli_connect($hostname, $username, $password, $database, $port); - -// Check connection -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -// 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('unban.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('kick.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('warning.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('ban.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('ipban.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('fine.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('jail.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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('permban.value ' . mysqli_num_rows($result) . "\n"); -} - -// 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 - $tmp1 = mysqli_num_rows($result); -} - -// 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 - $tmp2 = mysqli_num_rows($result); -} - -$mutes = $tmp1 + $tmp2; - -print('mute.value ' . $mutes . "\n"); - -// Close connection -mysqli_close($connection); -?> \ No newline at end of file