NDOUtils 1.47b ca not update the nagios database


#1

Hi people!

I’ve installed Nagios 3.0.2 on my Debian 4. I also installed NDOUtils 1.4b7.
The problem is related with NDOUtils. I can not populate the nagios database. I followed all steps and rechecked everything. According to my search, probably there is a bug. (Not sure). I also found some topics here, but nothing helped.

I just found people asking for some help, sometimes I got useful hints, but I did not find the root cause of my problem.
I’ve tried several things, but did not work.

  • I could connect to the nagios database using the user nagios and its password. I checked the files to make sure that it is with the correct user, password and database name.
  • I checked the owner (user) and group that the files belong to (nagios:nagios).
  • I checked the permitions of the files
  • I tried to use both TCP and unix in the socket_type and got the same error.
  • I just stoped nagios and NDOUtils. I started the NDOUtils and then nagios. Did not work
  • I got no errors in the installation.

I really appreciate any help.


Below, the last part of the Nagios log:

1220472069] ndomod: Error writing to data sink! Some output may get lost…
[1220472085] ndomod: Successfully reconnected to data sink! 0 items lost, 84 queued items to flush.
[1220472085] ndomod: Successfully flushed 84 queued items to data sink.
[1220472085] ndomod: Error writing to data sink! Some output may get lost…
[1220472101] ndomod: Successfully reconnected to data sink! 0 items lost, 80 queued items to flush.
[1220472101] ndomod: Successfully flushed 80 queued items to data sink.
[1220472101] ndomod: Error writing to data sink! Some output may get lost…
[1220472117] ndomod: Successfully reconnected to data sink! 0 items lost, 80 queued items to flush.
[1220472117] ndomod: Successfully flushed 80 queued items to data sink.
[1220472117] ndomod: Error writing to data sink! Some output may get lost…


Below, the file ndo2db.cfg

ndo2db_user=nagios
ndo2db_group=nagios

socket_type=unix
#socket_type=tcp

socket_name=/usr/local/nagios/var/ndo.sock

tcp_port=5668

db_servertype=mysql

db_host=localhost

db_port=3306

db_name=nagios

db_prefix=nagios_

db_user=nagios

db_pass=nagios

max_timedevents_age=1440

max_systemcommands_age=10080

max_servicechecks_age=10080

max_hostchecks_age=10080

max_eventhandlers_age=44640


Below, the ndomod.cfg

instance_name=default

output_type=unixsocket

output=/usr/local/nagios/var/ndo.sock

tcp_port=5668

output_buffer_items=5000

buffer_file=/usr/local/nagios/var/ndomod.tmp

file_rotation_interval=14400

file_rotation_timeout=60

reconnect_interval=15

reconnect_warning_interval=15

data_processing_options=-1

config_output_options=2


And below, part of nagios.cfg

event_broker_options=-1

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


To initialize the NDOUtils service I just use:
/usr/local/nagios/bin/ndo2db-3x -c /usr/local/nagios/etc/ndo2db.cfg (it starts normaly)

Thanks in advance.


#2

Hi again!

I found and solved the problem… I just remade everything and when I was creating the files to compile, using ./configure, I saw that there were some statements with “no”. The list is shown below:

checking ltdl.h usability… no
checking ltdl.h presence… no
checking socket.h usability… no
checking socket.h presence… no
checking tcpd.h usability… no
checking tcpd.h presence… no
checking for socket in -lsocket… no
checking for main in -lwrap… no
checking for mysql_connect in -lmysqlclient… no

To solve it, I installed the following libs using apt-get:

libltdl3-dev
libmysqlclient15-dev
libwrap0-dev

I deleted the files and created it again using ./configure
For now, there are still errors (“no” statements) on my output. Before I was having problems with tcpd.h and socket.h. Now I have only the socket error, as you can see below:

checking socket.h usability… no
checking socket.h presence… no
checking for socket.h… no
checking for mysql_connect in -lmysqlclient… no

the problem above to connect to lmysqlclient is because it uses socket to connect. All I did was to change the ndo2db.cfg and ndomod.cfg within /usr/local/nagios/etc/ to use tcp in socket_type.

It works!!!

Notice that I am still not able to use unix in socket_type due the problem when generating the files. (did not find socket.h)

I found the socket.h on my debian in the following locations:

/usr/include/asm-x86_64/socket.h
/usr/include/sys/socket.h
/usr/include/asm/socket.h
/usr/include/linux/socket.h
/usr/include/bits/socket.h
/usr/include/asm-i486/socket.h

Using diff, I see that all files are different from each other so I just left it as it is. If you know some lib that contains the socket.h or if you know how can I do to NDO find it, I appreciate. Anyway, now it is working under tcp socket_type.

My hint is:

Take a look on the ./configure output. If there is any “no”, find the lib, install it and issue again ./configure.

Regards,