Database Backend Error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nelsonw
Posts: 64
Joined: Wed Feb 22, 2017 4:03 am

Database Backend Error

Post by nelsonw »

The "Database Backend" status on "System Component Status" is alternating between green and red status.

When red, the error message is "ndo2db.service. Failed with result 'exit-code'
nelsonw
Posts: 64
Joined: Wed Feb 22, 2017 4:03 am

Re: Database Backend Error

Post by nelsonw »

Hi,

Some context on this.
I have recently migrated my NagiosXI instance from CentOS to Ubuntu server. The "Database Backend" error is being reported on the new Ubuntu server.

When checking the status of ndo2db, I get
$ service ndo2db status
● ndo2db.service - Nagios Data Out Daemon
Loaded: loaded (/lib/systemd/system/ndo2db.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-08-07 13:47:23 GMT; 59min ago
Docs: http://www.nagios.org/documentation
Process: 1298 ExecStopPost=/bin/rm -f /usr/local/nagios/var/ndo2db.lock (code=exited, status=0/SUCCESS)
Process: 1286 ExecStart=/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f (code=exited, status=127)
Process: 1285 ExecStartPre=/bin/rm -f /usr/local/nagios/var/ndo.sock (code=exited, status=0/SUCCESS)
Process: 1275 ExecStartPre=/bin/rm -f /usr/local/nagios/var/ndo2db.lock (code=exited, status=0/SUCCESS)
Main PID: 1286 (code=exited, status=127)

Aug 07 13:47:23 <my IP> ndo2db[1286]: /usr/local/nagios/bin/ndo2db: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

I found the article, https://support.nagios.com/forum/viewto ... 4&start=40, reporting the same error.
It recommends I recompile all the binaries on the new server.

The issue is I do not have a /tmp/nagiosxi/subcomponents directory, as the installation was built from restoring the version from the CentOS server. Please advise how I can recompile the libraries on the new Ubuntu server
nelsonw
Posts: 64
Joined: Wed Feb 22, 2017 4:03 am

Re: Database Backend Error

Post by nelsonw »

Hi,

From the "Restore & Backup" article, I ran the following

cd /tmp/
wget https://assets.nagios.com/downloads/nag ... _repair.sh
chmod +x restore_repair.sh
./restore_repair.sh

This then created the /tmp/nagiosxi/subcomponents directory.

I ran ./install but got the following error


db.c: In function ‘ndo2db_db_get_latest_data_time’:
db.c:565:14: error: ‘ndo2db_dbconninfo {aka struct ndo2db_dbconninfo_struct}’ has no member named ‘mysql_result’
idi->dbinfo.mysql_result=mysql_store_result(&idi->dbinfo.mysql_conn);
^
db.c:565:59: error: ‘ndo2db_dbconninfo {aka struct ndo2db_dbconninfo_struct}’ has no member named ‘mysql_conn’
idi->dbinfo.mysql_result=mysql_store_result(&idi->dbinfo.mysql_conn);
^
db.c:566:18: error: ‘ndo2db_dbconninfo {aka struct ndo2db_dbconninfo_struct}’ has no member named ‘mysql_row’
if((idi->dbinfo.mysql_row=mysql_fetch_row(idi->dbinfo.mysql_result))!=NULL){
^
db.c:566:56: error: ‘ndo2db_dbconninfo {aka struct ndo2db_dbconninfo_struct}’ has no member named ‘mysql_result’
if((idi->dbinfo.mysql_row=mysql_fetch_row(idi->dbinfo.mysql_result))!=NULL){
^
db.c:567:53: error: ‘ndo2db_dbconninfo {aka struct ndo2db_dbconninfo_struct}’ has no member named ‘mysql_row’
ndo2db_convert_string_to_unsignedlong(idi->dbinfo.mysql_row[0],t);
^
db.c:569:32: error: ‘ndo2db_dbconninfo {aka struct ndo2db_dbconninfo_struct}’ has no member named ‘mysql_result’
mysql_free_result(idi->dbinfo.mysql_result);
^
db.c:570:14: error: ‘ndo2db_dbconninfo {aka struct ndo2db_dbconninfo_struct}’ has no member named ‘mysql_result’
idi->dbinfo.mysql_result=NULL;
^
Makefile:108: recipe for target 'db.o' failed
make[2]: *** [db.o] Error 1
make[2]: Leaving directory '/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.1.2/src'
Makefile:71: recipe for target 'ndo2db' failed
make[1]: *** [ndo2db] Error 2
make[1]: Leaving directory '/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.1.2/src'
Makefile:74: recipe for target 'all' failed
make: *** [all] Error 2
ERROR: Subcomponent 'ndoutils' installation failed - exiting.


Please can you help.

I think this is similar to my "Upgrade is Failing" ticket that I raised today, in which when I tried to upgrade to the latest Nagios XI version, it failed.
nelsonw
Posts: 64
Joined: Wed Feb 22, 2017 4:03 am

Re: Database Backend Error

Post by nelsonw »

The compilation errors I reported appear to be raised in this case, https://support.nagios.com/forum/viewto ... =7&t=44533

This case points to the article, https://support.nagios.com/kb/article.php?id=406#Ubuntu.

The NagiosXI installation I have is configured for the database to be located on a different server to my NagiosXI instance.

Do I still need to set up MySQL database on my NagiosXI instance, as recommended in https://support.nagios.com/kb/article.php?id=406#Ubuntu


Thanks,
Nelson
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Database Backend Error

Post by scottwilkerson »

You should not be installing ndo2db separate from the Nagios XI installer.
nelsonw wrote:The NagiosXI installation I have is configured for the database to be located on a different server to my NagiosXI instance.

Do I still need to set up MySQL database on my NagiosXI instance, as recommended in https://support.nagios.com/kb/article.php?id=406#Ubuntu
no

I am going to lock this thread and we will continue in your other thread here
https://support.nagios.com/forum/viewto ... 16&t=55074
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked