From 2d2fd172e1548dd24e1719accd0b856cff6a31a0 Mon Sep 17 00:00:00 2001 From: Falko Timme <ft@falkotimme.com> Date: Fri, 18 Oct 2013 12:20:13 -0400 Subject: [PATCH] - Added funtion to convert currency formatted numbers back to floating numbers. - Improved getSearchSQL() function so that users can use their native date format so search for dates in lists. --- server/lib/classes/monitor_tools.inc.php | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) diff --git a/server/lib/classes/monitor_tools.inc.php b/server/lib/classes/monitor_tools.inc.php index d1ed129..0b1caa6 100644 --- a/server/lib/classes/monitor_tools.inc.php +++ b/server/lib/classes/monitor_tools.inc.php @@ -132,10 +132,10 @@ $distver = 'Squeeze/Sid'; $distid = 'debian60'; $distbaseid = 'debian'; - } elseif (strstr(trim(file_get_contents('/etc/debian_version')), '7.0') || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') { + } elseif (strstr(trim(file_get_contents('/etc/debian_version')), '7.0') || strstr(trim(file_get_contents('/etc/debian_version')), '7.1') || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') { $distname = 'Debian'; $distver = 'Wheezy/Sid'; - $distid = 'debian70'; + $distid = 'debian60'; $distbaseid = 'debian'; } else { $distname = 'Debian'; @@ -302,7 +302,7 @@ $state = 'ok'; //* Fetch the data for all users - $dfData = shell_exec('repquota -au'); + $dfData = shell_exec('repquota -au 2>/dev/null'); //* Split into array $df = explode("\n", $dfData); @@ -330,7 +330,7 @@ } //** Fetch the data for all users - $dfData = shell_exec('repquota -ag'); + $dfData = shell_exec('repquota -ag 2>/dev/null'); //* split into array $df = explode("\n", $dfData); @@ -473,7 +473,7 @@ } public function monitorDiskUsage() { - global $conf; + global $app,$conf; /* the id of the server as int */ $server_id = intval($conf['server_id']); @@ -485,7 +485,10 @@ $state = 'ok'; /** Fetch the data of ALL devices into a array (needed for monitoring!) */ - $dfData = shell_exec('df -hT'); + //$dfData = shell_exec('df -hT 2>/dev/null'); + $app->uses('getconf'); + $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); + $dfData = shell_exec('df -hT|grep -v "'.$web_config['website_basedir'].'/" 2>/dev/null'); // split into array $df = explode("\n", $dfData); @@ -1058,7 +1061,7 @@ /* fetch the next line */ $line = $tmp[$i]; - if ((strpos($line, '[U_]') !== false) || (strpos($line, '[_U]') !== false)) { + if ((strpos($line, 'U_]') !== false) || (strpos($line, '[_U') !== false) || (strpos($line, 'U_U') !== false)) { /* One Disk is not working. * if the next line starts with "[>" or "[=" then * recovery (resync) is in state and the state is @@ -1309,7 +1312,7 @@ system('which iptables', $retval); // Debian, Ubuntu, Fedora if ($retval === 0) { /* Get the data of the log */ - $data['output'] = '<h2>iptables -S (ipv4)</h2>'.shell_exec('iptables -S'); + $data['output'] = '<h2>iptables -S (ipv4)</h2>'.shell_exec('iptables -S 2>/dev/null'); /* * At this moment, there is no state (maybe later) @@ -1325,7 +1328,7 @@ system('which ip6tables', $retval); // Debian, Ubuntu, Fedora if ($retval === 0) { /* Get the data of the log */ - $data['output'] .= '<br><h2>ip6tables -S (ipv6)</h2>'.shell_exec('ip6tables -S'); + $data['output'] .= '<br><h2>ip6tables -S (ipv6)</h2>'.shell_exec('ip6tables -S 2>/dev/null'); /* * At this moment, there is no state (maybe later) -- Gitblit v1.9.1