Server Stats

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(New page: Image:statsmem.png)
 
(added serverstats install instructions)
Line 1: Line 1:
[[Image:statsmem.png]]
+
[[Image:statsmem.png|400px|thumb|right|Region Service memory consumption]]
 +
[[Image:statsthreads.png|400px|thumb|right|Monitoring of OpenSim threads...]]
 +
[[Image:statscpu.png|400px|thumb|right|Check out the CPU-load]]
 +
 
 +
==Installation steps==
 +
 
 +
* Get Serverstats from [http://download.berlios.de/serverstats/serverstats-0.8.2.tar.bz2 Berlios]
 +
* Install rddtool (depending on your distro, it should be in the repository. Otherwise download [http://oss.oetiker.ch/rrdtool/ here])
 +
* Get the OpenSim serverstats module:
 +
<source lang="bash">
 +
svn checkout http://forge.opensimulator.org/svn/serverstats
 +
</source>
 +
* Copy serverstats to /my/apache/root/serverstats
 +
* Move ./serverstats/config.sample/ to ./serverstats/config/
 +
* Copy the opensim.php module to ./serverstats/config
 +
* Edit ./serverstats/config/sources.php, and add this code:
 +
<source lang="php">
 +
include "opensim.php";
 +
$config['opensim']['module'] = new opensim();
 +
</source>
 +
* Edit ./serverstats/config/graph.php, and add this code:
 +
<source lang="php">
 +
$config['list'][] = array(
 +
        'title' => 'OpenSim CPU',
 +
        'lowerLimit' => 0,
 +
        'altAutoscaleMax' => true,
 +
        'content' => array(
 +
                array(
 +
                        'type' => 'AREA',
 +
                        'source' => 'opensim',
 +
                        'ds' => 'opensim_cpu_sys',
 +
                        'cf' => 'AVERAGE',
 +
                        'legend' => 'OpenSim Sys CPU%',
 +
                        'color' => 'FF0000',
 +
                ),
 +
                array(
 +
                        'type' => 'AREA',
 +
                        'source' => 'opensim',
 +
                        'ds' => 'opensim_cpu_user',
 +
                        'cf' => 'AVERAGE',
 +
                        'legend' => 'OpenSim User CPU%',
 +
                        'color' => '00FF00',
 +
                        'stacked' => true,
 +
                ),
 +
        )
 +
);
 +
 
 +
$config['list'][] = array(
 +
'title' => 'OpenSim Threads',
 +
'lowerLimit' => 0,
 +
'altAutoscaleMax' => true,
 +
'content' => array(
 +
array(
 +
        'type' => 'AREA',
 +
                        'source' => 'opensim',
 +
                        'ds' => 'opensim_threads',
 +
                        'cf' => 'AVERAGE',
 +
                        'legend' => 'number of opensim threads',
 +
                        'color' => '0000BB',
 +
),
 +
        )
 +
);
 +
 
 +
$config['list'][] = array(
 +
'title' => 'OpenSim Memory',
 +
        'lowerLimit' => 0,
 +
        'altAutoscaleMax' => true,
 +
'content' => array(
 +
array(
 +
'type' => 'AREA',
 +
                        'source' => 'opensim',
 +
                        'ds' => 'opensim_virt',
 +
                        'cf' => 'AVERAGE',
 +
                        'legend' => 'OpenSim Memory (Virt)',
 +
                        'color' => '00BB00'
 +
                ),
 +
array(
 +
                        'type' => 'AREA',
 +
                        'source' => 'opensim',
 +
                        'ds' => 'opensim_real',
 +
                        'cf' => 'AVERAGE',
 +
                        'legend' => 'OpenSim Memory (Real)',
 +
                        'color' => 'BB0000'
 +
                ),
 +
        )
 +
);
 +
</source>
 +
* Make sure you allow php to access /proc . Edit php.ini and set open_basedir = ..:/proc
 +
* Add a crontab with 'crontab -e', and enter a cronjob for update.php:
 +
<source lang="php">
 +
* * * * * php /my/apache/root/serverstats/update.php
 +
</source>
 +
* Check out if the script executes the way it's supposed to be, by running it from the shell.
 +
<source lang="bash">
 +
php update.php
 +
</source>
 +
 
 +
Done! Now check out if the graphs are generated, by pointing your browser to the serverstats directory. You'll see some nice stats if everything went right.

Revision as of 20:20, 22 October 2008

Region Service memory consumption
Monitoring of OpenSim threads...
Check out the CPU-load

Installation steps

  • Get Serverstats from Berlios
  • Install rddtool (depending on your distro, it should be in the repository. Otherwise download here)
  • Get the OpenSim serverstats module:
svn checkout http://forge.opensimulator.org/svn/serverstats
  • Copy serverstats to /my/apache/root/serverstats
  • Move ./serverstats/config.sample/ to ./serverstats/config/
  • Copy the opensim.php module to ./serverstats/config
  • Edit ./serverstats/config/sources.php, and add this code:
include "opensim.php";
$config['opensim']['module'] = new opensim();
  • Edit ./serverstats/config/graph.php, and add this code:
$config['list'][] = array(
        'title' => 'OpenSim CPU',
        'lowerLimit' => 0,
        'altAutoscaleMax' => true,
        'content' => array(
                array(
                        'type' => 'AREA',
                        'source' => 'opensim',
                        'ds' => 'opensim_cpu_sys',
                        'cf' => 'AVERAGE',
                        'legend' => 'OpenSim Sys CPU%',
                        'color' => 'FF0000',
                ),
                array(
                        'type' => 'AREA',
                        'source' => 'opensim',
                        'ds' => 'opensim_cpu_user',
                        'cf' => 'AVERAGE',
                        'legend' => 'OpenSim User CPU%',
                        'color' => '00FF00',
                        'stacked' => true,
                ),
        )
);
 
$config['list'][] = array(
	'title' => 'OpenSim Threads',
	'lowerLimit' => 0,
	'altAutoscaleMax' => true,
	'content' => array(
		array(
		        'type' => 'AREA',
                        'source' => 'opensim',
                        'ds' => 'opensim_threads',
                        'cf' => 'AVERAGE',
                        'legend' => 'number of opensim threads',
                        'color' => '0000BB',
		),
        )
);
 
$config['list'][] = array(
	'title' => 'OpenSim Memory',
        'lowerLimit' => 0,
        'altAutoscaleMax' => true,
	'content' => array(
		array(
			'type' => 'AREA',
                        'source' => 'opensim',
                        'ds' => 'opensim_virt',
                        'cf' => 'AVERAGE',
                        'legend' => 'OpenSim Memory (Virt)',
                        'color' => '00BB00'
                ),
		array(
                        'type' => 'AREA',
                        'source' => 'opensim',
                        'ds' => 'opensim_real',
                        'cf' => 'AVERAGE',
                        'legend' => 'OpenSim Memory (Real)',
                        'color' => 'BB0000'
                ),
        )
);
  • Make sure you allow php to access /proc . Edit php.ini and set open_basedir = ..:/proc
  • Add a crontab with 'crontab -e', and enter a cronjob for update.php:
* * * * * php /my/apache/root/serverstats/update.php
  • Check out if the script executes the way it's supposed to be, by running it from the shell.
php update.php

Done! Now check out if the graphs are generated, by pointing your browser to the serverstats directory. You'll see some nice stats if everything went right.

Personal tools
General
About This Wiki