NDO: ndoutils-1.4b4 and nagios 2.9 - Could not open datasink - SOLVED

Dirk Westfal dirk.westfal at frankfurter-verein.de
Thu Aug 9 15:18:37 CEST 2007


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