mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 10:39:53 +00:00
Fixed indentation + configurable SDK path
This commit is contained in:
parent
bed5815230
commit
007c2825a9
8 changed files with 28 additions and 22 deletions
|
@ -16,8 +16,10 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSONAPI configuration
|
* JSONAPI configuration
|
||||||
|
* (get the SDK php file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$apisdk = '/var/cache/munin/JSONAPI.php';
|
||||||
$hostname = 'your-hostname';
|
$hostname = 'your-hostname';
|
||||||
$username = 'your-username';
|
$username = 'your-username';
|
||||||
$password = 'your-password';
|
$password = 'your-password';
|
||||||
|
@ -30,18 +32,18 @@ $port = 20059;
|
||||||
|
|
||||||
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
||||||
{
|
{
|
||||||
print("graph_title Bukkit / JSONAPI - players online
|
print("graph_title Bukkit / JSONAPI - players online
|
||||||
graph_category bukkit_jsonapi
|
graph_category bukkit_jsonapi
|
||||||
graph_vlabel players
|
graph_vlabel players
|
||||||
graph_args --base 1000 -l 0
|
graph_args --base 1000 -l 0
|
||||||
players.type GAUGE
|
players.type GAUGE
|
||||||
players.label players
|
players.label players
|
||||||
");
|
");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include JSONAPI.php SDK (get this file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php)
|
// Include JSONAPI.php
|
||||||
require('/var/cache/munin/JSONAPI.php');
|
require($apisdk);
|
||||||
|
|
||||||
// Prepare API call
|
// Prepare API call
|
||||||
$api = new JSONAPI($hostname, $port, $username, $password, $salt);
|
$api = new JSONAPI($hostname, $port, $username, $password, $salt);
|
||||||
|
|
|
@ -16,8 +16,10 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSONAPI configuration
|
* JSONAPI configuration
|
||||||
|
* (get the SDK php file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$apisdk = '/var/cache/munin/JSONAPI.php';
|
||||||
$hostname = 'your-hostname';
|
$hostname = 'your-hostname';
|
||||||
$username = 'your-username';
|
$username = 'your-username';
|
||||||
$password = 'your-password';
|
$password = 'your-password';
|
||||||
|
@ -30,7 +32,7 @@ $port = 20059;
|
||||||
|
|
||||||
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
||||||
{
|
{
|
||||||
print("graph_title Bukkit / JSONAPI - RAM usage
|
print("graph_title Bukkit / JSONAPI - RAM usage
|
||||||
graph_category bukkit_jsonapi
|
graph_category bukkit_jsonapi
|
||||||
graph_vlabel RAM usage in GB
|
graph_vlabel RAM usage in GB
|
||||||
graph_args --base 1024 -l 0
|
graph_args --base 1024 -l 0
|
||||||
|
@ -39,11 +41,11 @@ total.type GAUGE
|
||||||
used.label used
|
used.label used
|
||||||
used.type GAUGE
|
used.type GAUGE
|
||||||
");
|
");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include JSONAPI.php SDK (get this file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php)
|
// Include JSONAPI.php
|
||||||
require('/var/cache/munin/JSONAPI.php');
|
require($apisdk);
|
||||||
|
|
||||||
// Prepare API call
|
// Prepare API call
|
||||||
$api = new JSONAPI($hostname, $port, $username, $password, $salt);
|
$api = new JSONAPI($hostname, $port, $username, $password, $salt);
|
||||||
|
|
|
@ -16,8 +16,10 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSONAPI configuration
|
* JSONAPI configuration
|
||||||
|
* (get the SDK php file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$apisdk = '/var/cache/munin/JSONAPI.php';
|
||||||
$hostname = 'your-hostname';
|
$hostname = 'your-hostname';
|
||||||
$username = 'your-username';
|
$username = 'your-username';
|
||||||
$password = 'your-password';
|
$password = 'your-password';
|
||||||
|
@ -30,18 +32,18 @@ $port = 20059;
|
||||||
|
|
||||||
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
||||||
{
|
{
|
||||||
print("graph_title Bukkit / JSONAPI - ticks per second (TPS)
|
print("graph_title Bukkit / JSONAPI - ticks per second (TPS)
|
||||||
graph_category bukkit_jsonapi
|
graph_category bukkit_jsonapi
|
||||||
graph_vlabel ticks per second
|
graph_vlabel ticks per second
|
||||||
graph_args --base 1000 -l 0
|
graph_args --base 1000 -l 0
|
||||||
tps.type GAUGE
|
tps.type GAUGE
|
||||||
tps.label TPS
|
tps.label TPS
|
||||||
");
|
");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include JSONAPI.php SDK (get this file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php)
|
// Include JSONAPI.php
|
||||||
require('/var/cache/munin/JSONAPI.php');
|
require($apisdk);
|
||||||
|
|
||||||
// Prepare API call
|
// Prepare API call
|
||||||
$api = new JSONAPI($hostname, $port, $username, $password, $salt);
|
$api = new JSONAPI($hostname, $port, $username, $password, $salt);
|
||||||
|
|
|
@ -31,7 +31,7 @@ $port = 3306;
|
||||||
|
|
||||||
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
||||||
{
|
{
|
||||||
print("graph_title Bukkit / Statistician - hostile mob kills per day
|
print("graph_title Bukkit / Statistician - hostile mob kills per day
|
||||||
graph_category bukkit_sql_kills
|
graph_category bukkit_sql_kills
|
||||||
graph_vlabel hostile mob kills per day
|
graph_vlabel hostile mob kills per day
|
||||||
graph_args --base 1000 -l 0
|
graph_args --base 1000 -l 0
|
||||||
|
@ -62,7 +62,7 @@ enderdragon.label killed ender dragons
|
||||||
wither.type GAUGE
|
wither.type GAUGE
|
||||||
wither.label killed withers
|
wither.label killed withers
|
||||||
");
|
");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
## Construct 'minumum' timstamp
|
## Construct 'minumum' timstamp
|
||||||
|
|
|
@ -31,7 +31,7 @@ $port = 3306;
|
||||||
|
|
||||||
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
||||||
{
|
{
|
||||||
print("graph_title Bukkit / Statistician - neutral mob kills per day
|
print("graph_title Bukkit / Statistician - neutral mob kills per day
|
||||||
graph_category bukkit_sql_kills
|
graph_category bukkit_sql_kills
|
||||||
graph_vlabel neutral mob kills per day
|
graph_vlabel neutral mob kills per day
|
||||||
graph_args --base 1000 -l 0
|
graph_args --base 1000 -l 0
|
||||||
|
@ -44,7 +44,7 @@ zombiepigman.label killed zombie pigmen
|
||||||
snowman.type GAUGE
|
snowman.type GAUGE
|
||||||
snowman.label killed snowmen
|
snowman.label killed snowmen
|
||||||
");
|
");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct 'minumum' timstamp
|
// Construct 'minumum' timstamp
|
||||||
|
|
|
@ -31,14 +31,14 @@ $port = 3306;
|
||||||
|
|
||||||
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
||||||
{
|
{
|
||||||
print("graph_title Bukkit / Statistician - new players per day
|
print("graph_title Bukkit / Statistician - new players per day
|
||||||
graph_category bukkit_sql
|
graph_category bukkit_sql
|
||||||
graph_vlabel new players per day
|
graph_vlabel new players per day
|
||||||
graph_args --base 1000 -l 0
|
graph_args --base 1000 -l 0
|
||||||
players.type GAUGE
|
players.type GAUGE
|
||||||
players.label new players
|
players.label new players
|
||||||
");
|
");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct 'minumum' timstamp
|
// Construct 'minumum' timstamp
|
||||||
|
|
|
@ -31,7 +31,7 @@ $port = 3306;
|
||||||
|
|
||||||
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
||||||
{
|
{
|
||||||
print("graph_title Bukkit / Statistician - passive mob kills per day
|
print("graph_title Bukkit / Statistician - passive mob kills per day
|
||||||
graph_category bukkit_sql_kills
|
graph_category bukkit_sql_kills
|
||||||
graph_vlabel passive mob kills per day
|
graph_vlabel passive mob kills per day
|
||||||
graph_args --base 1000 -l 0
|
graph_args --base 1000 -l 0
|
||||||
|
@ -54,7 +54,7 @@ squid.label killed squids
|
||||||
villager.type GAUGE
|
villager.type GAUGE
|
||||||
villager.label killed villager
|
villager.label killed villager
|
||||||
");
|
");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct 'minumum' timstamp
|
// Construct 'minumum' timstamp
|
||||||
|
|
|
@ -32,7 +32,7 @@ $port = 3306;
|
||||||
|
|
||||||
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
if ((count($argv) > 1) && ($argv[1] == 'config'))
|
||||||
{
|
{
|
||||||
print("graph_title Bukkit / Ultrabans - shame per day
|
print("graph_title Bukkit / Ultrabans - shame per day
|
||||||
graph_category bukkit_sql
|
graph_category bukkit_sql
|
||||||
graph_vlabel amount of shame per day
|
graph_vlabel amount of shame per day
|
||||||
graph_args --base 1000 -l 0
|
graph_args --base 1000 -l 0
|
||||||
|
@ -55,7 +55,7 @@ permban.label permbans
|
||||||
mute.type GAUGE
|
mute.type GAUGE
|
||||||
mute.label mutes
|
mute.label mutes
|
||||||
");
|
");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct 'minumum' timstamp
|
// Construct 'minumum' timstamp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue