Page 1 of 1

ndomod config problem

Posted: Fri Jan 31, 2014 6:26 am
by tantal
Hello All,

I try to configura ndoutils 1.5.2 with nagios 3.3.1 on FC15. Nagios is working properly but ndomod does not insert any records into nagios DB.
I found only this log in /usr/local/nagios/var/nagios.log

[1391157130] Nagios 3.3.1 starting... (PID=16055)
[1391157130] Local time is Fri Jan 31 09:32:10 CET 2014
[1391157130] LOG VERSION: 2.0
[1391157130] ndomod: NDOMOD 1.5.2 (06-08-2012) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1391157130] ndomod: Could not open data sink! I'll keep trying, but some output may get lost...
[1391157130] Event broker module '/usr/local/nagios/bin/ndomod-3x.o' initialized successfully.


First I changed config files. Than I created nagiod db and tables
and also added all grants for nagios user.
(I checked nagios user with mysql client, it can insert, select, delete etc.. in nagios db)

/usr/local/nagios/etc/nagios.cfg

Code: Select all

nagios_user=nagios
nagios_group=nagios
event_broker_options=-1
broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg
/usr/local/nagios/etc/ndo2db.cfg

Code: Select all

lock_file=/usr/local/nagios/var/ndo2db.lock
ndo2db_user=nagios
ndo2db_group=nagcmd
socket_type=unix
socket_name=/usr/local/nagios/var/ndo.sock
tcp_port=5668
use_ssl=0
db_servertype=mysql
db_host=localhost
db_port=3306
db_name=nagios
db_prefix=nagios_
db_user=nagios
db_pass=nagios
max_timedevents_age=1440
max_systemcommands_age=10080
max_servicechecks_age=10080
max_hostchecks_age=10080
max_eventhandlers_age=44640
max_externalcommands_age=44640
debug_level=2
debug_verbosity=1
debug_file=/usr/local/nagios/var/ndo2db.debug
max_debug_file_size=1000000
/usr/local/nagios/etc/ndomod.cfg

Code: Select all

instance_name=default
output_type=unixsocket
output=/usr/local/nagios/var/ndo.sock
tcp_port=5668
use_ssl=0
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
How can I solve this problem? Is there any error log of ndomod (/usr/local/nagios/var/ndo2db.debug is empty)?

Re: ndomod config problem

Posted: Fri Jan 31, 2014 12:54 pm
by sreinhardt
Well, let's start by verifying the file socket actually exists for ndo.

Code: Select all

ls -lv /usr/local/nagios/var/ndo.sock
Then let's tail a few lines of the debug file from ndo.

Code: Select all

tail -n 25 /usr/local/nagios/var/ndo2db.debug

Re: ndomod config problem

Posted: Tue Feb 04, 2014 7:11 am
by tantal
Hello,

Unfortunatelly, ndo2db.debug is empty

Code: Select all

# ls -lv /usr/local/nagios/var/ndo.sock
srwxr-xr-x 1 nagios nagios 0 Feb  4 12:34 /usr/local/nagios/var/ndo.sock
I tried to add full permission but the result is same: "ndomod: Could not open data sink!"

Code: Select all

ls -lv /usr/local/nagios/var/ndo.sock
srwsrwxrwx 1 nagios nagios 0 Feb  4 12:34 /usr/local/nagios/var/ndo.sock

Re: ndomod config problem

Posted: Tue Feb 04, 2014 11:59 am
by slansing
Lets change the debug level in your ndo2db.cfg file, and try to re-initialize nagios to see if we get output in the debug log.


Switch the level to -1 so we can see all debug logging, not just SQL queries "which are not happening right now."
# DEBUG LEVEL
# This option determines how much (if any) debugging information will
# be written to the debug file. OR values together to log multiple
# types of information.
# Values: -1 = Everything
# 0 = Nothing
# 1 = Process info
# 2 = SQL queries

debug_level=-1

Re: ndomod config problem

Posted: Wed Feb 05, 2014 2:12 am
by tantal
Hello,

I have found out for the problem. /usr/local/nagios/etc/ndomod.cfg owner was root.root. I changed it to nagios.nagios and ndo2db started to work.

Thank you for the support!

Re: ndomod config problem

Posted: Wed Feb 05, 2014 9:57 am
by tmcdonald
Make it apache.nagios and we'll call it a day. Shouldn't matter too much as long as the permissions are right, but doesn't hurt.