Nagios 5.5.2 - Issue offloading DB

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lramirez
Posts: 5
Joined: Wed Aug 01, 2018 2:33 am

Nagios 5.5.2 - Issue offloading DB

Post 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) :roll:

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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios 5.5.2 - Issue offloading DB

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
lramirez
Posts: 5
Joined: Wed Aug 01, 2018 2:33 am

Re: Nagios 5.5.2 - Issue offloading DB

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios 5.5.2 - Issue offloading DB

Post 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>
Be sure to check out our Knowledgebase for helpful articles and solutions!
lramirez
Posts: 5
Joined: Wed Aug 01, 2018 2:33 am

Re: Nagios 5.5.2 - Issue offloading DB

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios 5.5.2 - Issue offloading DB

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios 5.5.2 - Issue offloading DB

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
lramirez
Posts: 5
Joined: Wed Aug 01, 2018 2:33 am

Re: Nagios 5.5.2 - Issue offloading DB

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios 5.5.2 - Issue offloading DB

Post 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:

Code: Select all

"dbserver" => '127.0.0.1:6446',
Hope this helps.
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
lramirez
Posts: 5
Joined: Wed Aug 01, 2018 2:33 am

Re: Nagios 5.5.2 - Issue offloading DB

Post 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
Locked