mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added docs for MySQL strict mode + update validate to warn about it
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
|
||||
This host is where the MySQL database runs. It could be the same machine as your network management server (this is the most common initial deployment scenario).
|
||||
|
||||
> ** Whilst we are working on ensuring LibreNMS is compatible with MySQL strict mode, for now, please disable this after mysql is installed.
|
||||
|
||||
You are free to choose between using MySQL or MariaDB:
|
||||
|
||||
**MySQL**
|
||||
@@ -45,6 +47,8 @@ Find the line: `bind-address = 127.0.0.1`
|
||||
|
||||
Change `127.0.0.1` to the IP address that your MySQL server should listen on. Restart MySQL:
|
||||
|
||||
If you see a line that starts `sql-mode` then change this to `sql-mode=""`.
|
||||
|
||||
service mysql restart
|
||||
|
||||
### On the NMS ###
|
||||
|
@@ -4,6 +4,10 @@ NOTE: These instructions assume you are the root user. If you are not, prepend
|
||||
|
||||
### On the DB Server ###
|
||||
|
||||
This host is where the MySQL database runs. It could be the same machine as your network management server (this is the most common initial deployment scenario).
|
||||
|
||||
> ** Whilst we are working on ensuring LibreNMS is compatible with MySQL strict mode, for now, please disable this after mysql is installed.
|
||||
|
||||
You are free to choose between using MySQL or MariaDB:
|
||||
|
||||
**MySQL**
|
||||
@@ -56,6 +60,8 @@ Add the following line:
|
||||
|
||||
Change `<ip>` to the IP address that your MySQL server should listen on. Restart MySQL:
|
||||
|
||||
If you see a line that starts `sql-mode` then change this to `sql-mode=""`.
|
||||
|
||||
service mysqld restart
|
||||
|
||||
### On the NMS ###
|
||||
|
@@ -4,6 +4,10 @@
|
||||
|
||||
### On the DB Server ###
|
||||
|
||||
This host is where the MySQL database runs. It could be the same machine as your network management server (this is the most common initial deployment scenario).
|
||||
|
||||
> ** Whilst we are working on ensuring LibreNMS is compatible with MySQL strict mode, for now, please disable this after mysql is installed.
|
||||
|
||||
You are free to choose between using MySQL or MariaDB:
|
||||
|
||||
**MySQL**
|
||||
@@ -42,6 +46,8 @@ Find the line: `bind-address = 127.0.0.1`
|
||||
|
||||
Change `127.0.0.1` to the IP address that your MySQL server should listen on. Restart MySQL:
|
||||
|
||||
If you see a line that starts `sql-mode` then change this to `sql-mode=""`.
|
||||
|
||||
service mysql restart
|
||||
|
||||
### On the NMS ###
|
||||
|
22
validate.php
22
validate.php
@@ -13,13 +13,10 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
require 'includes/console_colour.php';
|
||||
$console_color = new Console_Color2();
|
||||
|
||||
$options = getopt('m:h::');
|
||||
|
||||
if (isset($options['h'])) {
|
||||
print $console_color->convert(
|
||||
echo
|
||||
"\n Validate setup tool
|
||||
|
||||
Usage: ./validate.php [-m <module>] [-h]
|
||||
@@ -31,7 +28,7 @@ if (isset($options['h'])) {
|
||||
Example: ./validate.php -m mail.
|
||||
|
||||
"
|
||||
);
|
||||
;
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -71,6 +68,12 @@ else {
|
||||
print_ok('Database connection successful');
|
||||
}
|
||||
|
||||
// Test for MySQL Strict mode
|
||||
$strict_mode = dbFetchCell("SELECT @@global.sql_mode");
|
||||
if(strstr($strict_mode, 'STRICT_TRANS_TABLES')) {
|
||||
print_warn('You have MySQL STRICT_TRANS_TABLES enabled, it is advisable to disable this until full support has been added: https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html');
|
||||
}
|
||||
|
||||
// Test transports
|
||||
if ($config['alerts']['email']['enable'] === true) {
|
||||
print_warn('You have the old alerting system enabled - this is to be deprecated on the 1st of June 2015: https://groups.google.com/forum/#!topic/librenms-project/1llxos4m0p4');
|
||||
@@ -203,21 +206,18 @@ foreach ($modules as $module) {
|
||||
|
||||
|
||||
function print_ok($msg) {
|
||||
global $console_color;
|
||||
print $console_color->convert("%g[OK]%n %W$msg\n");
|
||||
echo "[OK] $msg\n";
|
||||
|
||||
}//end print_ok()
|
||||
|
||||
|
||||
function print_fail($msg) {
|
||||
global $console_color;
|
||||
print $console_color->convert("%r[FAIL]%n %W$msg\n");
|
||||
echo "[FAIL] $msg\n";
|
||||
|
||||
}//end print_fail()
|
||||
|
||||
|
||||
function print_warn($msg) {
|
||||
global $console_color;
|
||||
print $console_color->convert("%y[WARN]%n %W$msg\n");
|
||||
echo "[WARN] $msg\n";
|
||||
|
||||
}//end print_warn()
|
||||
|
Reference in New Issue
Block a user