nagios
Linux

Database backend (ndo2db) not runnung

You connect to the Nagios console and you see that the database backend (ndo2db) is not running :

ndo2db
ndo2db

You try to run the service but still not running. In this article you will lean how to start database backend in case of an error.

Try to start the ndo2db service

First, try to start database backend service, so connect to the Nagios server and run the command below :

[root@nagios ~]# systemctl start ndo2db

Check the service status. If the service is note runing like the output bellow, dont worry, go to the next step :

[root@nagios ~]# systemctl status ndo2db
● ndo2db.service - Nagios Data Out Daemon
   Loaded: loaded (/usr/lib/systemd/system/ndo2db.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2023-03-16 11:13:55 UTC; 3s ago
     Docs: http://www.nagios.org/documentation
  Process: 10456 ExecStopPost=/bin/rm -f /usr/local/nagios/var/ndo2db.pid (code=exited, status=0/SUCCESS)
  Process: 60345 ExecStart=/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f (code=exited, status=1/FAILURE)
 Main PID: 10456 (code=exited, status=1/FAILURE)

Steps to start database backend service

1- Stop nagios service :

# systemctl stop nagios

2- In the directory /usr/local/nagios/var/ you should find these two lock file :

/usr/local/nagios/var/ndo2db.lock
/usr/local/nagios/var/ndo.sock

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

[root@nagios ~]# mv /usr/local/nagios/var/ndo2db.lock /usr/local/nagios/var/ndo2db.lock.bak
[root@nagios ~]# mv /usr/local/nagios/var/ndo.sock /usr/local/nagios/var/ndo.sock.bak

4- Thereafter, start nagios and ndo2db services :

[root@nagios ~]# systemctl status nagios
● nagios.service - LSB: Starts and stops the Nagios monitoring server
   Loaded: loaded (/etc/rc.d/init.d/nagios; bad; vendor preset: disabled)
   Active: active (running) since Thu 2023-03-16 11:21:45 UTC; 4h 16min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 70382 ExecStop=/etc/rc.d/init.d/nagios stop (code=exited, status=0/SUCCESS)
  Process: 70394 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=0/SUCCESS)
 Main PID: 70417 (nagios)
[root@nagios ~]# systemctl status ndo2db
● ndo2db.service - Nagios Data Out Daemon
   Loaded: loaded (/usr/lib/systemd/system/ndo2db.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2023-03-16 11:16:34 UTC; 4h 24min ago
     Docs: http://www.nagios.org/documentation
  Process: 60347 ExecStopPost=/bin/rm -f /usr/local/nagios/var/ndo2db.pid (code=exited, status=0/SUCCESS)
 Main PID: 62266 (ndo2db)
   CGroup: /system.slice/ndo2db.service
           ├─62266 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f
           ├─70432 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f
           └─70433 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f

You should see the red exclamation change in the web status as well :

And this is it!

Click here to see How to install NRPE on CentOS/RHEL

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *