[Nagios-users] NDO: ndoutils-1.4b4 and nagios 2.9 - Could not open datasink

2007-08-09 Thread Dirk Westfal

Hi all, 

I`m trying to get ndoutils-1.4b4 to run with nagios 2.9, but regardless what i 
try, i get the dreaded could not open datasink message from the ndomod 
module.

The ndo2db deamon is running, login to the mysql database successfull.

The error occurs when using a unxisocket but also when using tcp - very 
strange. 

System is centos 5 with selinux disabled. 

Does anyone have an idea how i can debug this? 
I`m currently reading through the source code of ndomod.c but so far have no 
clue why i`m getting the CNOD - Message...

tia,
Dirk

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] NDO: ndoutils-1.4b4 and nagios 2.9 - Could not open datasink - SOLVED

2007-08-09 Thread Dirk Westfal
Hi all,

On Thursday 09 August 2007 11:18, Dirk Westfal wrote:
 Hi all,

 I`m trying to get ndoutils-1.4b4 to run with nagios 2.9, but regardless
 what i try, i get the dreaded could not open datasink message from the
 ndomod module.

I found it... after i added debug code to ndomod_open_sink in ndomod.c to 
print out all variables used by ndo_sink_open. It turned out they were 
(null). All of them. 

And you might guess it now: it was an error in the path to the ndomod.cfg - 
file in nagios.cfg. 

Function ndomod_process_config_file should really give an appropiate 
warning, returning just NDO_ERROR isn`t sufficient. 

Patch:
 diff /root/ndoutils-1.4b4/src/ndomod.c  ndomod.c
322c322

---
  char temp_buffer[NDOMOD_MAX_BUFLEN];
324c324,328
   if((thefile=ndo_mmap_fopen(filename))==NULL)
---
   if((thefile=ndo_mmap_fopen(filename))==NULL) {
   /* log a message to the Nagios log file */
  snprintf(temp_buffer,sizeof(temp_buffer)-1,ndomod: error opening 
configfile %s\n,filename);
 temp_buffer[sizeof(temp_buffer)-1]='\x0';
 ndomod_write_to_logs(temp_buffer,NSLOG_INFO_MESSAGE);
326c330

---
 }




-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Nagios-users mailing list
Nagios-users@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