Collectd

What is collectd ?
Collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files. Website

Collectd is a low level system writen in C that is very low consumption. You can use it to read local or distant data or to send data to a central system.

As we are using monitorstats, we do not necessary need to install collectd on the server side and we can use it to track distant simulators.

Collectd can track a lot of formats like database records, parse xml values or json values...

Collectd config for OpenSimulator
As stated here : Monitoring Module, we can get region statistics using the url : http://sim:port/monitorstats/UUID of the region or region name. We can use the collectd curl_xml plugin to get xml values and store them in a rrd file. To do this, we need to enable the curl_xml plugin and define some dataset types.

Add data types

 * Create a file /etc/collectd/my_types.db
 * Edit the file and add inside (i have put only generic limits but feel free to edit this page and adjust the ranges) :


 * Edit the file /etc/collectd/collectd.conf :

Uncomment this line

Add plugin options

 * Edit the file /etc/collectd/collectd.conf :

Add these lines


 * Save the file and restart collectd

Local config folder
You can create a folder at /etc/collectd/conf.d and then add a line :

at the end of the /etc/collectd/collectd.conf file.

With this option, you can move all the opensimulator config inside a file like /etc/collectd/conf.d/opensimulator.conf

Interval
The default sampling interval is 10 seconds but you can change the value at the begining of the /etc/collectd/collectd.conf file.

Syslog
By default, the collectd daemon is writing its logs in the syslog file but you can set a custom log file like this :

Small bug correction
Depending on the collectd version installed, you can have some update time errors set in the log output. To correct this, you can create a file /etc/collectd/conf.d/df_debug.conf and add this inside :

How to read the values
All the values are stored in a folder at /usr/lib/collectd/rrd in "rrd" files. You can use any rrd compatible reader. You can also set a web server to read the values in real time (there are some ruby or java or perl or php systems for that). You can also zip all the rrd folder content and take it home then read it with an rrd reader like "kcollectd".

Example output :
This output is not beautifull because it was made using an old OpenSimulator version on an empty test machine but you can see some values anyway.