Page 1 of 1
Database connection error in Nagios XI
Posted: Tue Nov 17, 2015 2:56 pm
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
Re: Database connection error in Nagios XI
Posted: Tue Nov 17, 2015 3:00 pm
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
Re: Database connection error in Nagios XI
Posted: Tue Nov 17, 2015 3:51 pm
by bsivavani
Yes. I tried but still it is throwing same error.
Re: Database connection error in Nagios XI
Posted: Tue Nov 17, 2015 5:06 pm
by hsmith
How are you doing on disk space?
Re: Database connection error in Nagios XI
Posted: Tue Nov 17, 2015 5:54 pm
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]#
Re: Database connection error in Nagios XI
Posted: Tue Nov 17, 2015 10:37 pm
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
Re: Database connection error in Nagios XI
Posted: Thu Nov 19, 2015 9:24 am
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.
Re: Database connection error in Nagios XI
Posted: Thu Nov 19, 2015 10:45 am
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.
Can you run this and post the output here?
Thanks
Re: Database connection error in Nagios XI
Posted: Thu Nov 19, 2015 1:44 pm
by bsivavani
Thanks. I am able to login now.
Re: Database connection error in Nagios XI
Posted: Thu Nov 19, 2015 2:00 pm
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.