Migrating postgres to MySQL issue!

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Migrating postgres to MySQL issue!

Post by BanditBBS »

Ok, I am following these steps: https://support.nagios.com/kb/article.php?id=560

I am to the part of testing the connection. NagiosXI can't seem to connect to the new mysql database. My DB is offloaded so I did modify the instructions slightly for this case but am having issues

As you can see, I can connect from the NagiosXI server:

Code: Select all

[nagios@iss-chi-nag05 html]$ mysql -h xxx.xxx.xxx.xxx -unagiosxi -pn@gweb
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2945
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
But, when I change the information in config.inc.php NagiosXI can't connect:

Code: Select all

        "nagiosxi" => array(
                "dbtype" => 'mysql',
                "dbserver" => 'xxx.xxx.xxx.xxx',
                "user" => 'nagiosxi',
                "pwd" => 'n@gweb',
                "db" => 'nagiosxi',
                "dbmaint" => array(             // variables affecting maintenance of db
                        "max_auditlog_age" => 30, // max time (in DAYS) to keep audit log entries
                        "max_commands_age" => 480, // max time (minutes) to keep commands
                        "max_events_age" => 480, // max time (minutes) to keep events
                        "optimize_interval" => 60, // time (in minutes) between db optimization runs
                        "repair_interval" => 0, // time (in minutes) between db repair runs
                        ),
                ),
        "ndoutils" => array(
                "dbtype" => 'mysql',
                "dbserver" => 'xxx.xxx.xxx.xxx',
                "user" => 'nagios',
                "pwd" => 'nagios',
                "db" => 'nagios',
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Migrating postgres to MySQL issue!

Post by tgriep »

Run this command to see if you can view the MYSQL tables in the offloaded nagiosxi database.

Code: Select all

echo 'show tables;' | mysql -h xxx.xxx.xxx.xxx -u nagiosxi -pn@gweb --database nagiosxi
If you see the tables, lets see if you can view the xi_users table. Run this

Code: Select all

echo 'select * from xi_users;' | mysql -h xxx.xxx.xxx.xxx -u nagiosxi -pn@gweb --database nagiosxi
What sort of errors are you seeing?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Migrating postgres to MySQL issue!

Post by BanditBBS »

Yes, both commands work fine, not going to paste the output of the showing the users table for security reasons of course ;)

nagios saying "Can't connect to database, try running repair database script"

Wasn't worded that way exactly, but that is the gist.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Migrating postgres to MySQL issue!

Post by tgriep »

When you go to the Web address for the GUI, does it display the login menu and does it allow you to login?

Is that when you are seeing the error message?

Do you see any errors in the Apache log files in the /var/log/httpd folder, if so, post them here.

When you change the settings in the config.inc.php file, you you stop all of the processes and start them up again to the change can take effect?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Migrating postgres to MySQL issue!

Post by BanditBBS »

OMG! I went to do it again to get exact error for you and its now working. I don't know what's going on anymore. Thanks for trying and feel free to close this!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Migrating postgres to MySQL issue!

Post by tgriep »

We all have one of those days where the magic happens. Glad it is working so I'll lock the ticket.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked