Package: munin-node
Version: 1.2.5-2
Severity: normal
Tags: patch

plugin df_abs always reports Critical status for write-once media like CD-ROM, 
sice these media are always reported as 100% full by df.

Giving a solution to 454260 as suggested may fix this, but I provide a patch 
that adresses this with another philosophy.

My patch just gives no critical warning for read-only filesystems.

--- df_abs.orig 2008-06-02 03:13:40.000000000 +0200
+++ df_abs      2008-06-02 03:42:24.000000000 +0200
@@ -50,8 +50,9 @@
        df -P -l -x none -x unknown | sed 1d | grep -v "//" | while read i; do
                name=`clean_name $i`
                echo -n "$name.label "
-               echo $i | awk "{
-                       dir=\$6
+               dir=`echo $i | awk '{print \$6}'`
+               echo $dir | awk "{
+                       dir=\$1
                        if (length(dir) <= $MAXLABEL)
                                print dir
                        else
@@ -59,8 +60,14 @@
                }"
                echo "$name.cdef $name,1024,*"
                size=`echo $i | awk '{print $2}'`
-               echo "$name.warning $((size / 100 * 92))"
-               echo "$name.critical $((size / 100 * 98))"
+               mountopts=`mount|grep $dir|awk '{print \$6}'| grep .*rw.* 
>/dev/null ;echo $?`
+               if [ $mountopts -eq 0 ] ; then
+                       echo "$name.warning $((size / 100 * 92))"
+                       echo "$name.critical $((size / 100 * 98))"
+               else
+                       echo "$name.warning $((size / 100 * 101))"
+                       echo "$name.critical $((size / 100 * 101))"
+               fi
        done
        exit 0
 fi


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/2 CPU cores)
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages munin-node depends on:
ii  adduser                       3.107      add and remove users and groups
ii  libnet-server-perl            0.97-1     An extensible, general perl server
ii  lsb-base                      3.2-11     Linux Standard Base 3.2 init scrip
ii  perl                          5.10.0-10  Larry Wall's Practical Extraction 
ii  procps                        1:3.2.7-8  /proc file system utilities

Versions of packages munin-node recommends:
ii  libnet-snmp-perl              5.2.0-1    Script SNMP connections

-- no debconf information



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

Reply via email to