wiki:HackingMunin

Hacking Munin

Some notes made while finding my way in the munin source code. Feel free to make some notes here yourself - janl

Munin was written in Perl.

The main convention for using { } is a separate line for them. -- I hate this but perhaps I'm a minority - and we cant change conventions every other week, that's even more annoying.

munin-graph

Want nice global headers for Cur:, Min:, Max:, etc? Edit the /usr/share/munin/munin-graph prog. Go to line 761 and change

my $global_headers = ($max_field_len > 7);

Change the default value of 20 to 7 or a value of your choosing. If you always want global headers put

my $global_headers = 1;

Learn about rrd-tool

RRD for beginners. Munin builds on rrdtool. To learn about the graphing and all that read the man pages for rrdtool, rrdcreate, and the perl interface RRDs.

Notes on rrdgraph

Can't find any really fun examples of VDEF use.

  • DEF defines a time series based on a RRD file.
  • Here the AVERAGE function is used when interpolating the timeseries to match a new resolution: "DEF:gfree80=...apache_processes-free80-g.rrd:42:AVERAGE"
  • VDEF most often defines a single value, perhaps a single point (value,time) tuple. In the case of PERCENT it produces a time-series.
  • "VDEF:avg=gfree80,AVERAGE" computes the actual average of the timeseries. Presumably this will have no time component.
  • "VDEF:max=gfree,MAXIMUM" finds the highest value, presumably it will have a time component.
  • "VDEF:max=gfeee,LAST" finds the last defined value, presumably with a time component.
  • CDEF defines a time series based on a DEF or a CDEF (or VDEF...)

Data structure and functions

MuninDataStructure describes the data structure and some of the functions used to manipulate it.

Last modified at 2009-08-19T10:26:48+02:00 Last modified on 2009-08-19T10:26:48+02:00