Changeset 29654
- Timestamp:
- Nov 3, 2010, 1:39:43 PM (16 years ago)
- Location:
- trunk/ippMonitor/raw
- Files:
-
- 2 edited
-
czartool_labels.php (modified) (2 diffs)
-
site.php.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/raw/czartool_labels.php
r29650 r29654 156 156 echo "</td>\n"; 157 157 echo "<td>\n"; 158 echo "<b>Information about replication will be here soon</b>"; 158 # This is awful 159 echo "<table border=\"1\"><tr><td colspan=\"2\"><b>Databases Replication Status</b></td></tr>"; 160 echo "<tr><td>Database</td><td>Replication Status</td></tr>"; 161 showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1); 162 showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS); 163 echo "</table>"; 159 164 echo "</td>\n"; 160 165 echo "</tr>\n"; 161 166 162 167 echo "</table>\n"; 163 164 168 165 169 menu_end(); … … 679 683 680 684 } 681 682 } 683 685 } 686 687 ########################################################################### 688 # 689 # Shows the status of the various replication mysql servers 690 # 691 ########################################################################### 692 function showReplicationsStatus($replHost, $replUser, $replPassword, $replDatabaseName) { 693 #print "<br>$replHost, $replUser, $replPassword, $replDatabaseName<br/>"; 694 $dbRepl = DB::connect("mysql://$replUser:$replPassword@$replHost"); 695 if (PEAR::isError($dbRepl)) { 696 die("MySQL DB connection error: Check the configuration for $replDatabaseName"); 697 } 698 $res = $dbRepl->query('SHOW SLAVE STATUS'); 699 while ($res->fetchInto($row)) { 700 # Have a look for Last_Errno in http://dev.mysql.com/doc/refman/5.0/en/show-slave-status.html 701 $errorStatusInMySql = $row[18]; 702 $replStatus = ($errorStatusInMySql==0?"OK":"<font color=\"red\">PROBLEM</font>"); 703 echo "<tr><td>$replDatabaseName</td><td>$replStatus</td></tr>"; 704 if ($errorStatusInMySql!=0) { 705 echo "<tr><td colspan=\"2\">Connect to $replDatabaseName replication host, execute 'SHOW SLAVE STATUS', and fix the problem.<br/>"; 706 echo "Information <a href=\"http://dev.mysql.com/doc/refman/5.0/en/show-slave-status.html\">here</a></td></tr>"; 707 } 708 } 709 $dbRepl->disconnect(); 710 } 684 711 685 712 ?> -
trunk/ippMonitor/raw/site.php.in
r28616 r29654 21 21 $DELETION_USER = "apache"; 22 22 $DELETION_DELAY = 15; 23 24 $REPL_HOST_GPC1 = "ipp0012.IfA.Hawaii.Edu"; 25 $REPL_USER_GPC1 = "ipp"; 26 $REPL_PASSWORD_GPC1 = "ipp"; 27 $REPL_DBNAME_GPC1 = "gpc1"; 28 29 $REPL_HOST_NEBULOUS = "ipp0222.IfA.Hawaii.Edu"; 30 $REPL_USER_NEBULOUS = "ippMonitor"; 31 $REPL_PASSWORD_NEBULOUS = "ippMonitor"; 32 $REPL_DBNAME_NEBULOUS = "Nebulous"; 33 23 34 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
