Gitlab Community Edition Instance

Skip to content
Snippets Groups Projects
Commit a4108e8f authored by Jens's avatar Jens
Browse files
parent c1250ee2
No related branches found
No related tags found
No related merge requests found
...@@ -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.
Please register or to comment