Page 1 of 2
Nagios 5.5.2 - Issue offloading DB
Posted: Wed Aug 01, 2018 2:42 am
by lramirez
I've followed the guide to offload the DB to an external DB but fails in the last step before restart the deamons (page 13)
Edit settings.php
The /var/www/html/nagiosql/config/settings.php file needs to be updated, for safety reasons its
a good idea to make a backup first:
cd /var/www/html/nagiosql/config/
How we can solve this issue?
Br
Luis
Re: Nagios 5.5.2 - Issue offloading DB
Posted: Wed Aug 01, 2018 11:40 am
by lmiltchev
I've followed the guide to offload the DB to an external DB but fails in the last step before restart the deamons (page 13)
How exactly does it fail? Can you elaborate on this? Are you missing the "/var/www/html/nagiosql/config/settings.php" file? It's been removed in the later versions of Nagios XI, so you can skip the steps on page 13, and proceed to the next page.
Re: Nagios 5.5.2 - Issue offloading DB
Posted: Thu Aug 02, 2018 3:23 am
by lramirez
Yes, i cannot find the file "/var/www/html/nagiosql/config/settings.php". So i've skiped this point and continue with the stop & start the deamon. But Nagios is not able to connect to the DB.
I've verified this file:
/usr/local/nagiosxi/etc/components/ccm_config.inc.php
And the values (users, passwords & DB port) in the settings are not the same that i put on the config files.
Br
Luis
Re: Nagios 5.5.2 - Issue offloading DB
Posted: Thu Aug 02, 2018 9:38 am
by lmiltchev
In the
/usr/local/nagiosxi/etc/components/ccm_config.inc.php file you should see the data, related to the nagiosql db, whatever you specified in
/usr/local/nagiosxi/html/config.inc.php.
Example:
Code: Select all
// MySQL database connection info
$CFG["db"] = array(
"server" => "x.x.x.x",
"port" => "3306",
"database" => "nagiosql",
"username" => "nagiosql",
"password" => "nagiosql"
);
The port should be 3306, unless you specified a different (custom) port.
Can you go through ALL of the steps, outlined in the document below to make sure you didn't miss a step?
https://assets.nagios.com/downloads/nag ... Server.pdf
Can you successfully execute the "test db" commands?
Code: Select all
echo 'STATUS;' | mysql -u nagios -p'nagios' -h <IP_ADDRESS_OF_MYSQL_OR_MARIADB_SERVER>
echo 'STATUS;' | mysql -u nagiosql -p'nagiosql' -h <IP_ADDRESS_OF_MYSQL_OR_MARIADB_SERVER>
echo 'STATUS;' | mysql -u nagiosxi -p'nagiosxi' -h <IP_ADDRESS_OF_MYSQL_OR_MARIADB _SERVER>
Re: Nagios 5.5.2 - Issue offloading DB
Posted: Mon Aug 06, 2018 3:07 am
by lramirez
The content in the files is not the same... I've modified the port ant the users and passwd, but in the second file i cannot see these values.
/usr/local/nagiosxi/etc/components/ccm_config.inc.php - /usr/local/nagiosxi/html/config.inc.php.
The connection with the DB is working properly.
Br
Luis
Re: Nagios 5.5.2 - Issue offloading DB
Posted: Mon Aug 06, 2018 2:08 pm
by lmiltchev
Run the following commands on the Nagios XI server:
Code: Select all
service ndo2db restart
service nagios restart
then zip up the following files:
Code: Select all
/usr/local/nagios/etc/ndo2db.cfg
/usr/local/nagiosxi/html/config.inc.php
/usr/local/nagiosxi/etc/components/ccm_config.inc.php
and send them to me via a PM.
Re: Nagios 5.5.2 - Issue offloading DB
Posted: Tue Aug 07, 2018 9:09 am
by lmiltchev
In all of the places, where you need to specify the IP address of the offloaded MySQL server, you have 127.0.0.1... Please enter the correct IP address, restart the daemons and try again.
The easiest thing to do is to just follow our documentation closely.
Re: Nagios 5.5.2 - Issue offloading DB
Posted: Tue Aug 07, 2018 9:14 am
by lramirez
Hi,
The IP address is right... It's a InnoDB cluster with mysqlproxy on the local servers in the 6446 & 6447 ports.
Br
Luis
Re: Nagios 5.5.2 - Issue offloading DB
Posted: Tue Aug 07, 2018 9:44 am
by lmiltchev
According to
our documentation, you would need to specify the port in the config.inc.php file (if you are not using the default port).
example01.PNG
Try using:
Hope this helps.
Re: Nagios 5.5.2 - Issue offloading DB
Posted: Wed Aug 08, 2018 7:41 am
by lramirez
Done!
I've added the port in the config file and also modify the DB users to use mysql native authentication. Thank you very much.
Br
Luis