Ndomod: Could not open data sink!

Hello I’ve been trying to get ndoutil configured. But hitting the following problem on restarting nagios:

[1232587090] Nagios 3.0.6 starting… (PID=49371)
[1232587090] Local time is Thu Jan 22 12:18:10 EST 2009
[1232587090] LOG VERSION: 2.0
[1232587090] ndomod: NDOMOD 1.4b7 (10-31-2007) Copyright © 2005-2007 Ethan Galstad ([email protected])
[1232587090] ndomod: Could not open data sink! I’ll keep trying, but some output may get lost…
[1232587090] Event broker module ‘/usr/local/bin/ndomod-3x.o’ initialized successfully.
[1232587090] Warning: Host ‘spamd1’ has no services associated with it!
[1232587090] Warning: Host ‘spamd2’ has no services associated with it!
[1232587090] Warning: Host ‘wdl16-j2320’ has no services associated with it!
[1232587090] Finished daemonizing… (New PID=49372)

The ndo2db-3x deamon is running. I’ve double checked the mysql settings. the nagios database can be accessed by the nagios user. I’ve checked the ndo.sock is present and is open (with lsof).

The setup is: FreeBSD 6.3-RELEASE-p7
nagios-3.0.6
nagios-plugins-1.4.13
ndoutils-1.4b7_1

ndo line in nagios.cfg

NDO config stuff added by ajones 20090121

Uncomment the line below if you’re running Nagios 3.x

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

Goolge is not being helpful.
Any ideas?

Thanks
Andrew

A year after the original query but still…

I also spent many hours on this issue and by chance found something that worked for me on a RHEL 5 installation. I had pretty much exhausted all the suggestions from my Google searches and decided to get ndo2db into /etc/init.d since I would need that in the longer term anyway (I guess that is an optimist’s logic). In the process of writing the script for that (listed at the end of this reply) I had to change the attributes for ndomod.cfg and ndo2db.cfg. I changed owner and group to nagios and changed permissions to 666, to match the nagios configuration files.

After starting ndo2db as a daemon and then restarting nagios, lo and behold, data started getting pumped through to MySQL. I am not sure if the real fix was
a) starting ndo2db as a daemon,or
b) changing the ownership and permissions of the 2 ndo configuration files

but at least it sent an initial batch of data through to MySQL. Now let’s see if it stays up.

Here’s the script I used to get ndo2db into /etc/init.d:

[code]#!/bin/sh

chkconfg: - 50 50

description: NDO2DB - Nagios NDO to database daemon

processname: ndo2db

pidfle: /var/run/ndo2db.pid

NBASE=/usr/local/nagios
ndo2db=$NBASE/bin/ndo2db

source function library

. /etc/init.d/functions

case “$1” in
start)
echo -n "Starting ndo2db: "
daemon $ndo2db -c $NBASE/etc/ndo2db.cfg
RETVAL=$?
echo
;;

    stop)
            echo -n "Stopping ndo2db: "
            killproc $ndo2db
            RETVAL=$?
            echo
    ;;

    restart)
            echo -n "Restarting ndo2db: "
            $0 stop
            sleep 30
            $0 start
    ;;

    status)
            status ndo2db
            RETVAL=$?
    ;;

    *)
            echo "Usage: $0 {start|stop|status|restart}"
            RETVAL=1
    ;;

esac

exit $RETVAL
[/code]

Cheers

Peter

A hundered thousand Thanks!!!

I’ve been searching for ever and the solution is actually quite simple.

Glad you stopped by.

With reference to the init.d script, i would like to use this, but when I try to run it I get the error :
.: 10: Can’t open /etc/init.d/functions

is this something i can install or are they some functions you wrote yourself?

Thanks Again
Stuart

Thank you so much !!! Really it helped lot.

But I found this page by google after 2 days, all the hits that I got was only discussing the issue and telling tentative solutions.

Text hints For Search Engines:

Successfully Got working NAGIOS + NDOMOD : ( ndomod: Could not open data sink! I’ll keep trying, but some output may get lost… )
NDO2DB Successfully inserting records.
NDOMOD Config file permission issue (chmod 666 ndo2db.fg ndomod.cfg )