This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UserParameter=mysql.ping,HOME=/var/lib/zabbix mysqladmin ping 2>&1 | grep -c alive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function reconnectDb() | |
{ | |
if ($this->db->conn_id !== false) { | |
return; | |
} | |
log_message('error', 'DB接続失敗。再接続開始'); | |
// スクリプト実行可能時間を延ばしておく | |
ini_set('max_execution_time', '180'); | |
for ($retry_count = 0; $retry_count < 8; $retry_count ++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (! function_exist('logDebug')) { | |
function logDebug($message) | |
{ | |
$trace = debug_backtrace(); | |
$output = 'UserLog: ' . $trace[1]["class"] . '::' . $trace[1]['function'] . ' - '; | |
if (is_array($message)) { | |
$message = print_r($message, true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$con = new mysqli('localhost', 'root', 'pw', 'dbname'); | |
$mysqli_result = $con->query('show tables'); | |
$table_name_array = $mysqli_result->fetch_all(MYSQLI_BOTH); | |
$mysqli_result = null; | |
foreach ($table_name_array as $row) { | |
$mysqli_result = $con->query('show create table ' . $row[0]); | |
$create_table = $mysqli_result->fetch_array(); | |
echo $create_table[1] . "\r\n\r\n"; |