Puppet and Cube
A while back the team at Square released a time series collection and analysis tool called Cube. With the exception of the undergraduate pun name, it’s a really neat tool. It’s built on Node and MongoDB and has a simple to use collector and a sparse but practical evaluator that includes a fairly usable web interface.
I’ve written a Puppet report processor that sends each log event
from a Puppet run to Cube as an event labelled puppet_log
with the
data portion of the event being the Puppet client’s hostname and the
contents of the log event:
data = { host: self.host, output: log }
You can then see the output in the Cube Dashboard:
You can find the code on GitHub and a module on the Forge.
There are some simple installation instructions:
-
Install the
rest-client
andjson
gems on your Puppet master$ sudo gem install rest-client json
-
Install puppet-cube as a module in your Puppet master’s module path.
-
Update the
host
andport
variables in thecube.yaml
file with the hostname and port of your Cube collector and copy the file to/etc/puppet/
. An example file is included. -
Enable pluginsync and reports on your master and clients in
puppet.conf
[master] report = true reports = cube pluginsync = true [agent] report = true pluginsync = true
-
Run the Puppet client and sync the report as a plugin.