Commit 246db080 authored by Patrick Schmalstig's avatar Patrick Schmalstig
Browse files

Fixed MANTIS-5481 (Use Available instead of Free for RAM check on Linux)

parent 85317c94
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -358,7 +358,9 @@ class Hook_health_check_performance_server extends Hook_Health_Check
                }
            } elseif (strpos(PHP_OS, 'Linux') !== false) {
                $data = shell_exec('free');
                if (preg_match('#^Mem:\s+(\d+)\s+(\d+)\s+(\d+)#m', $data, $matches) != 0) {
                if (preg_match('#^Mem:\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)#m', $data, $matches) != 0) {
                    $bytes_free = intval($matches[6]) * 1024;
                } elseif (preg_match('#^Mem:\s+(\d+)\s+(\d+)\s+(\d+)#m', $data, $matches) != 0) {
                    $bytes_free = intval($matches[3]) * 1024;
                }
            } elseif (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {