Server Stats
From OpenSimulator
(Difference between revisions)
(added serverstats install instructions) |
m (Robot: Replacing 'OpenSim' to 'OpenSimulator', which is the precise name) |
||
(10 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
+ | __NOTOC__ | ||
+ | {{Quicklinks}} | ||
+ | <br /> | ||
+ | |||
[[Image:statsmem.png|400px|thumb|right|Region Service memory consumption]] | [[Image:statsmem.png|400px|thumb|right|Region Service memory consumption]] | ||
− | [[Image:statsthreads.png|400px|thumb|right|Monitoring of | + | [[Image:statsthreads.png|400px|thumb|right|Monitoring of OpenSimulator threads...]] |
[[Image:statscpu.png|400px|thumb|right|Check out the CPU-load]] | [[Image:statscpu.png|400px|thumb|right|Check out the CPU-load]] | ||
− | ==Installation steps== | + | == Installation steps == |
* Get Serverstats from [http://download.berlios.de/serverstats/serverstats-0.8.2.tar.bz2 Berlios] | * Get Serverstats from [http://download.berlios.de/serverstats/serverstats-0.8.2.tar.bz2 Berlios] | ||
− | * Install | + | * Install rrdtool (depending on your distro, it should be in the repository. Otherwise download [http://oss.oetiker.ch/rrdtool/ here]) |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
* Copy serverstats to /my/apache/root/serverstats | * Copy serverstats to /my/apache/root/serverstats | ||
* Move ./serverstats/config.sample/ to ./serverstats/config/ | * Move ./serverstats/config.sample/ to ./serverstats/config/ | ||
− | * | + | * Get the OpenSimulator serverstats module, and place in the config directory: |
+ | <source lang="bash"> | ||
+ | cd ./serverstats/config | ||
+ | svn checkout http://forge.opensimulator.org/svn/serverstats/trunk . | ||
+ | </source> | ||
+ | |||
* Edit ./serverstats/config/sources.php, and add this code: | * Edit ./serverstats/config/sources.php, and add this code: | ||
<source lang="php"> | <source lang="php"> | ||
Line 22: | Line 27: | ||
<source lang="php"> | <source lang="php"> | ||
$config['list'][] = array( | $config['list'][] = array( | ||
− | 'title' => ' | + | 'title' => 'OpenSimulator CPU', |
'lowerLimit' => 0, | 'lowerLimit' => 0, | ||
'altAutoscaleMax' => true, | 'altAutoscaleMax' => true, | ||
Line 31: | Line 36: | ||
'ds' => 'opensim_cpu_sys', | 'ds' => 'opensim_cpu_sys', | ||
'cf' => 'AVERAGE', | 'cf' => 'AVERAGE', | ||
− | 'legend' => ' | + | 'legend' => 'OpenSimulator Sys CPU%', |
'color' => 'FF0000', | 'color' => 'FF0000', | ||
), | ), | ||
Line 39: | Line 44: | ||
'ds' => 'opensim_cpu_user', | 'ds' => 'opensim_cpu_user', | ||
'cf' => 'AVERAGE', | 'cf' => 'AVERAGE', | ||
− | 'legend' => ' | + | 'legend' => 'OpenSimulator User CPU%', |
'color' => '00FF00', | 'color' => '00FF00', | ||
'stacked' => true, | 'stacked' => true, | ||
Line 47: | Line 52: | ||
$config['list'][] = array( | $config['list'][] = array( | ||
− | 'title' => ' | + | 'title' => 'OpenSimulator Threads', |
'lowerLimit' => 0, | 'lowerLimit' => 0, | ||
'altAutoscaleMax' => true, | 'altAutoscaleMax' => true, | ||
'content' => array( | 'content' => array( | ||
array( | array( | ||
− | + | 'type' => 'AREA', | |
'source' => 'opensim', | 'source' => 'opensim', | ||
'ds' => 'opensim_threads', | 'ds' => 'opensim_threads', | ||
Line 63: | Line 68: | ||
$config['list'][] = array( | $config['list'][] = array( | ||
− | 'title' => ' | + | 'title' => 'OpenSimulator Memory', |
'lowerLimit' => 0, | 'lowerLimit' => 0, | ||
'altAutoscaleMax' => true, | 'altAutoscaleMax' => true, | ||
Line 72: | Line 77: | ||
'ds' => 'opensim_virt', | 'ds' => 'opensim_virt', | ||
'cf' => 'AVERAGE', | 'cf' => 'AVERAGE', | ||
− | 'legend' => ' | + | 'legend' => 'OpenSimulator Memory (Virt)', |
'color' => '00BB00' | 'color' => '00BB00' | ||
), | ), | ||
Line 80: | Line 85: | ||
'ds' => 'opensim_real', | 'ds' => 'opensim_real', | ||
'cf' => 'AVERAGE', | 'cf' => 'AVERAGE', | ||
− | 'legend' => ' | + | 'legend' => 'OpenSimulator Memory (Real)', |
'color' => 'BB0000' | 'color' => 'BB0000' | ||
), | ), | ||
Line 86: | Line 91: | ||
); | ); | ||
</source> | </source> | ||
+ | now find the following bit of code at the bottom: | ||
+ | <source lang="php"> | ||
+ | // Define what Graphes we want in the detail view (detail.php) | ||
+ | $config['types'] = array( | ||
+ | // array('title' => 'Hour', 'period' => 3600), // only useful if you have a small step | ||
+ | array('title' => 'Day', 'period' => 86400), | ||
+ | array('title' => 'Week', 'period' => 604800), | ||
+ | array('title' => 'Month', 'period' => 2678400), | ||
+ | array('title' => 'Year', 'period' => 31536000) | ||
+ | ); | ||
+ | // The period uses in the graph overview (index.php) | ||
+ | $config['defaultperiod'] = 86400; | ||
+ | </source> | ||
+ | and change it to: | ||
+ | <source lang="php"> | ||
+ | // Define what Graphes we want in the detail view (detail.php) | ||
+ | $config['types'] = array( | ||
+ | array('title' => 'Hour', 'period' => 10800), // only useful if you have a small step | ||
+ | array('title' => 'Day', 'period' => 86400), | ||
+ | array('title' => 'Week', 'period' => 604800), | ||
+ | array('title' => 'Month', 'period' => 2678400), | ||
+ | array('title' => 'Year', 'period' => 31536000) | ||
+ | ); | ||
+ | // The period uses in the graph overview (index.php) | ||
+ | $config['defaultperiod'] = 10800; | ||
+ | </source> | ||
+ | |||
+ | * Edit ./serverstats/config/main.php, and change this code: | ||
+ | from: | ||
+ | <source lang="php"> | ||
+ | 'step' => 300 | ||
+ | </source> | ||
+ | to: | ||
+ | <source lang="php"> | ||
+ | 'step' => 60 | ||
+ | </source> | ||
+ | |||
* Make sure you allow php to access /proc . Edit php.ini and set open_basedir = ..:/proc | * 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: | * Add a crontab with 'crontab -e', and enter a cronjob for update.php: |
Latest revision as of 22:58, 3 March 2012
[edit] Installation steps
- Get Serverstats from Berlios
- Install rrdtool (depending on your distro, it should be in the repository. Otherwise download here)
- Copy serverstats to /my/apache/root/serverstats
- Move ./serverstats/config.sample/ to ./serverstats/config/
- Get the OpenSimulator serverstats module, and place in the config directory:
cd ./serverstats/config
svn checkout http://forge.opensimulator.org/svn/serverstats/trunk .
- 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' => 'OpenSimulator CPU', 'lowerLimit' => 0, 'altAutoscaleMax' => true, 'content' => array( array( 'type' => 'AREA', 'source' => 'opensim', 'ds' => 'opensim_cpu_sys', 'cf' => 'AVERAGE', 'legend' => 'OpenSimulator Sys CPU%', 'color' => 'FF0000', ), array( 'type' => 'AREA', 'source' => 'opensim', 'ds' => 'opensim_cpu_user', 'cf' => 'AVERAGE', 'legend' => 'OpenSimulator User CPU%', 'color' => '00FF00', 'stacked' => true, ), ) ); $config['list'][] = array( 'title' => 'OpenSimulator 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' => 'OpenSimulator Memory', 'lowerLimit' => 0, 'altAutoscaleMax' => true, 'content' => array( array( 'type' => 'AREA', 'source' => 'opensim', 'ds' => 'opensim_virt', 'cf' => 'AVERAGE', 'legend' => 'OpenSimulator Memory (Virt)', 'color' => '00BB00' ), array( 'type' => 'AREA', 'source' => 'opensim', 'ds' => 'opensim_real', 'cf' => 'AVERAGE', 'legend' => 'OpenSimulator Memory (Real)', 'color' => 'BB0000' ), ) );
now find the following bit of code at the bottom:
// Define what Graphes we want in the detail view (detail.php) $config['types'] = array( // array('title' => 'Hour', 'period' => 3600), // only useful if you have a small step array('title' => 'Day', 'period' => 86400), array('title' => 'Week', 'period' => 604800), array('title' => 'Month', 'period' => 2678400), array('title' => 'Year', 'period' => 31536000) ); // The period uses in the graph overview (index.php) $config['defaultperiod'] = 86400;
and change it to:
// Define what Graphes we want in the detail view (detail.php) $config['types'] = array( array('title' => 'Hour', 'period' => 10800), // only useful if you have a small step array('title' => 'Day', 'period' => 86400), array('title' => 'Week', 'period' => 604800), array('title' => 'Month', 'period' => 2678400), array('title' => 'Year', 'period' => 31536000) ); // The period uses in the graph overview (index.php) $config['defaultperiod'] = 10800;
- Edit ./serverstats/config/main.php, and change this code:
from:
'step' => 300
to:
'step' => 60
- 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.