Skip to content
Snippets Groups Projects
Commit fa9019ac authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'avoid-mysql-aborted-connections' into 'develop'

Avoid syslog errors about MySQL/MariaDB "Aborted connections" due to cron script.

Closes #6380

See merge request ispconfig/ispconfig3!1628
parents 49658d69 a4108e8f
No related branches found
No related tags found
1 merge request!1628Avoid syslog errors about MySQL/MariaDB "Aborted connections" due to cron script.
Pipeline #12379 passed
...@@ -470,16 +470,21 @@ class monitor_tools { ...@@ -470,16 +470,21 @@ class monitor_tools {
} }
} }
/* Monitor MySQL Server */ /* Monitor MySQL Server */
$data['mysqlserver'] = -1; // unknown - not needed $data['mysqlserver'] = -1; // unknown - not needed
if ($services['db_server'] == 1) { if ($services['db_server'] == 1) {
if ($this->_checkTcp($conf['db_host'], $conf['db_port'])) { // hail MySQL server:
$data['mysqlserver'] = 1; mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
} else { $ispcDB = mysqli_connect($conf['db_host'], $conf['db_user'], $conf['db_password'], $conf['db_database'], $conf['db_port']);
$data['mysqlserver'] = 0; if ($ispcDB !== false) {
$state = 'error'; // because service is down $data['mysqlserver'] = 1;
} } else {
} $data['mysqlserver'] = 0;
$state = 'error'; // because service is down
}
mysqli_close($ispcDB); // we can ignore the result (gwyneth 20220605)
}
/* /*
$data['mongodbserver'] = -1; $data['mongodbserver'] = -1;
if ($this->_checkTcp('localhost', 27017)) { if ($this->_checkTcp('localhost', 27017)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment