Error: Could not load module '/usr/local/nagios/bin/ndo2db'

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
ridder75
Posts: 15
Joined: Thu Dec 13, 2012 10:38 am

Error: Could not load module '/usr/local/nagios/bin/ndo2db'

Post by ridder75 »

Hi,

I've got problem in nagios log :

Error: Could not load module '/usr/local/nagios/bin/ndo2db' -> file not found

How can i solve this problem please?

For information, i have this information in Configuration ==> Nagios ==> nagios.cfg :

/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg

Thanks for your help.

Raph :-)
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Error: Could not load module '/usr/local/nagios/bin/ndo2

Post by sreinhardt »

Are you using ndoutils with your nagios installation? If so could you verify that ndo2db is actually located in /usr/local/nagios/bin/. If it is not try a:

Code: Select all

locate ndo2db
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
ridder75
Posts: 15
Joined: Thu Dec 13, 2012 10:38 am

Re: Error: Could not load module '/usr/local/nagios/bin/ndo2

Post by ridder75 »

Hi,

I don't know but i hope, for information :

[root@xxxxxxxxxxxxxxx ~]# cd /usr/local/nagios/bin/
[root@xxxxxxxxxxxxxxx bin]# ll
total 1348
-rwxrwxr--. 1 nagios nagios 627940 17 déc. 13:54 nagios
-rwxrwxr--. 1 nagios nagios 43016 17 déc. 13:54 nagiostats
-rwxrwxr--. 1 nagios nagios 270127 13 déc. 16:27 ndo2db
-rwxrwxr--. 1 nagios nagios 270111 10 juin 2012 ndomo2db
-rwxr-xr--. 1 root root 1347 17 déc. 15:22 ndomod.cfg
-rwxrwxr--. 1 nagios nagios 156712 13 déc. 16:26 ndomod.o

[root@xxxxxxxxxxxxxxx ~]# locate ndo2db
/etc/alternatives/ndo2db
/etc/nagios/ndo2db.cfg
/etc/rc.d/init.d/ndo2db
/etc/rc.d/rc0.d/K74ndo2db
/etc/rc.d/rc1.d/K74ndo2db
/etc/rc.d/rc2.d/K74ndo2db
/etc/rc.d/rc3.d/K74ndo2db
/etc/rc.d/rc4.d/K74ndo2db
/etc/rc.d/rc5.d/K74ndo2db
/etc/rc.d/rc6.d/K74ndo2db
/home/raphael/Téléchargements/centreon-2.3.8/www/include/configuration/configNdo2db/ndo2db.php
/home/raphael/Téléchargements/centreon-2.3.9/www/include/configuration/configNdo2db/ndo2db.php
/home/raphael/Téléchargements/ndoutils-1.5.2/config/ndo2db.cfg-sample
/home/raphael/Téléchargements/ndoutils-1.5.2/config/ndo2db.cfg-sample.in
/home/raphael/Téléchargements/ndoutils-1.5.2/include/ndo2db.h
/home/raphael/Téléchargements/ndoutils-1.5.2/src/ndo2db-2x
/home/raphael/Téléchargements/ndoutils-1.5.2/src/ndo2db-3x
/home/raphael/Téléchargements/ndoutils-1.5.2/src/ndo2db.c
/usr/local/centreon/filesGeneration/nagiosCFG/1/ndo2db.cfg
/usr/local/centreon/filesGeneration/nagiosCFG/2/ndo2db.cfg
/usr/local/centreon/www/include/configuration/configNdo2db/ndo2db.php
/usr/local/nagios/bin/ndo2db
/usr/local/nagios/etc/ndo2db.cfg
/usr/sbin/ndo2db
/usr/sbin/ndo2db.mysql
/var/lib/alternatives/ndo2db
/var/lib/mysql/centreon/cfg_ndo2db.frm
/var/log/ndoutils/ndo2db.debug

Thanks.

Raph :-)
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Error: Could not load module '/usr/local/nagios/bin/ndo2

Post by sreinhardt »

OK, let's try a couple things. First alter the line in your config

Code: Select all

/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
To:

Code: Select all

broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
The stop nagios service, start ndo2db service, and restart nagios service again:

Code: Select all

service nagios stop; service ndo2db start; service nagios start
Let me know how that starts working for you. What is happening, or so it seems, is that you want to start nagios with the ndomod module so that it can correctly interface with ndo2db, then the ndo2db application is actually a daemon all on its own.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
ridder75
Posts: 15
Joined: Thu Dec 13, 2012 10:38 am

Re: Error: Could not load module '/usr/local/nagios/bin/ndo2

Post by ridder75 »

Hi,

Manipulations :

Multiple Broker Module
This directive can be used multiple times, see nagios documentation.
NDO use the broker module directive.

Configuration Nagios nagios.cfg :

/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg

[root@xxxxxxxxxxxxxxx ~]# service nagios stop; service ndo2db start; service nagios start
Stopping nagios (via systemctl): [ OK ]
Starting ndo2db (via systemctl): [ OK ]
Starting nagios (via systemctl): [ OK ]


