Révision 007c2825
Fixed indentation + configurable SDK path
| plugins/minecraft/minecraft-jsonapi-ramusage | ||
|---|---|---|
| 16 | 16 |
|
| 17 | 17 |
/** |
| 18 | 18 |
* JSONAPI configuration |
| 19 |
* (get the SDK php file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php) |
|
| 19 | 20 |
*/ |
| 20 | 21 |
|
| 22 |
$apisdk = '/var/cache/munin/JSONAPI.php'; |
|
| 21 | 23 |
$hostname = 'your-hostname'; |
| 22 | 24 |
$username = 'your-username'; |
| 23 | 25 |
$password = 'your-password'; |
| ... | ... | |
| 30 | 32 |
|
| 31 | 33 |
if ((count($argv) > 1) && ($argv[1] == 'config')) |
| 32 | 34 |
{
|
| 33 |
print("graph_title Bukkit / JSONAPI - RAM usage
|
|
| 35 |
print("graph_title Bukkit / JSONAPI - RAM usage
|
|
| 34 | 36 |
graph_category bukkit_jsonapi |
| 35 | 37 |
graph_vlabel RAM usage in GB |
| 36 | 38 |
graph_args --base 1024 -l 0 |
| ... | ... | |
| 39 | 41 |
used.label used |
| 40 | 42 |
used.type GAUGE |
| 41 | 43 |
"); |
| 42 |
exit(); |
|
| 44 |
exit();
|
|
| 43 | 45 |
} |
| 44 | 46 |
|
| 45 |
// Include JSONAPI.php SDK (get this file here: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php)
|
|
| 46 |
require('/var/cache/munin/JSONAPI.php');
|
|
| 47 |
// Include JSONAPI.php |
|
| 48 |
require($apisdk);
|
|
| 47 | 49 |
|
| 48 | 50 |
// Prepare API call |
| 49 | 51 |
$api = new JSONAPI($hostname, $port, $username, $password, $salt); |
Formats disponibles : Unified diff