tags 440003 + patch
thanks

According to
<URL:http://munin.projects.linpro.no/wiki/notes_on_datasource_names>,
the data source names can not contain +:

  Each data source in a plugin must be identified by a field name. The
  following describes the name of the field:

   - The name is limited to 19 characters. 
   - The characters must be [a-zA-Z0-9_], while the first character
     must be [a-zA-Z_].


This make me conclude that the bug is in the
/usr/share/munin/plugins/df and /usr/share/munin/plugins/df_inode
plugin, which fail to sanitize the device names properly.

Its clean_name function look like this:

  clean_name() {
    echo $1 $7 $2 | sed 's/[\/.-]/_/g'| awk "{
        if (\$3 == \"tmpfs\")
                n=\$1\$2
        else
                n=\$1
        print n
        }"
  }

The munin documentation recommend using this sed replacement regex
instead:

  s/^[^A-Za-z_]/_/       (for the first character)
  s/[^A-Za-z0-9_]/_/g    (for the other characeres)

Based on this I suggest modifying the modules like this:

--- /etc/munin/plugins/df       2005-04-03 02:54:12.000000000 +0200
+++ df  2007-09-08 21:44:50.000000000 +0200
@@ -57,7 +57,7 @@
 fi

 clean_name() {
-    echo $1 $7 $2 | sed 's/[\/.-]/_/g'| awk "{
+    echo $1 $7 $2 | sed 's/[^A-Za-z_]/_/g'| awk "{
        if (\$3 == \"tmpfs\")
                n=\$1\$2
        else
--- /etc/munin/plugins/df_inode 2005-04-03 02:54:12.000000000 +0200
+++ df_inode    2007-09-08 21:45:19.000000000 +0200
@@ -56,7 +56,7 @@
 print_values() {
        df -P -l -i -x none -x unknown | sed 1d | grep -v "//" | awk '$5 ~ 
/[0-9]%/ {print}' | while read i; do
                if [ "`fs $i`" = "reiserfs" ] ; then continue ; fi
-               name=`echo $i | sed 's/[\/.-]/_/g'| awk '{ print $1 ".value " 
}'`
+               name=`echo $i | sed 's/[^A-Za-z_]/_/g'| awk '{ print $1 ".value 
" }'`
                echo -n "$name "
                echo $i | awk '{ print $5 }' | cut -f1 -d%
        done

Happy hacking,
-- 
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to