Using munin to trend puppetmaster

We wanted to trend our puppetmaster to give us an idea of the amount of nodes and the time it takes to compile a catalog. Searching on the web didn’t yield the results we needed, so we made our own.

We use munin to trend our machines, and our puppetmaster is no different. We could not get a clear picture of the number of nodes that connect over a amount of time, however. There is a munin plugin to monitor the memory usage of the puppetmaster, but as we have a dedicated machine as our puppetmaster we have less need for it. After some looking around we found a plugin on munin-exchange. This plugin had some bugs and oddities (finding them I leave as an excercise to the reader) but nonetheless, it served as a starting point for our own plugin.

The plugin is called puppet_ and is a wildcard plugin. It can be called in two ways: as puppet_nodes and as puppet_totals.

puppet_nodes outputs information about the total number of nodes that have connected over the last 5 and 30 minutes, along with the average compilation time of the catalogs. This gives us the possibility to see the relationship between adding more nodes and adding more config over time.

Graph created by puppet_nodes

Graph created by puppet_nodes

Calling the plugin as puppet_totals gives the total amount of known nodes and the amount of unique nodes that have connected over the last 24 hours, ideally these should be equal.

Graph created by puppet_totals

Graph created by puppet_totals

In the config for this plugin you can set two enviroment variables:
num_minutes – This is a comma separated list with the number of minutes that puppet_nodes uses(e.g. setting env.num_minutes=”10,30,50″ will output the compilation times for the last 10, 30 and 50 minutes).
puppet_logs – This is a string that contains the path to the log, by default it uses /var/log/syslog.

The plugin was written en rewritten over the course of several days and evenings, and has been added to our puppetmaster installation about a week ago. We have yet to come across show-stopping bugs, so we release the plugin today. Our intention is to create more plugins for munin to trend puppetmaster when we have need for more. One idea is tracking the amount of tags or exported resources.

There is a caveat, the plugin assumes that the log is not rotated more than once per day. We’ll fix that sometime in a future release.

The code is available on GitHub, please send us pull requests when you make improvements.

Tags: , , ,

Comments are closed.

Kumina designs, builds, operates and supports Kubernetes solutions that help companies thrive online. As Certified Kubernetes Service Partner, we know how to build real solutions.