From 391e05cbee6ff84bce60b665be60b4e5f049ee7f Mon Sep 17 00:00:00 2001
From: Falko Timme <ft@falkotimme.com>
Date: Tue, 22 Oct 2013 12:48:51 -0400
Subject: [PATCH] - Display hostname next to IP (where available) in the jQuery IP suggestion box.

---
 server/lib/classes/monitor_tools.inc.php |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/server/lib/classes/monitor_tools.inc.php b/server/lib/classes/monitor_tools.inc.php
index 6162024..0b1caa6 100644
--- a/server/lib/classes/monitor_tools.inc.php
+++ b/server/lib/classes/monitor_tools.inc.php
@@ -132,7 +132,7 @@
 				$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 = 'debian60';
@@ -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 2>/dev/null');
+		//$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);
@@ -897,7 +900,7 @@
 			/*
 			 * Fetch the output
 			 */
-			$data['output'] = $aptData;
+			$data['output'] = shell_exec('apt-get -s -q dist-upgrade');
 		} elseif (file_exists('/etc/gentoo-release')) {
 
 			/*
@@ -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

--
Gitblit v1.9.1