<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.gmailquote
        {mso-style-name:gmail_quote;}
span.q
        {mso-style-name:q;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>This is all starting to get a bit too complex for me!  Anyway, I’ve
managed to narrow down the problem a bit.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I did a fresh install of Ubuntu 7.10 Server with Nagios and
NDOUtils (latest versions) and get the same problem exactly.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>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.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thanks for all the help anyway!<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Joe<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal style='margin-left:36.0pt'><b><span lang=EN-US
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
nagios-users-bounces@lists.sourceforge.net
[mailto:nagios-users-bounces@lists.sourceforge.net] <b>On Behalf Of </b>Antonio
Grassi<br>
<b>Sent:</b> 04 April 2008 18:53<br>
<b>To:</b> Nagios-users@lists.sourceforge.net<br>
<b>Subject:</b> Re: [Nagios-users] RE : NDOUtils Problem<o:p></o:p></span></p>

</div>

<p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:
12.0pt;margin-left:36.0pt'>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.<br>
<br>
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 "<span style='font-size:10.0pt;
font-family:"Arial","sans-serif"'>Error writing to data sink!" (that same
function is also the one that succesfully reconnects to data sink).</span><br>
<br>
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:<br>
<br>
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);<br>
<br>
The function strerror gives you a very short description of the error, and is
defined in string.h<br>
<br>
The error codes should be defined in /usr/include/asm-generic/errno.h<br>
<br>
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.<br>
<br>
You can also use netstat -a to see if the ndo2db daemon is listening on the
specified socket, before and after getting up nagios.<br>
<br>
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).<br>
<br>
The function that connects to the database is ndo2db_db_connect, which sends
(un)success messages to syslog.<br>
<br>
Well, I've no more ideas at the moment.<br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><span class=gmailquote>2008/4/4,
Joe Precious <<a href="mailto:JoeP@protronics.co.uk">JoeP@protronics.co.uk</a>>:</span><o:p></o:p></p>

<div>

<div>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>Config
files are below.  I always get the errors – nothing has been written to
the database yet (NDOUtils was installed yesterday morning).</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>Thanks</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>ndomod.cfg:-</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>instance_name=default</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>output_type=unixsocket</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>output=/usr/local/nagios/var/ndo.sock</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>tcp_port=5668</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>output_buffer_items=5000</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>buffer_file=/usr/local/nagios/var/ndomod.tmp</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>file_rotation_interval=14400</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>file_rotation_timeout=60</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>reconnect_interval=15</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>reconnect_warning_interval=15</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>data_processing_options=-1</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>config_output_options=2</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>ndo2db.cfg:-</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>ndo2db_user=nagios</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>ndo2db_group=nagios</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>socket_type=unix</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>socket_name=/usr/local/nagios/var/ndo.sock</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>tcp_port=5668</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>db_servertype=mysql</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>db_host=localhost</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>db_port=3306</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>db_name=nagios</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>db_prefix=nagios_</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>db_user=nagios</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>db_pass=<Removed></span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>max_timedevents_age=1440</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>max_systemcommands_age=10080</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>max_servicechecks_age=10080</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>max_hostchecks_age=10080</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>max_eventhandlers_age=44640</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>debug_level=-1</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>debug_verbosity=2</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>debug_file=/var/log/ndo2db.debug</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'>max_debug_file_size=1000000</span><o:p></o:p></p>

<p style='margin-left:36.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;
border-color:-moz-use-text-color -moz-use-text-color'>

<p style='margin-left:72.0pt'><b><span lang=EN-US style='font-size:10.0pt'>From:</span></b><span
lang=EN-US style='font-size:10.0pt'> <a
href="mailto:nagios-users-bounces@lists.sourceforge.net" target="_blank">nagios-users-bounces@lists.sourceforge.net</a>
[mailto:<a href="mailto:nagios-users-bounces@lists.sourceforge.net"
target="_blank">nagios-users-bounces@lists.sourceforge.net</a>] <b>On Behalf Of
</b>Antonio Grassi<br>
<b>Sent:</b> 04 April 2008 15:21<br>
<span class=q><b>To:</b> <a href="mailto:Nagios-users@lists.sourceforge.net"
target="_blank">Nagios-users@lists.sourceforge.net</a></span><br>
<span class=q><b>Subject:</b> Re: [Nagios-users] RE : NDOUtils Problem</span></span><o:p></o:p></p>

</div>

<p style='margin-left:72.0pt'> <o:p></o:p></p>

<p style='mso-margin-top-alt:5.0pt;margin-right:0cm;margin-bottom:12.0pt;
margin-left:72.0pt'>Joe, can you please paste your ndomod.cfg and ndo2db.cfg
files (without comments)?<o:p></o:p></p>

<div>

<p style='margin-left:72.0pt'>2008/4/4, Joe Precious <<a
href="mailto:JoeP@protronics.co.uk" target="_blank">JoeP@protronics.co.uk</a>>:<o:p></o:p></p>

<div>

<div>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'>Hi</span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'>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.</span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'>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).</span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'>Is
there anyway I can test the connection to the socket?  This is starting to
get a bit beyond my Linux knowledge.</span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'>BTW
I upgraded to 3.0.1 in case this helped but it didn't!</span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'>Thanks</span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'>Joe</span><o:p></o:p></p>

<p style='margin-left:72.0pt'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;
border-color:-moz-use-text-color'>

<p style='margin-left:108.0pt'><b><span lang=EN-US style='font-size:10.0pt'>From:</span></b><span
lang=EN-US style='font-size:10.0pt'> <a
href="mailto:nagios-users-bounces@lists.sourceforge.net" target="_blank">nagios-users-bounces@lists.sourceforge.net</a>
[mailto:<a href="mailto:nagios-users-bounces@lists.sourceforge.net"
target="_blank">nagios-users-bounces@lists.sourceforge.net</a>] <b>On Behalf Of
</b>Antonio Grassi<br>
<b>Sent:</b> 04 April 2008 13:19<br>
<b>To:</b> <a href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">Nagios-users@lists.sourceforge.net</a><br>
<b>Subject:</b> Re: [Nagios-users] RE : NDOUtils Problem</span><o:p></o:p></p>

</div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='margin-left:36.0pt'><br>
-------------------------------------------------------------------------<br>
Check out the new SourceForge.net Marketplace.<br>
It's the best place to buy or sell services for<br>
just about anything Open Source.<br>
<a
href="http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace"
target="_blank">http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users"
target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></p>

</div>

</body>

</html>