Database connection error in Nagios XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Database connection error in Nagios XI

Post by bsivavani »

Hi Team,

I am getting below error while opening Nagios XI url

Message: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.

Run the following from the CLI as root to attempt to repair the DB

/usr/local/nagiosxi/scripts/repair_databases.sh

Please let me know what might be the causing of this issue.


Thanks,
Siva vani
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Database connection error in Nagios XI

Post by hsmith »

It looks like you have crashed tables. Have you tried to run the script that the error is telling you to run?

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh
Former Nagios Employee.
me.
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Database connection error in Nagios XI

Post by bsivavani »

Yes. I tried but still it is throwing same error.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Database connection error in Nagios XI

Post by hsmith »

How are you doing on disk space?

Code: Select all

df -h
df -ih
Former Nagios Employee.
me.
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Database connection error in Nagios XI

Post by bsivavani »

[root@aushosnagpoc00 log]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_aushosnagpoc00-lv_root
44G 40G 3.5G 92% /
tmpfs 2.9G 0 2.9G 0% /dev/shm
/dev/sda1 477M 94M 359M 21% /boot
[root@aushosnagpoc00 log]#

[root@aushosnagpoc00 log]# df -ih
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/vg_aushosnagpoc00-lv_root
2.8M 1.3M 1.6M 45% /
tmpfs 732K 1 732K 1% /dev/shm
/dev/sda1 126K 53 125K 1% /boot
[root@aushosnagpoc00 log]#
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Database connection error in Nagios XI

Post by Box293 »

Yes it looks like you are running very low on disk space.

When doing database repairs, sometimes a large table requires 2-3 times the size of the table to be available to complete the repair.

You'll need to resolve your disk space issue before proceeding.

This guide will help, keep in mind you're volume names will be different to what is mentioned in the document:

http://assets.nagios.com/downloads/nagi ... M_Disk.pdf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Database connection error in Nagios XI

Post by bsivavani »

Thanks for the update, but receiving same error even after free up the space.

[root@aushosnagpoc00 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_aushosnagpoc00-lv_root
44G 18G 26G 42% /
tmpfs 2.9G 0 2.9G 0% /dev/shm
/dev/sda1 477M 94M 359M 21% /boot
[root@aushosnagpoc00 ~]#

--------------------------------------------------------------------------------------
Below is output of repair script.

===============
REPAIR COMPLETE
===============
Stopping ndo2db: head: cannot open `/usr/local/nagios/var/ndo2db.lock' for reading: No such file or directory
done.
Starting ndo2db: done.
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.


Not sure where it is blocking us to login on to Nagios.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Database connection error in Nagios XI

Post by tgriep »

It could be that the postgres database may be down which could cause that error. Try running this as root and see if that resolves your issue.

Code: Select all

service postgresql restart
Can you run this and post the output here?

Code: Select all

ps -ef
Thanks
Be sure to check out our Knowledgebase for helpful articles and solutions!
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Database connection error in Nagios XI

Post by bsivavani »

Thanks. I am able to login now.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Database connection error in Nagios XI

Post by rkennedy »

Glad to see this is working now! I will now close this thread out, but feel free to open another if you ever need assistance.
Former Nagios Employee
Locked