munin_update plugin changes order of values very often. (with patch)
|Reported by:||quattro||Owned by:||nobody|
|Severity:||trivial||Keywords:||munin_update plugin sort|
I've found this behavior in the munin version that comes with squeeze.
it turns out that the order of the hosts in the $UPDATE_STATSFILE ist rather random
and so is the order in the diagrams.
meaning: a host gets another color more or less every update.
a simple 'sort' added after the sed line fixed this for me.
the second sort is superfluous but I put it there because I'd like these 2 lines to look the same ;-)
here's the (very simple) diff:
--- munin_update 2011-05-02 23:04:59.907038027 +0200 +++ /usr/share/munin/plugins/munin_update 2011-05-02 22:47:44.290037721 +0200 @@ -109,7 +109,7 @@ echo 'graph_vlabel seconds' echo 'graph_category munin' echo 'graph_info This graph shows the time it takes to collect data from each hosts that munin collects data on. Munin-master is run from cron every 5 minutes and we want each of the munin-update runs to complete before the next one starts. If munin-update uses too long time to run on one host run it with --debug to determine which plugin(s) are slow and solve the problem with them if possible.' - sed '/^UD|/!d; s/.*;//; s/|/ /;' < $UPDATE_STATSFILE | + sed '/^UD|/!d; s/.*;//; s/|/ /;' < $UPDATE_STATSFILE | sort | while read i j; do name="$(clean_fieldname "$i")" echo "$name.label $i" @@ -125,7 +125,7 @@ exit 0 } -sed '/^UD|/!d; s/.*;//; s/|/ /;' < $UPDATE_STATSFILE | +sed '/^UD|/!d; s/.*;//; s/|/ /;' < $UPDATE_STATSFILE | sort | while read i j; do name="$(clean_fieldname "$i")" echo "$name.value $j"