I've got the same error :

[18-12-2012 17:39:07] Finished daemonizing... (New PID=10105)
[18-12-2012 17:39:07] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[18-12-2012 17:39:07] ndomod: Could not open data sink! I'll keep trying, but some output may get lost...
[18-12-2012 17:39:07] ndomod: NDOMOD 1.5.2 (06-08-2012) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[18-12-2012 17:39:07] LOG VERSION: 2.0
[18-12-2012 17:39:07] Local time is Tue Dec 18 17:39:07 CET 2012
[18-12-2012 17:39:07] Nagios 3.4.3 starting... (PID=10104)
[18-12-2012 17:39:06] Event broker module '/usr/local/nagios/bin/ndomod.o' deinitialized successfully.
[18-12-2012 17:39:06] ndomod: Shutdown complete.
[18-12-2012 17:39:06] Successfully shutdown... (PID=9887)
[18-12-2012 17:39:06] Caught SIGTERM, shutting down...

Thanks.

Raph :-)
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Error: Could not load module '/usr/local/nagios/bin/ndo2

Post by mguthrie »

Just to rule this out a type, do you have the "broker_module" directive before your ndo path?

Code: Select all

broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
ridder75
Posts: 15
Joined: Thu Dec 13, 2012 10:38 am

Re: Error: Could not load module '/usr/local/nagios/bin/ndo2

Post by ridder75 »

Hi,

I typed exactly this in Centreon 2.3.9 :

Configuration ==> Nagios ==> nagios.cfg ==> Data :

Section broker module :

broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg

And i made :

Configuration ==> Nagios ==> Actions :

Generate Configuration Files Include Comments
Run Nagios debug (-v)
Move Export Files
Restart Nagios
Export

Result ==> http://xxx.xxx.xxx.xxx/nagios/cgi-bin/showlog.cgi :

File: /usr/local/nagios/var/nagios.log

[20-12-2012 16:30:40] Finished daemonizing... (New PID=23120)
[20-12-2012 16:30:40] Error: Failed to safely copy module 'broker_module=/usr/local/nagios/bin/ndomod.o'. The module will not be loaded
[20-12-2012 16:30:40] Error: Unable to open file 'broker_module=/usr/local/nagios/bin/ndomod.o' for reading: No such file or directory
[20-12-2012 16:30:40] LOG VERSION: 2.0
[20-12-2012 16:30:40] Local time is Thu Dec 20 16:30:40 CET 2012
[20-12-2012 16:30:40] Nagios 3.4.3 starting... (PID=23119)
[20-12-2012 16:30:38] Successfully shutdown... (PID=1709)
[20-12-2012 16:30:38] Caught SIGTERM, shutting down...

I don't understand what did it happen :-(

Thanks

Raph :-)
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Error: Could not load module '/usr/local/nagios/bin/ndo2

Post by sreinhardt »

Let's check the permissions for directories above where ndomod.o is. Please run the following commands and send us output. At this point it might seem that permissions are limited somewhere in parent folder.

Code: Select all

ls -lv /usr | grep local
ls -lv /usr/local | grep nagios
ls -lv /usr/local/nagios
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
ridder75
Posts: 15
Joined: Thu Dec 13, 2012 10:38 am

Re: Error: Could not load module '/usr/local/nagios/bin/ndo2

Post by ridder75 »

Hi,

[root@xxxxxxxxxxx /]# ls -lv /usr | grep local
drwxr-xr-x. 13 root root 4096 10 juin 2012 local

[root@xxxxxxxxxxx /]# ls -lv /usr/local | grep nagios
drwxrwxr-x. 13 nagios nagios 4096 10 juin 2012 centreon
drwxr-xr-x. 9 nagios nagcmd 4096 8 juin 2012 nagios

[root@xxxxxxxxxxx /]# ls -lv /usr/local/nagios
total 28
drwxrwxr-x. 2 nagios nagios 4096 17 déc. 15:22 bin
drwxrwxr-x. 3 nagios nagios 4096 19 déc. 15:00 etc
drwxr-xr-x. 2 nagios nagcmd 4096 8 juin 2012 include
drwxrwxr-x. 5 nagios nagios 4096 20 déc. 10:35 libexec
drwxrwxr-x. 2 nagios nagios 4096 17 déc. 13:54 sbin
drwxrwxr-x. 11 nagios nagios 4096 17 déc. 13:54 share
drwxrwxr-x. 5 nagios nagios 4096 7 janv. 10:24 var

Thanks for your help.

Raph :-)
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Error: Could not load module '/usr/local/nagios/bin/ndo2

Post by sreinhardt »

OK, looks like permissions are fine. Something I found for someone else last week or so, is that we don't actually want to be calling ndo2db from nagios.cfg as if it were calling an executable, but instead need to inform nagios to load it as a module. Try adding the following line to your config in place of the ndo2db -c .../ndo2db.cfg line:

Code: Select all

broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
Then run the commands to stop and start both processes:

Code: Select all

service nagios stop
service ndo2db restart
service nagios start
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked