1

I want to aggregate a total disk usage in percent of all my nodes with Munin.

Actually I tryed :

[streaming;Disk-Space]
    update no
    contacts no
    disk.graph_title Total Disk usage in percent
    disk.graph_category disk
    disk.graph_vlabel %
    disk.graph_args --upper-limit 100 -l 0
    disk.graph_scale no

    disk.type COUNTER
    disk.label Total up disk
    disk.sum \
        str1.mynodes.com:df._dev_sda2 \
        str2.mynodes.com:df._dev_sda2 

But display empty graphs.

kollo
  • 123
  • 3
  • Do you mean that if you have three volumes, respectively 30%, 40%, and 50% full, you want to display a graph that shows "120%", this being the sum of all three? If so, *why*? If not, what do you want to show, and *why*? – MadHatter Mar 01 '15 at 09:20
  • 1
    I want the disk usage of all nodes together as one entity. If I have 3 nodes at 30%, 40% and 50% full it should display 40% (all 3 nodes have same disk size). I want this because my nodes are used for storage, I want to know how much % of total storage is still free to anticipate a new server order. – kollo Mar 01 '15 at 09:58
  • You want to calculate an unweighted mean, yes? – MadHatter Mar 01 '15 at 10:09
  • Yes, I want an unweighted mean. – kollo Mar 01 '15 at 10:27
  • This looks to me like a piece of plugin config that attempts to use the results of a different plugin to calculate a result; I don't think munin can do that. Do you know otherwise? Or have I got the wrong end of the stick, and the code snippet you give above isn't intended to be used that way. Can you clarify? – MadHatter Mar 01 '15 at 16:07
  • this is a code I made for the bandwidth aggregation of the same nodes that works fine. I Just tryed to play arround with df and the disks name to try to get some graphs without success. I used this page for some tips http://munin-monitoring.org/wiki/HowToWritePlugins like percent graph_args, labels, etc. As you said maybe a plugin need to be wrote as I did not found anything on disk aggregation on Google. – kollo Mar 02 '15 at 04:13

1 Answers1

1

You can do this using cdef. Here's a working example that I did on my local server

[dhcp;av]
        update no
        ddf.update no
        ddf.graph_args --units=si --lower-limit 0 --upper-limit 100
        ddf.graph_title df average
        ddf.graph_vlabel percentage full
        ddf.graph_category disk
        ddf.av.draw AREA
        ddf.av.label average usage
        ddf.av.sum \
                dhcp;dhcp1:df._dev_mapper_rootvg_rootvol \
                dhcp;dhcp2:df._dev_mapper_rootvg_rootvol \
                dhcp;dhcp3:df._dev_mapper_rootvg_rootvol
        ddf.av.cdef av,3,/

I think for your setup it would be

[streaming;Disk-Space]
    update no
    contacts no
    disk.graph_title Total Disk usage in percent
    disk.graph_category disk
    disk.graph_vlabel %
    disk.graph_args --upper-limit 100 --lower-limit 0
    disk.graph_scale no
    disk.label Total up disk
    disk.av.sum \
        str1.mynodes.com:df._dev_sda2 \
        str2.mynodes.com:df._dev_sda2 
    disk.av.cdef av,2,/

You obviously need to change the number in the cdef expression to reflect the number of values you're adding together.

Paul Haldane
  • 4,517
  • 1
  • 21
  • 32