mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Added plugin for ARIS
This plugin allows munin users to monitor server instances of the ARIS locative game engine. See http://arisgames.org
This commit is contained in:
parent
b6df4bcea7
commit
a08c0c8824
1 changed files with 38 additions and 0 deletions
38
plugins/aris/aris_players
Executable file
38
plugins/aris/aris_players
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/php
|
||||
# Author David Gagnon <djgagnon@wisc.edu>
|
||||
# Plugin to monitor ARIS users
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
#
|
||||
#
|
||||
#%# family=manual
|
||||
|
||||
|
||||
<?php
|
||||
$aris_db_host='localhost';
|
||||
$aris_db_name='db';
|
||||
$aris_db_user='user';
|
||||
$aris_db_pass='password';
|
||||
|
||||
if ($argv[1]=='config'){
|
||||
print "graph_title ARIS active players\n";
|
||||
print "graph_vlabel Players Count\n";
|
||||
print "graph_category ARIS\n";
|
||||
print "players.label player count\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
$sqlLink = mysql_connect($aris_db_host,$aris_db_user,$aris_db_pass) or die('MySQL authenticaiton error');
|
||||
mysql_select_db($aris_db_name) or die('MySQL Wrong Scheme Error');
|
||||
|
||||
$query = 'SELECT COUNT(DISTINCT player_id) AS count FROM player_log WHERE timestamp BETWEEN DATE_SUB(NOW(), INTERVAL 5 MINUTE) AND NOW()';
|
||||
$result = mysql_query($query);
|
||||
$numCurrentPlayersObject = mysql_fetch_object($result);
|
||||
$numCurrentPlayers = $numCurrentPlayersObject->count;
|
||||
|
||||
echo 'players.value '. $numCurrentPlayers;
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue