From 132e059482fa4a1771e55f62c3cbfbf3193e1125 Mon Sep 17 00:00:00 2001
From: jwarnier <jwarnier@ispconfig3>
Date: Tue, 10 Aug 2010 08:19:41 -0400
Subject: [PATCH] Fix typos, path to file which was moved and renamed and replace "which mdadm" call to file_exist('/proc/mdstat') as we are not using mdadm in this script anyway.

---
 server/mods-available/monitor_core_module.inc.php |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/server/mods-available/monitor_core_module.inc.php b/server/mods-available/monitor_core_module.inc.php
index 29dea26..0fc02e5 100644
--- a/server/mods-available/monitor_core_module.inc.php
+++ b/server/mods-available/monitor_core_module.inc.php
@@ -69,8 +69,8 @@
 
 	//** Get distribution identifier
 	//** IMPORTANT!
-	//   This is the same code as in /install/install.php
-	//   So if you change it here, you also have to change it in /install/install.php!
+	//   This is the same code as in install/lib/install.lib.php
+	//   So if you change it here, you also have to change it in there!
 	//   Please do not forget to remove the swriteln(); - lines here at this file
 	function get_distname() {
 
@@ -838,11 +838,11 @@
 		/** The type of the data */
 		$type = 'system_update';
 
-		/* This monitoring is only available at debian or Ubuntu */
+		/* This monitoring is only available on Debian or Ubuntu */
 		if(file_exists('/etc/debian_version')) {
 
 			/*
-             * first update the "update-database"
+             * first update the "apt database"
 			*/
 			shell_exec('apt-get update');
 
@@ -914,7 +914,7 @@
 		}
 		else {
 			/*
-             * It is not debian/Ubuntu, so there is no data and no state
+             * It is not Debian/Ubuntu, so there is no data and no state
              *
              * no_state, NOT unknown, because "unknown" is shown as state
              * inside the GUI. no_state is hidden.
@@ -1001,16 +1001,15 @@
 		$type = 'raid_state';
 
 		/*
-		 * We support some RAIDS. But if we can't find any of them, we have no data
+		 * We support several RAID types, but if we can't find any of them, we have no data
 		*/
 		$state = 'no_state';
 		$data['output']= '';
 
 		/*
-		 * Check, if we have mdadm installed (software-raid)
+		 * Check, if Software-RAID is enabled
 		*/
-		system('which mdadm', $retval);
-		if($retval === 0) {
+		if(file_exists('/proc/mdstat')) {
 			/*
              * Fetch the output
 			*/
@@ -1825,4 +1824,4 @@
 		return $res;
 	}
 }
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1