Page 1 of 1

NDO-3 not starting up right after upgrading to 5.11

Posted: Wed Jun 28, 2023 8:33 am
by GldRush98
I updated my test box this morning to 5.11

Monitoring Engine Status is showing red, even though the Nagios service is running. Checks seem to be running behind the scenes but the whole gui is not updating or showing current events.

Restarting and tailing the nagios.log file I am seeing this:

[1687959033] NDO-3: NDO 3.1.0 (c) Copyright 2009-2023 Nagios - Nagios Core Development Team
[1687959033] NDO-3: Unable to connect to mysql. Configuration may be incorrect or database may have temporarily disconnected.
[1687959033] NDO-3: NDO was not able to initialize the database (main context) and will not start.

I don't believe anything has been customized re: the db on this system. It's a pretty stock clean install used for testing.
Mariadb is running and appears fine. I can show databases and tables in it and looks right...

Re: NDO-3 not starting up right after upgrading to 5.11

Posted: Wed Jun 28, 2023 9:01 am
by GldRush98
Got it.

The ndo.cfg file got mangled:

Code: Select all

[root@nagios etc]# cat ndo.cfg
# Default NDO config for Nagios XI

db_user=ndoutils
db_pass=n@gweb
db_name=nagios
db_host=localhost
db_port=3306
#db_socket=/var/lib/mysql.sock
db_max_reconnect_attempts=5

acknowledgement_data=1
comment_data=1
contact_status_data=1
downtime_data=1
event_handler_data=1
external_command_data=1
flapping_data=1
host_check_data=0
host_status_data=1
log_data=1
main_config_data=1
notification_data=1
object_config_data=1
process_data=1
program_status_data=1
retention_data=1
service_check_data=0
service_status_data=1
state_change_data=1
system_command_data=1
timed_event_data=1

config_output_options=2

max_object_insert_count=250

mysql_set_charset_name=utf8downtime_history_data=0
comment_history_data=0
There is a missing carriage return to the 2 lines the were added to the ndo.cfg file.
In case anyone else has this happen, the bottom 3 lines should look like:

Code: Select all

mysql_set_charset_name=utf8
downtime_history_data=0
comment_history_data=0
Then "systemctl restart nagios" and you should be back in business.

Re: NDO-3 not starting up right after upgrading to 5.11

Posted: Wed Jun 28, 2023 9:16 am
by GldRush98
Heads up, this happened on my Prod box too, same config lines.

I suspect this is going to happen to most everyone going to 5.11.0 :shock:

Re: NDO-3 not starting up right after upgrading to 5.11

Posted: Wed Jun 28, 2023 1:30 pm
by vornado
Before I was able to fix my ndo.cfg file, our help desk restored the dev and DR servers, per my request. I guess I'll re-apply the 5.11.0 update on one of the servers and try this fix. If it works, I'll do the other, if not, I'll just wait for 5.11.1 :D .

Steve

Re: NDO-3 not starting up right after upgrading to 5.11

Posted: Wed Jun 28, 2023 1:31 pm
by MattTheQuick
Just ran into this on our environment as well. Thanks for the clear documentation identifying this issue. We're up and running again now too!

Re: NDO-3 not starting up right after upgrading to 5.11

Posted: Wed Jun 28, 2023 3:32 pm
by GldRush98
I have also found that you can add a blank line to the end of the ndo.cfg file before running the upgrade, and then everything will go off without a hitch.

Re: NDO-3 not starting up right after upgrading to 5.11

Posted: Mon Jul 10, 2023 1:56 pm
by dscrimpsher
Thank you for posting this. Resolved the issue for my system also.