瀏覽代碼

Improved the detection of MySQL Slave status

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1023 a333f486-631f-4898-b8df-5754b55c2be0
romainq 14 年之前
父節點
當前提交
2104dbe176
共有 1 個文件被更改,包括 8 次插入6 次删除
  1. 8 6
      core/cmdbsource.class.inc.php

+ 8 - 6
core/cmdbsource.class.inc.php

@@ -562,19 +562,21 @@ class CMDBSource
 		{
 			return false;
 		}
-		if ($aRow['Slave_IO_Running'] != 'Yes')
+		if (!isset($aRow['Slave_SQL_Running']))
 		{
 			return false;
 		}
-		if (!isset($aRow['Slave_SQL_Running']))
+
+		// If at least one slave thread is running, then we consider that the slave is enabled
+		if ($aRow['Slave_IO_Running'] == 'Yes')
 		{
-			return false;
+			return true;
 		}
-		if ($aRow['Slave_SQL_Running'] != 'Yes')
+		if ($aRow['Slave_SQL_Running'] == 'Yes')
 		{
-			return false;
+			return true;
 		}
-		return true;
+		return false;
 	}
 }