ndomod config problem

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
tantal
Posts: 3
Joined: Fri Jan 31, 2014 3:59 am

ndomod config problem

Post 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)?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: ndomod config problem

Post 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
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tantal
Posts: 3
Joined: Fri Jan 31, 2014 3:59 am

Re: ndomod config problem

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: ndomod config problem

Post 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
tantal
Posts: 3
Joined: Fri Jan 31, 2014 3:59 am

Re: ndomod config problem

Post 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!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: ndomod config problem

Post 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.
Former Nagios employee
Locked