Nagios – ndo2db not running

Nagios – ndo2db not running

Your Nagios server was shutoff unexpectedly and now you see the “database backend” with a red exclamation in the web GUI. The only thing you can do is try to start the process, but it comes back with ndo2db is not running.

ndo2db not running database backend not running

Fortunately, the fix is pretty simple. Feel free to copy/paste the commands to avoid typos. Just make sure you omit the ‘#’ on each command otherwise the command won’t run. Assuming you have already tried restarting the ndo2db service, go to the command-line and verify it is not running.

# service ndo2db status
ndo2db is not running

Still on the command-line, stop the nagios service so you don’t mess anything else up in the process.

# service nagios stop

Run the ‘ls’ command and you should see something similar to what is below (minus the dates of course).

# ls -l /usr/local/nagios/var/ndo*
-rw-r--r-- 1 nagios nagios 0 Oct 18 09:02 /usr/local/nagios/var/ndo2db.debug
-rw-r--r-- 1 nagios nagios 6 Oct 23 10:13 /usr/local/nagios/var/ndo2db.lock
-rw-r--r-- 1 nagios nagios 0 Nov 12 12:43 /usr/local/nagios/var/ndomod.tmp
srwxr-xr-x 1 nagios nagios 0 Oct 23 10:13 /usr/local/nagios/var/ndo.sock

Now rename/move the two files using the commands below.

# mv /usr/local/nagios/var/ndo2db.lock /usr/local/nagios/var/ndo2db.lock.bak
# mv /usr/local/nagios/var/ndo.sock /usr/local/nagios/var/ndo.sock.bak

Now, just restart your nagios service and ndo2db service using the commands below.

# service nagios start
# service ndo2db start

Run the service status command to verify it is now running. You should see the red exclamation change in the web status as well. Voila!

# service ndo2db status
ndo2db (pid 3047) is running...

Dallas Haselhorst has worked as an IT and information security consultant for over 20 years. During that time, he has owned his own businesses and worked with companies in numerous industries. Dallas holds several industry certifications and when not working or tinkering in tech, he may be found attempting to mold his daughters into card carrying nerds and organizing BSidesKC.

15 thoughts on “Nagios – ndo2db not running

  1. Hello,

    after migration the nagios server from Citrix Xen to ESXi I used this post for reparing the database. Thanks a lot for usefull and simple solution.

    Great!!

  2. Thank you so much! Wasted hours trying various commands etc. at the terminal to no avail, but this just fixed the problem straight away. You’re a legend!!

Leave a Reply

Your email address will not be published.