File: /home/httpd/html/mysqlcheck.php
<?php
$user='mojo_check';
$pass='rPpltYGaF2EogITx';
$counter = 0;
$con = mysql_connect('localhost',$user,$pass);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$res = mysql_query("SHOW DATABASES");
while ($row = mysql_fetch_assoc($res)) {
mysql_select_db($row['Database'], $con);
$result=mysql_query("show table status;");
while ($row2 = mysql_fetch_assoc($result)) {
if (preg_match("/crashed/", $row2['Comment'])) {
$counter++;
}
}
}
if ($counter == 0) {
print "Good";
} else {
print $counter.' errors';
}