Offloading Nagios Data Base and use different MySQL Port
Posted: Mon Jun 22, 2015 11:36 am
Hi,
We offloaded the database of one of our XI servers to an external SQL Farm. We followed the oficial document from NagiosXI
https://assets.nagios.com/downloads/nag ... Server.pdf
But, the problem is that the database server is using the port 3308 and not the default 3306.
This is not a problem, but inside /usr/local/nagiosxi/html/config.inc.php there is no line to change it.
“dbtype” => 'mysql',
“dbserver” => '<IP_OF_MYSQL_SERVER>',
“user” => 'nagios',
“pwd” => 'nagios',
“db” => 'nagios
What we did and is working is:
“dbtype” => 'mysql',
“dbserver” => '<IP_OF_MYSQL_SERVER:3308>',
“user” => 'nagios',
“pwd” => 'nagios',
“db” => 'nagios
But now if we go through the config manager --> Config Manager Admin --> Config Manager Settings the information that we can see is:
[nagios@plinag01 scripts]$ vi /usr/local/nagiosxi/etc/components/ccm_config.inc.php
<?php
/** DO NOT MANUALLY EDIT THIS FILE
This file is used internally by Nagios CCM.
Nagios CCM will override this file automatically with the latest settings. */
$CFG["plugins_directory"] = "/usr/local/nagios/libexec";
$CFG["command_file"] = "/usr/local/nagios/var/rw/nagios.cmd";
$CFG["default_language"] = "en_US";
// MySQL database connection info
$CFG["db"] = array(
"server" => "1.1.1.1:3308",
"port" => "3306",
"database" => "nagiosql",
"username" => "nagiosql",
"password" => "xxxxx"
);
Then how we can add the port configuration correctly to the config.inc.phph and ccm_config.inc.php.
Can we add a new line in config.inc.php like “port” => '3308', ?
We offloaded the database of one of our XI servers to an external SQL Farm. We followed the oficial document from NagiosXI
https://assets.nagios.com/downloads/nag ... Server.pdf
But, the problem is that the database server is using the port 3308 and not the default 3306.
This is not a problem, but inside /usr/local/nagiosxi/html/config.inc.php there is no line to change it.
“dbtype” => 'mysql',
“dbserver” => '<IP_OF_MYSQL_SERVER>',
“user” => 'nagios',
“pwd” => 'nagios',
“db” => 'nagios
What we did and is working is:
“dbtype” => 'mysql',
“dbserver” => '<IP_OF_MYSQL_SERVER:3308>',
“user” => 'nagios',
“pwd” => 'nagios',
“db” => 'nagios
But now if we go through the config manager --> Config Manager Admin --> Config Manager Settings the information that we can see is:
[nagios@plinag01 scripts]$ vi /usr/local/nagiosxi/etc/components/ccm_config.inc.php
<?php
/** DO NOT MANUALLY EDIT THIS FILE
This file is used internally by Nagios CCM.
Nagios CCM will override this file automatically with the latest settings. */
$CFG["plugins_directory"] = "/usr/local/nagios/libexec";
$CFG["command_file"] = "/usr/local/nagios/var/rw/nagios.cmd";
$CFG["default_language"] = "en_US";
// MySQL database connection info
$CFG["db"] = array(
"server" => "1.1.1.1:3308",
"port" => "3306",
"database" => "nagiosql",
"username" => "nagiosql",
"password" => "xxxxx"
);
Then how we can add the port configuration correctly to the config.inc.phph and ccm_config.inc.php.
Can we add a new line in config.inc.php like “port” => '3308', ?