Changing Munin default graph colours

Munin is a computer monitoring tool which provides useful tracking facilities to monitor hardware and software over time. I've found it very useful but one of my main gripes has been poor colour choice for lines on graphs. By default, for many plugins Munin chooses a colour from an internal palette for each line on a graph. This seems fine but in practice, some colours are very poor contrast against a white background e.g. lime green:

Munin colours before

The lime green line in the middle is the one I'm really interested in being able to see at a glance. I tried googling for all manner of things regarding changing default colours but had no luck. Everything was very unhelpful or only useful if you were writing your own plugin. I've never found the Munin documentation particularly accessible either which didn't help.

In the end, I managed to solve my problem by assuming that the default colours must be stored in plain text somewhere on the filesystem so I ran a search to find the relevant colour's hexadecimal code: #ccff00 i.e. Lime green. The following line returns a list of all files on the filesystem (without leaving it for other mounted filesystems, as specified by the -xdev option) and then searches for "ccff00" in each, returning any matches with a file name:

$ sudo find / -xdev -type f -print0 |xargs -0 grep -H "CCFF00"
/usr/share/perl5/Munin/Master/GraphOld.pm:        qw(#00CC00 #0066B3 #FF8000 ↵
#FFCC00 #330099 #990099 #CCFF00 #FF0000 #808080

There were other files found on the filesystem which contained the search string but they weren't related to Munin in any way. To try and change the colour, I opened the file that was found and found a palette section with details for both the default munin palette and the new palette (which supposedly has better contrast - not enough in my opinion!).

$PALETTE{'old'} = [    # This is the old munin palette.  It lacks contrast.
   qw(#22ff22 #0022ff #ff0000 #00aaaa #ff00ff
      #ffa500 #cc0000 #0000cc #0080C0 #8080C0 #FF0080
      #800080 #688e23 #408080 #808000 #000000 #00FF00
      #0080FF #FF8000 #800000 #FB31FB
      )];

$PALETTE{'default'} = [   # New default palette.Better contrast,more colours
   #Greens Blues   Oranges Dk yel  Dk blu  Purple  lime    Reds    Gray
   qw(#00CC00 #0066B3 #FF8000 #FFCC00 #330099 #990099 #CCFF00 #FF0000 #808080
      #008F00 #00487D #B35A00 #B38F00         #6B006B #8FB300 #B30000 #BEBEBE
      #80FF80 #80C9FF #FFC080 #FFE680 #AA80FF #EE00CC #FF8080
      #666600 #FFBFFF #00FFCC #CC6699 #999900
      )];      # Line variations: Pure, earthy, dark pastel, misc colours

In my case, I just replaced the lime green code (#ccff00) with one for a much darker green (#008010) to give a much darker green colour for the relevant line:

Munin colours before

The new colour appeared after each graph was updated by Munin and required no manual intervention after editing the config file. Overall, much better, just not easily found in the Munin documentation.

References

Stack exchange description of searching an entire filesystem for a text string

Published on 28th April 2013.