Package: munin-node
Version: 1.2.0-1
Severity: normal
Tags: patch

Hi,

when sensors outputs a multiline field just before the sensor we want, like
---
-5V (reserved):
           -5.20 V  (min =  -0.00 V, max =  -0.00 V)
CPU Fan:  7500 RPM  (min = 1997 RPM, div = 4)
---
the regexp extracts "-5.20V ... CPU Fan" as the sensor name for the fan.


If I change the regexp so that the name cannot begin with spaces, the problem
is fixed; I dont know if it can break other configs.


Cheers

--
Matthieu Lochegnies


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.11.5
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages munin-node depends on:
ii  libnet-server-perl            0.87-2     An extensible, general perl server
ii  perl                          5.8.4-8    Larry Wall's Practical Extraction 
ii  procps                        1:3.2.1-2  The /proc file system utilities

-- no debconf information
diff -ur munin_old/sensors_ munin/sensors_
--- munin_old/sensors_  2005-02-21 00:22:55.000000000 +0100
+++ munin/sensors_      2005-03-21 08:20:46.000000000 +0100
@@ -64,21 +64,21 @@
 my $SENSORS = $ENV{'sensors'} || 'sensors';
 my %config = (
               fan => {
-                        regex => qr/^([^:]*)\s*:\s+\+?(\d+) RPM.*?(\d+) RPM/m,
+                        regex => qr/^(\S[^:]*)\s*:\s+\+?(\d+) RPM.*?(\d+) 
RPM/m,
                         title => 'Fans',
                         vtitle => 'RPM',
                         print_threshold => \&fan_threshold,
                         graph_args => '--base 1000 -l 0'
                       },
               temp => {
-                        regex => qr/^([^:]*)\s*:\s+\+?(\d+(?:\.\d+)?)[° 
]C(?:\s+\((?:high|limit)\s*=\s*\+?(\d+(?:\.\d+)?)[° 
]C,\s*hyst(?:eresis)?\s*=\s*\+?(\d+(?:\.\d+)?)[° ]C\))?/m,
+                        regex => qr/^(\S[^:]*)\s*:\s+\+?(\d+(?:\.\d+)?)[° 
]C(?:\s+\((?:high|limit)\s*=\s*\+?(\d+(?:\.\d+)?)[° 
]C,\s*hyst(?:eresis)?\s*=\s*\+?(\d+(?:\.\d+)?)[° ]C\))?/m,
                         title => 'Temperatures',
                         vtitle => 'Celsius',
                         print_threshold => \&temp_threshold,
                         graph_args => '--base 1000 -l 0'
                       },
               volt => {
-                        regex => qr/^([^:]*)\s*:\s+\+?(-?\d+(?:\.\d+)?) 
V(?:\s+\(min\s*=\s*\+?(-?\d+(?:\.\d+)?) V,\s*max\s*=\s*\+?(-?\d+(?:\.\d+)?) 
V\))/m,
+                        regex => qr/^(\S[^:]*)\s*:\s+\+?(-?\d+(?:\.\d+)?) 
V(?:\s+\(min\s*=\s*\+?(-?\d+(?:\.\d+)?) V,\s*max\s*=\s*\+?(-?\d+(?:\.\d+)?) 
V\))/m,
                         title => 'Voltages',
                         vtitle => 'Volt',
                         print_threshold => \&volt_threshold,

Reply via email to