Commit 9c9382e6 authored by tbrehm's avatar tbrehm

Fixed: FS#1709 - Wrong message "Your hard-disk space is going full" in the...

Fixed: FS#1709 - Wrong message "Your hard-disk space is going full" in the "Monitor -> Show Disk Usage"
parent cdf6f035
......@@ -407,6 +407,15 @@ class monitor_tools {
* calculate the state
*/
$usePercent = floatval($data[$i]['percent']);
//* get the free memsize
if(substr($data[$i]['available'],-1) == 'G') {
$freesize = floatval($data[$i]['available'])*1024;
} elseif(substr($data[$i]['available'],-1) == 'T') {
$freesize = floatval($data[$i]['available'])*1024*1024;
} else {
$freesize = floatval($data[$i]['available']);
}
//* We don't want to check some filesystem which have no sensible filling levels
switch ($data[$i]['type']) {
......@@ -418,13 +427,13 @@ class monitor_tools {
case 'udev':
break;
default:
if ($usePercent > 75)
if ($usePercent > 75 && $freesize < 2000)
$state = $this->_setState($state, 'info');
if ($usePercent > 80)
if ($usePercent > 80 && $freesize < 1000)
$state = $this->_setState($state, 'warning');
if ($usePercent > 90)
if ($usePercent > 90 && $freesize < 500)
$state = $this->_setState($state, 'critical');
if ($usePercent > 95)
if ($usePercent > 95 && $freesize < 100)
$state = $this->_setState($state, 'error');
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment