Munin + Raspberry Pi + GlusterFS

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Munin + Raspberry Pi + GlusterFS

Post by ^rooker »

I've just setup Munin monitoring on our Raspberry Pi. Since I'm also using GlusterFS, which will grow in size over time, it might be a good idea to graph the absolute disk usage, rather than just the percentage (which is the default).

First thing I noticed was, that the disk usage of the mounted glusterfs volume didn't even show up in Munin's df graph.
The documentation in the df-plugin's perl code mentions options to include/exclude certain mountpoints. I tried that, but it didn't help.

Only local filesystems supported:
The reason is that the current 'df' plugin (Munin v2.0.6) only support local filesystems.

Patch for supporting network filesystems:
So I debugged the df perl code, and finally wrote a patch to support non-local filesystems, too. It's even more generic: It enables you to manually configure to commandline options passed to the "df" call.
Since I don't see this patch interfering with df's former usage, I committed the patch as Ticket #1461 on Munin's tracker.

Configure 'df' plugin options:
Edit your "/etc/munin/plugin-conf.d/munin-node" config file, and add the following setting to your [df*] block:
env.dfopts -P
It looks a bit odd (due to missing quotation marks), but it works perfectly. The default options supplied to "df" by the plugin are "-P -l", which limits the available filesystems to local-only.
By overriding it with only "-P" (=POSIX compliant output), it now supports graphing glusterfs shares, too.

After you've finished, editing the configfile, restart the munin-node service:

Code: Select all

$ sudo service munin-node restart
That's it. Your GlusterFS mountpoint should now show up on the "Disk Usage" graph :)

Links:
Last edited by ^rooker on Tue Mar 24, 2015 6:14 pm, edited 1 time in total.
Reason: Renamed patch file to match with "df_abs" patch.
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Status update

Post by ^rooker »

There was a bug in my original patch that caused the "env.exclude" options to be ignored, therefore causing slightly cluttered graphs.
Nevertheless, my changes are meanwhile included upstream.

In the current Munin version included in Debian Wheezy's repositories, there is a "df_abs" plugin which shows the disk usage in bytes (rather than percent).
Excellent!
Unfortunately, it suffers from the same "-l" issue as "df" did, so I wrote another patch: munin-v2.0.6-df_abs-env_dfopts.patch
It adds the "env.dfopts" override functionality, and therefore causes "df" and "df_abs" to have matching configuration and behavior.
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply