NDOUtils Problem

Joe Precious JoeP at protronics.co.uk
Mon Apr 7 15:58:44 CEST 2008


This is all starting to get a bit too complex for me!  Anyway, I’ve managed to narrow down the problem a bit.

 

I did a fresh install of Ubuntu 7.10 Server with Nagios and NDOUtils (latest versions) and get the same problem exactly.

 

I then did a fresh install of Ubuntu 6.06 Server with Nagios and NDOUtils and it works perfectly.  So there’s obviously something in Ubuntu 7.10 causing the problem.  I guess the next step would be to go through all the components and check for version differences, but I’m not really sure I can be bothered - I think I’ll just stick with Ubuntu 6.06 for now.

 

Thanks for all the help anyway!

 

Joe

 

From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Antonio Grassi
Sent: 04 April 2008 18:53
To: Nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] RE : NDOUtils Problem

 

I assume, as you have said, that /usr/local/nagios/var/ndo.sock has write permissions for the user/group that Nagios daemon runs as.

In the file src/io.c, line 225, is the function ndo_sink_write, wich is returning the value NDO_ERROR and causing the function ndomod_write_to_sink in file src/ndomod.c to log the error "Error writing to data sink!" (that same function is also the one that succesfully reconnects to data sink).

Maybe you can get more info about the problem, examining the errno variable after the "write" call in ndo_sink_write. You can modify the line 733 in ndomod.c for something like this:

asprintf(&temp_buffer,"ndomod: Error writing to data sink (%d - %s)!  Some output may get lost.  %lu queued items to flush.",errno,strerror(errno), sinkbuf.items);

The function strerror gives you a very short description of the error, and is defined in string.h

The error codes should be defined in /usr/include/asm-generic/errno.h

If the permissions are ok (which seems to be the case due to the unix socket being opened for writing succesfully), maybe there is a problem with ndo2db disconnecting for some reason in the other extreme of the socket.

You can also use netstat -a to see if the ndo2db daemon is listening on the specified socket, before and after getting up nagios.

Also, I think that the ndo2db daemon should at least log a query like "SELECT instance_id FROM ...", which is one of the first things that ndo2db does after connecting to the database (in ndo2db_db_hello() in src/db.c), so maybe it's the ndo2db daemon failing to connect to database (or to listen on the unix socket).

The function that connects to the database is ndo2db_db_connect, which sends (un)success messages to syslog.

Well, I've no more ideas at the moment.






2008/4/4, Joe Precious <JoeP at protronics.co.uk>:

Config files are below.  I always get the errors – nothing has been written to the database yet (NDOUtils was installed yesterday morning).

 

Thanks

 

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

 

ndo2db.cfg:-

 

ndo2db_user=nagios

ndo2db_group=nagios

socket_type=unix

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=<Removed>

max_timedevents_age=1440

max_systemcommands_age=10080

max_servicechecks_age=10080

max_hostchecks_age=10080

max_eventhandlers_age=44640

debug_level=-1

debug_verbosity=2

debug_file=/var/log/ndo2db.debug

max_debug_file_size=1000000

 

From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Antonio Grassi
Sent: 04 April 2008 15:21
To: Nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] RE : NDOUtils Problem

 

Joe, can you please paste your ndomod.cfg and ndo2db.cfg files (without comments)?

2008/4/4, Joe Precious <JoeP at protronics.co.uk>:

Hi

 

I've enabled logging and it creates the debug file but there's nothing in it which implies to me that ndo2db is not actually doing anything at all.  I guess this ties in with the errors that imply that ndomod can't connect to the socket.

 

I've checked the location of the socket in both configuration files is the same, I've also confirmed it exists where it should and the permissions look fine on it (the same as my other server where it works).

 

Is there anyway I can test the connection to the socket?  This is starting to get a bit beyond my Linux knowledge.

 

BTW I upgraded to 3.0.1 in case this helped but it didn't!

 

Thanks

 

Joe

 

From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Antonio Grassi
Sent: 04 April 2008 13:19
To: Nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] RE : NDOUtils Problem


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080407/d6458c8b/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list