Opened 2 years ago

Closed 3 months ago

#1081 closed patch (fixed)

munin_update plugin changes order of values very often. (with patch)

Reported by: quattro Owned by: nobody
Priority: low Milestone: Munin 2.0.0
Component: plugins Version: 1.4.5
Severity: trivial Keywords: munin_update plugin sort
Cc:

Description

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"



Change History (1)

comment:1 Changed 3 months ago by snide

  • Milestone changed from Munin 1.4.7 to Munin 2.0
  • Resolution set to fixed
  • Status changed from new to closed

Oops.

Sorry, I commited it in 6f0e6e2b4bf0caa36cef65028de24cf03c04ab5b without updating the bug.

Note: See TracTickets for help on using tickets.