Upload CollectD stats to Librato

Status
Not open for further replies.

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
I put a ticket in for adding Librato support to the CollectD process a while back. It's not a high priority ticket and I don't expect to see it filled any time soon, but I still thought it'd be interesting to get the stats that FreeNAS tracks into Librato.

Librato is a metrics tracking service that provides really nice looking graphs and really flexible and detailed methods for manipulating and correlating data. You can pay to get access to more features and longer retention time, but there is a free tier that should cover most hobbyist uses.

Anyway, I put together a script that parses the RRD files that CollectD generates and uploads the stats to Librato. Not too long ago, I also added CPU and drive temperatures as collected from proc and smartctl.

The script, an example configuration, and an rc script are available at BitBucket and GitHub.

You'll also need to install PyRRD (one way is with pip) and rrdtool (available in the ports tree), so that means you're gonna be working in a jail. I suppose it would be possible to get everything running directly by just getting PyRRD installed somewhere; all the other modules and rrdtool are available in the base OS. But, the jail is what I'm using right now; I already have a services jail running, so what's one more task?

Bug reports, pull requests, comments, and criticism are welcome. Hopefully someone else finds this useful.

I've attached a screenshot of my dashboard at Librato.

librato dashboard.png
 
Last edited:

indivision

Guru
Joined
Jan 4, 2013
Messages
806
Nice work. I would like the same end result (temp and other SMART data in graphs). But, I would prefer it to be handled locally rather than sending data out of the network. Any ideas on how to set it up that way within a jail?
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
short answer: not really

The benefit of Librato is that all you need to do is send them the data and configure the charts. In order to have locally hosted graphs you'd need to set up your own installation of some graphing library and build up your own API for accepting the data. Now, I'm sure there are existing tools for this. The graphs in FreeNAS are generated with RRDTool, so one option would be setting up RRDTool in a jail and then serving the images that it creates. You'd also need to log the temp / SMART data to your own CollectD instance. There are probably other methods too that might be simpler.

That said, if you find something that is easy to implement I'd enjoy hearing about it. Librato can't really display anything usable on iOS devices so I can't really check my graphs when I'm out. A self hosted system would be easier to customize.
 

indivision

Guru
Joined
Jan 4, 2013
Messages
806
Will do. I've looked at RRDTool in the past for other projects. But, I'm more of a sql/php/front-end guy. So, I would probably have a lot of thumbs on this task.
 
Status
Not open for further replies.
Top