Added support for MySQL 8.0.

This commit is contained in:
Junichi Satoh 2019-12-20 11:25:01 +09:00
parent 45a8904578
commit b245b3b4a8
2 changed files with 9 additions and 4 deletions

View File

@ -919,9 +919,10 @@ function servers_get_info($id_server=-1)
// Remote servers LAG Calculation (server_type != 0). // Remote servers LAG Calculation (server_type != 0).
if ($server['server_type'] != 0) { if ($server['server_type'] != 0) {
// MySQL 8.0 has function lag(). So, lag must be enclosed in quotations.
$result = db_get_row_sql( $result = db_get_row_sql(
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag, 'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS lag AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"
FROM tagente_estado, tagente_modulo, tagente FROM tagente_estado, tagente_modulo, tagente
WHERE utimestamp > 0 WHERE utimestamp > 0
AND tagente.disabled = 0 AND tagente.disabled = 0
@ -935,9 +936,10 @@ function servers_get_info($id_server=-1)
); );
} else { } else {
// Local/Dataserver server LAG calculation. // Local/Dataserver server LAG calculation.
// MySQL 8.0 has function lag(). So, lag must be enclosed in quotations.
$result = db_get_row_sql( $result = db_get_row_sql(
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag, 'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS lag AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"
FROM tagente_estado, tagente_modulo, tagente FROM tagente_estado, tagente_modulo, tagente
WHERE utimestamp > 0 WHERE utimestamp > 0
AND tagente.disabled = 0 AND tagente.disabled = 0

View File

@ -965,9 +965,12 @@ function install_step4()
$step5 = mysqli_query( $step5 = mysqli_query(
$connection, $connection,
"GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host "CREATE USER pandora@$host IDENTIFIED BY '".$random_password."'"
IDENTIFIED BY '".$random_password."'"
); );
$step5 |= mysqli_query(
$connection,
"GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host"
);
mysqli_query($connection, 'FLUSH PRIVILEGES'); mysqli_query($connection, 'FLUSH PRIVILEGES');
check_generic($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>"); check_generic($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>");