1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-24 18:07:20 +00: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 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");
}