Fix fan RPM parsing
authorJamie Cameron <jcameron@webmin.com>
Sat, 27 Mar 2010 07:22:14 +0000 (00:22 -0700)
committerJamie Cameron <jcameron@webmin.com>
Sat, 27 Mar 2010 07:22:14 +0000 (00:22 -0700)
status/sensors-monitor.pl

index 2c7282c..ffa18fc 100755 (executable)
@@ -77,7 +77,7 @@ if (!defined(@get_sensors_cache)) {
                        $rv[$#rv]->{'alarm'} = 1 if (/ALARM/);
                        }
                elsif (/^([^:]+):\s+([0-9\.\+\-]+)\s*(\S+)\s+\(min\s+=\s+([0-9\.\+\-]+)\s*(\S+),\s+div\s+=\s+([0-9\.\+\-]+)/) {
-                       # Value with min only
+                       # Value with min and div
                        push(@rv, { 'name' => $1,
                                    'value' => $2,
                                    'units' => $3,
@@ -85,6 +85,14 @@ if (!defined(@get_sensors_cache)) {
                                    'div' => $6 });
                        $rv[$#rv]->{'alarm'} = 1 if (/ALARM/);
                        }
+               elsif (/^([^:]+):\s+([0-9\.\+\-]+)\s*(\S+)\s+\(min\s+=\s+([0-9\.\+\-]+)\s*(\S+)/) {
+                       # Value with min only
+                       push(@rv, { 'name' => $1,
+                                   'value' => $2,
+                                   'units' => $3,
+                                   'min' => $4 });
+                       $rv[$#rv]->{'alarm'} = 1 if (/ALARM/);
+                       }
                elsif (/^([^:]+):\s+([0-9\.\+\-]+)\s*(\S+)\s+\((limit|high)\s+=\s+([0-9\.\+\-]+)\s*(\S+)/) {
                        # Value with max only
                        push(@rv, { 'name' => $1,