Metrics to graphite

I've developed bit of code to sent metrics about disk usage per database, mailuser and website to a central graphite server. These are already gathered in the cron jobs, but we store no history.

From that I'm using Grafana to chart the usage history of accounts.

I'll add example dashboards in the MR. These have a filter where you can select the username and server.

image

To install: Add to the server/lib/config.inc.local.php file: $conf['graphite_collector_command'] = 'ssh collector@graphite.local dummy_netcat';

On the graphite server create a user collector, with in the .ssh/authorized_keys: command="nc -q0 127.0.0.1 2003" ssh-rsa ... with the ssh public key of the root user on the webserver. The dummy_netcat is replaced by the actual nc command, assuring that no other commands can be executed via this key.

For a local graphote server you could set the $conf['graphite_collector_command']value to nc -q0 127.0.0.1 2003