Index: trunk/ippMonitor/czartool/czartool/CzarDb.pm
===================================================================
--- trunk/ippMonitor/czartool/czartool/CzarDb.pm	(revision 40093)
+++ trunk/ippMonitor/czartool/czartool/CzarDb.pm	(revision 40094)
@@ -91,5 +91,6 @@
     SELECT label
         FROM current_labels
-        WHERE server LIKE '$server';
+        WHERE server LIKE '$server'
+        ORDER BY priority DESC, label;
 SQL
 
Index: trunk/ippMonitor/raw/czartool_labels.php
===================================================================
--- trunk/ippMonitor/raw/czartool_labels.php	(revision 40093)
+++ trunk/ippMonitor/raw/czartool_labels.php	(revision 40094)
@@ -395,5 +395,5 @@
 
     # order by descending priority as set in project database
-    $sql = "SELECT label FROM current_labels WHERE server LIKE '$server' ORDER BY priority DESC";
+    $sql = "SELECT label FROM current_labels WHERE server LIKE '$server' ORDER BY priority DESC, label";
     if ($debug) {echo "$sql<br>";}
 
@@ -949,5 +949,14 @@
 
     }
+
+    # note: mysql user must have either SUPER or REPLICATION CLIENT privileges on the database 
     $res = $dbRepl->query('SHOW SLAVE STATUS');
+    if (dberror($res)) {
+        echo "<tr><td>$replDatabaseName</td><td bgcolor=\"red\">MySQL query error - invalid user? check configuration</td></tr>";
+        //die("MySQL DB connection error: Check the configuration for $replDatabaseName");
+        //die("");
+        return -1;
+    }
+
     while ($res->fetchInto($row)) {
         # Have a look for Last_Errno in http://dev.mysql.com/doc/refman/5.0/en/show-slave-status.html
