From Forza's ramblings

Munin Monitoring Tool

Btrfs_usage plugin in munin

Munin is a very popular monitoring tool. It can monitor several computers and plot the iconic RRDTool plots that are served up as a HTML page.


Munin comes with many plugins by default. For Btrfs monitoring you should use the btrfs_usage plugin. It can be found on most dristros as munin-plugins-btrfs or munin-plugins-extra.

The python-btrfs library is needed for the plugin to work. It's available on many distributions and also directly from GitHub. It includes the btrfs_usage plugin in examples.

By default, the plugin scans all Btrfs filesystems and adds them to the munin graphs. If you want to change the title of a graph[1] you need to edit you /etc/munin/munin.conf and add the following to your host section:

   use_node_name yes
   btrfs_usage_fe0a1142_51ab_4181_b635_adbf9f4ea6e6.graph_title Btrfs usage for 6TB
   btrfs_usage_df68a30d_d26e_4b9c_9606_a130e66ce63d.graph_title Btrfs usage for Backup disk
   btrfs_usage_446d32cb_a6da_45f0_9246_1483ad3420e0.graph_title Btrfs usage for Root
   btrfs_usage_1128e72e_b00f_4c2a_a1e1_afa89f3c11cc.graph_title Btrfs usage for Boot

Look at the output from btrfs filesystem show to get the uuid for the corresponding graph titles. Note to change the dash - to an undesrcore _.

# btrfs filesystem show
Label: 'btrfs-root' uuid: 446d32cb-a6da-45f0-9246-1483ad3420e0
        Total devices 1 FS bytes used 28.43GiB
        devid    1 size 233.47GiB used 75.03GiB path /dev/sda3

Label: '6TB'  uuid: fe0a1142-51ab-4181-b635-adbf9f4ea6e6
        Total devices 2 FS bytes used 3.37TiB
        devid    2 size 2.72TiB used 2.14TiB path /dev/sdc2
        devid    3 size 1.82TiB used 1.23TiB path /dev/sdb2 

Label: 'btrfs-boot'  uuid: 1128e72e-b00f-4c2a-a1e1-afa89f3c11cc
        Total devices 1 FS bytes used 60.62MiB
        devid    1 size 1.00GiB used 256.00MiB path /dev/sda2

Label: 'usb-backup'  uuid: df68a30d-d26e-4b9c-9606-a130e66ce63d
        Total devices 1 FS bytes used 653.62GiB
        devid    1 size 931.51GiB used 662.02GiB path /dev/sdd1

  1. Munin plugin reference manual [1]