Page 1 of 1

NDO-3: Unable to connect to mysql. after upgrade to 5.8.5

Posted: Sun Jul 25, 2021 10:50 pm
by Darrenh
Hi,
I have upgraded to nagiosxi 5.8.5 and am getting the errors

[1627268014] NDO-3: NDO 3.0.7 (c) Copyright 2009-2020 Nagios - Nagios Core Development Team
[1627268014] NDO-3: Unable to connect to mysql. Configuration may be incorrect or database may have temporarily disconnected.
[1627268014] NDO-3: NDO was not able to initialize the database (main context) and will not start.
[1627268014] Event broker module '/usr/local/nagios/bin/ndo.so' initialized successfully.

I didnt realise the gui was not updateing so went ahead and upgraded cacti, which is on the same server. As part of that process the database was upgraded to mariadb 10.

Now cacti does not work with
FATAL: Connection to Cacti database failed. Please ensure:

the PHP MySQL module is installed and enabled.
the database is running.
the credentials in config.php are valid.

I do not have a checkpoint to go back to as i thought it was working and cleared it. yest, dumb.

All alerts are still working and being emailed, just the GUI is not reflecting any changes. Also I cannot add or delete any clients from the interface, which is not unexpected really.

Any help would be appreciated.
Darren

Re: NDO-3: Unable to connect to mysql. after upgrade to 5.8.

Posted: Mon Jul 26, 2021 11:53 am
by ssax
You will need to reach out to cacti for support for their product but it may be DB user/pass related.

If NDO3 cannot connect to the database, please make sure that this file:

Code: Select all

/usr/local/nagios/etc/ndo.cfg
Matches what you have in /usr/local/nagiosxi/html/config.inc.php for these items and that they are correct for the nagios database:

Code: Select all

db_user=ndoutils
db_pass=n@gweb
db_name=nagios
db_host=localhost
db_port=3306
Then restart nagios:

Code: Select all

systemctl restart nagios
You can check DB connectivity/credentials to the nagios database with this command:

Code: Select all

mysql -h localhost -u'ndoutils' -p'n@gweb' nagios -e "status;"
If that doesn't resolve it, please PM me a copy of your profile.zip, you can download it from Admin > System Profile by clicking the Download Profile button.

If you're unable to generate the the profile through the web interface, please try generating it from the command line by running these commands as root:

Code: Select all

rm -rf /usr/local/nagiosxi/var/components/profile*​​
/usr/local/nagiosxi/scripts/components/getprofile.sh SUPPORT
Then send me the resulting /usr/local/nagiosxi/var/components/profile.zip​ file.​

If the profile script fails, please include the ENTIRE output.

Re: NDO-3: Unable to connect to mysql. after upgrade to 5.8.

Posted: Mon Jul 26, 2021 5:31 pm
by Darrenh
Thanks for the response, the settings are the same in both files and I can connect.
[root@HoVmMon ~]# mysql -h localhost -u'ndoutils' -p'n@gweb' nagios -e "status;"
--------------
mysql Ver 15.1 Distrib 10.6.3-MariaDB, for Linux (x86_64) using readline 5.1

Connection id: 63898
Current database: nagios
Current user: ndoutils@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MariaDB
Server version: 10.6.3-MariaDB MariaDB Server
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb3
Client characterset: utf8mb3
Conn. characterset: utf8mb3
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 21 hours 38 min 11 sec

Threads: 76 Questions: 3042081 Slow queries: 0 Opens: 7381 Open tables: 32 Queries per second avg: 39.055
--------------

I have attached the profile as requested.

Cheers

Moderator's Note: The profile has been shared with the support team but has been removed from the public forum.

Re: NDO-3: Unable to connect to mysql. after upgrade to 5.8.

Posted: Mon Jul 26, 2021 5:48 pm
by Darrenh
Sorry i cannot PM you, it says I am not authorised for PM.

Hopefully you see this message soon. I am keen for your help.

Re: NDO-3: Unable to connect to mysql. after upgrade to 5.8.

Posted: Mon Jul 26, 2021 7:33 pm
by Darrenh
I have created a support ticket for this problem.

Re: NDO-3: Unable to connect to mysql. after upgrade to 5.8.

Posted: Tue Jul 27, 2021 10:06 am
by ssax
Locking thread, ticket received, we will continue support through the ticket.

Thank you!