function menu() { system("clear"); echo "Restart MySQL service.....................: [R]\n"; echo "Change the Local MySQL root password......: [P]\n"; echo "Use a remote MySQL service................: [R]\n"; echo "MySQL status..............................: [S]\n"; echo "MySQL Events..............................: [E]\n"; echo "Return to main menu.......................: [Q]\n"; $answer = trim(strtolower(fgets(STDIN))); if ($answer == "q") { die(0); } if ($answer == "r") { RestartMySQL(); menu(); return; } if ($answer == "p") { ChangeRootPassword(); menu(); return; } if ($answer == "s") { mysql_status(); menu(); return; } if ($answer == "r") { mysql_remote(); menu(); return; } if ($answer == "e") { mysql_events(); menu(); return; } }
exit; } if (isset($_GET["restart-ftp"])) { pureftpd_restart(); exit; } if (isset($_GET["dmicode"])) { dmicode(); exit; } if (isset($_GET["php-ini-set"])) { PHP_INI_SET(); exit; } if (isset($_GET["mysql-events"])) { mysql_events(); exit; } if (isset($_GET["AdCacheMysql"])) { AdCacheMysql(); exit; } if (isset($_GET["kav4Proxy-reload"])) { kav4proxy_reload(); exit; } if (isset($_GET["kav4proxy-stop"])) { kav4proxy_stop(); exit; } if (isset($_GET["kav4proxy-restart"])) {
function Parseline($buffer) { if (strpos($buffer, "RSA server certificate CommonName") > 0) { return; } if (strpos($buffer, "[debug]") > 0) { return; } if (strpos($buffer, "[info]") > 0) { return; } if (strpos($buffer, "File does not exist") > 0) { return; } if (strpos($buffer, "client denied by server configuration") > 0) { return; } //************************************************************************************************************************** if (preg_match("#error.*?raising the MaxClients#", $buffer)) { $fileStamp = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __LINE__ . ".time"; $timefile = file_time_min($fileStamp); if ($timefile > 0) { @unlink($fileStamp); @file_put_contents($fileStamp, time); $HotSpotMaxClients = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/HotSpotMaxClients")); if ($HotSpotMaxClients == 0) { $HotSpotMaxClients = 20; } $HotSpotMaxClientsNew = $HotSpotMaxClients + 2; @file_put_contents("/etc/artica-postfix/settings/Daemons/HotSpotMaxClients", $HotSpotMaxClientsNew); mysql_events(0, "MaxClients reached, upgrade from {$HotSpotMaxClients} daemons to {$HotSpotMaxClientsNew} [action=restart]", $buffer); shell_exec("{$GLOBALS["NOHUP_BIN"]} /etc/init.d/artica-hotspot restart >/dev/null 2>&1 &"); } return; } //************************************************************************************************************************** if (preg_match("#you may need to increase StartServers#", $buffer)) { $fileStamp = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __LINE__ . ".time"; $timefile = file_time_min($fileStamp); if ($timefile > 0) { @unlink($fileStamp); @file_put_contents($fileStamp, time); $HotSpotStartServers = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/HotSpotStartServers")); if ($HotSpotStartServers == 0) { $HotSpotStartServers = 20; } $HotSpotStartServersNew = $HotSpotStartServers + 2; @file_put_contents("/etc/artica-postfix/settings/Daemons/HotSpotStartServers", $HotSpotStartServersNew); mysql_events(0, "StartServers reached, upgrade from {$HotSpotStartServers} daemons to {$HotSpotStartServersNew} [action=restart]", $buffer); } return; } //************************************************************************************************************************** if (preg_match("#warn.*?Identifier removed: Failed to release SSL session cache lock#", $buffer)) { $fileStamp = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __LINE__ . ".time"; $timefile = file_time_min($fileStamp); if ($timefile > 0) { @unlink($fileStamp); @file_put_contents($fileStamp, time); mysql_events(0, "SSL issue, overloaded system, reboot web service", $buffer); shell_exec("{$GLOBALS["NOHUP_BIN"]} /etc/init.d/artica-hotspot restart >/dev/null 2>&1 &"); } return; } //************************************************************************************************************************** if (preg_match("#error.*?Cannot allocate memory: fork: Unable to fork new process#", $buffer)) { $fileStamp = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __LINE__ . ".time"; $timefile = file_time_min($fileStamp); if ($timefile > 0) { @unlink($fileStamp); @file_put_contents($fileStamp, time); mysql_events(0, "Cannot allocate memory, reboot web service", $buffer); shell_exec("{$GLOBALS["NOHUP_BIN"]} /etc/init.d/artica-hotspot restart >/dev/null 2>&1 &"); } return; } //************************************************************************************************************************** if (preg_match("#Failed to release SSL session cache lock#", $buffer)) { $fileStamp = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __LINE__ . ".time"; $timefile = file_time_min($fileStamp); if ($timefile > 0) { @unlink($fileStamp); @file_put_contents($fileStamp, time); mysql_events(0, "Failed to release SSL session cache lock, reboot web service", $buffer); shell_exec("{$GLOBALS["NOHUP_BIN"]} /etc/init.d/artica-hotspot restart >/dev/null 2>&1 &"); } return; } //************************************************************************************************************************** events("No match {$buffer}"); }