ndo2db don't write anything to datadase

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.
adengin
Posts: 15
Joined: Tue Feb 03, 2015 7:51 am
Location: Petrozavodsk, Russia

Re: ndo2db don't write anything to datadase

Post by adengin »

I switched it to the unix socket, but the problem was not solved. Still no data in the database.

Code: Select all

#####################################################################
# NDO2DB DAEMON CONFIG FILE
#
# Last Modified: 01-02-2009
#####################################################################



# LOCK FILE
# This is the lockfile that NDO2DB will use to store its PID number
# in when it is running in daemon mode.

lock_file=/usr/local/nagios/var/ndo2db.lock



# USER/GROUP PRIVILIGES
# These options determine the user/group that the daemon should run as.
# You can specify a number (uid/gid) or a name for either option.

ndo2db_user=nagios
ndo2db_group=nagios
# SOCKET TYPE
# This option determines what type of socket the daemon will create
# an accept connections from.
# Value:
#   unix = Unix domain socket (default)
#   tcp  = TCP socket

socket_type=unix
#socket_type=tcp



# SOCKET NAME
# This option determines the name and path of the UNIX domain
# socket that the daemon will create and accept connections from.
# This option is only valid if the socket type specified above
# is "unix".

socket_name=/usr/local/nagios/var/ndo.sock
# TCP PORT
# This option determines what port the daemon will listen for
# connections on.  This option is only vlaid if the socket type
# specified above is "tcp".

#tcp_port=5668



# ENCRYPTION
# This option determines if the ndo2db daemon will accept SSL to encrypt the
# network traffic between module and ndo2db daemon.
# Both sides have to enable this feature which depends on SSL Libraries
# like openssl or kerberos
# This option is only valid if the output type
# option specified above is "tcpsocket".
#
# A value of '1' will enable this feature

use_ssl=0
# DATABASE SERVER TYPE
# This option determines what type of DB server the daemon should
# connect to.
# Values:
#       mysql = MySQL
#       pgsql = PostgreSQL

db_servertype=mysql



# DATABASE HOST
# This option specifies what host the DB server is running on.

db_host=localhost



# DATABASE PORT
# This option specifies the port that the DB server is running on.
# Values:
#       3306 = Default MySQL port
#       5432 = Default PostgreSQL port

db_port=3306



# DATABASE NAME
# This option specifies the name of the database that should be used.

db_name=nagios



# DATABASE TABLE PREFIX
# Determines the prefix (if any) that should be prepended to table names.
# If you modify the table prefix, you'll need to modify the SQL script for
# creating the database!

db_prefix=nagios_
# DATABASE USERNAME/PASSWORD
# This is the username/password that will be used to authenticate to the DB.
# The user needs at least SELECT, INSERT, UPDATE, and DELETE privileges on
# the database.

db_user=nagios
db_pass=nagios



## TABLE TRIMMING OPTIONS
# Several database tables containing Nagios event data can become quite large
# over time.  Most admins will want to trim these tables and keep only a
# certain amount of data in them.  The options below are used to specify the
# age (in MINUTES) that data should be allowd to remain in various tables
# before it is deleted.  Using a value of zero (0) for any value means that
# that particular table should NOT be automatically trimmed.

# Keep timed events for 24 hours
max_timedevents_age=1440

# Keep system commands for 1 week
max_servicechecks_age=10080

# Keep host checks for 1 week
max_hostchecks_age=10080

# Keep event handlers for 31 days
max_eventhandlers_age=44640

# Keep external commands for 31 days
max_externalcommands_age=44640

# Keep notifications for 31 days
max_notifications_age=44640

# Keep contactnotifications for 31 days
max_contactnotifications=44640
# Keep contactnotificationmethods for 31 days
max_contactnotificationmethods=44640

# Keep logentries for 90 days
max_logentries_age=129600

# Keep acknowledgements for 31 days
max_acknowledgements_age=44640

# 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



# DEBUG VERBOSITY
# This option determines how verbose the debug log out will be.
# Values: 0 = Brief output
#         1 = More detailed
#         2 = Very detailed

debug_verbosity=2
# DEBUG FILE
# This option determines where the daemon should write debugging information.

debug_file=/usr/local/nagios/var/ndo2db.debug

# MAX DEBUG FILE SIZE
# This option determines the maximum size (in bytes) of the debug file.  If
# the file grows larger than this size, it will be renamed with a .old
# extension.  If a file already exists with a .old extension it will
# automatically be deleted.  This helps ensure your disk space usage doesn't
# get out of control when debugging.

max_debug_file_size=1000000

Code: Select all

#####################################################################
# NDOMOD CONFIG FILE
#
# Last Modified: 09-05-2007
#####################################################################


# INSTANCE NAME
# This option identifies the "name" associated with this particular
# instance of Nagios and is used to seperate data coming from multiple
# instances.  Defaults to 'default' (without quotes).

instance_name=localhost



# OUTPUT TYPE
# This option determines what type of output sink the NDO NEB module
# should use for data output.  Valid options include:
#   file       = standard text file
#   tcpsocket  = TCP socket
#   unixsocket = UNIX domain socket (default)

#output_type=file
#output_type=tcpsocket
output_type=unixsocket



# OUTPUT
# This option determines the name and path of the file or UNIX domain
# socket to which output will be sent if the output type option specified
# above is "file" or "unixsocket", respectively.  If the output type
# option is "tcpsocket", this option is used to specify the IP address
# of fully qualified domain name of the host that the module should
# connect to for sending output.

#output=/usr/local/nagios/var/ndo.dat
#output=127.0.0.1
output=/usr/local/nagios/var/ndo.sock
# TCP PORT
# This option determines what port the module will connect to in
# order to send output.  This option is only valid if the output type
# option specified above is "tcpsocket".

#tcp_port=5668



# ENCRYPTION
# This option determines if the module will use SSL to encrypt the
# network traffic between module and ndo2db daemon.
# Both sides have to enable this feature which depends on SSL Libraries
# like openssl or kerberos
# This option is only valid if the output type
# option specified above is "tcpsocket".
#
# A value of '1' will enable this feature

use_ssl=0
# OUTPUT BUFFER
# This option determines the size of the output buffer, which will help
# prevent data from getting lost if there is a temporary disconnect from
# the data sink.  The number of items specified here is the number of
# lines (each of variable size) of output that will be buffered.

output_buffer_items=5000



# BUFFER FILE
# This option is used to specify a file which will be used to store the
# contents of buffered data which could not be sent to the NDO2DB daemon
# before Nagios shuts down.  Prior to shutting down, the NDO NEB module
# will write all buffered data to this file for later processing.  When
# Nagios (re)starts, the NDO NEB module will read the contents of this
# file and send it to the NDO2DB daemon for processing.

buffer_file=/usr/local/nagios/var/ndomod.tmp
# FILE ROTATION INTERVAL
# This option determines how often (in seconds) the output file is
# rotated by Nagios.  File rotation is handled by Nagios by executing
# the command defined by the file_rotation_command option.  This
# option has no effect if the output_type option is a socket.

file_rotation_interval=14400



# FILE ROTATION COMMAND
# This option specified the command (as defined in Nagios) that is
# used to rotate the output file at the interval specified by the
# file_rotation_interval option.  This option has no effect if the
# output_type option is a socket.
#
# See the file 'misccommands.cfg' for an example command definition
# that you can use to rotate the log file.

#file_rotation_command=rotate_ndo_log
# FILE ROTATION TIMEOUT
# This option specified the maximum number of seconds that the file
# rotation command should be allowed to run before being prematurely
# terminated.

file_rotation_timeout=60



# RECONNECT INTERVAL
# This option determines how often (in seconds) that the NDO NEB
# module will attempt to re-connect to the output file or socket if
# a connection to it is lost.

reconnect_interval=15
# RECONNECT WARNING INTERVAL
# This option determines how often (in seconds) a warning message will
# be logged to the Nagios log file if a connection to the output file
# or socket cannot be re-established.

reconnect_warning_interval=15
#reconnect_warning_interval=900



# DATA PROCESSING OPTIONS
# These options determine what data the NDO NEB Module will process
#
data_processing_options=-1
acknowledgement_data=1
adaptive_contact_data=1
adaptive_host_data=1
adaptive_program_data=1
adaptive_service_data=1
aggregated_status_data=1
comment_data=1
contact_status_data=1
downtime_data=1
event_handler_data=1
external_command_data=1
flapping_data=1
host_check_data=1
host_status_data=1
log_data=1
main_config_data=1
notification_data=1
object_config_data=0
process_data=1
program_status_data=1
retention_data=1
service_check_data=1
service_status_data=1
statechange_data=1
system_command_data=1
timed_event_data=1


# CONFIG OUTPUT OPTION
# This option determines what types of configuration data the NDO
# NEB module will dump from Nagios.  Values can be OR'ed together.
# Values:
#         0 = Don't dump any configuration information
#         1 = Dump only original config (from config files)
#         2 = Dump config only after retained information has been restored
#         3 = Dump both original and retained configuration

config_output_options=2

Code: Select all

[1429533977] Nagios 4.0.8 starting... (PID=3067)
[1429533977] Local time is Mon Apr 20 15:46:17 MSK 2015
[1429533977] LOG VERSION: 2.0
[1429533977] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1429533977] qh: core query handler registered
[1429533977] nerd: Channel hostchecks registered successfully
[1429533977] nerd: Channel servicechecks registered successfully
[1429533977] nerd: Channel opathchecks registered successfully
[1429533977] nerd: Fully initialized and ready to rock!
[1429533977] wproc: Successfully registered manager as @wproc with query handler
[1429533977] wproc: Registry request: name=Core Worker 3075;pid=3075
[1429533977] wproc: Registry request: name=Core Worker 3076;pid=3076
[1429533977] wproc: Registry request: name=Core Worker 3077;pid=3077
[1429533977] wproc: Registry request: name=Core Worker 3080;pid=3080
[1429533977] wproc: Registry request: name=Core Worker 3079;pid=3079
[1429533977] wproc: Registry request: name=Core Worker 3078;pid=3078
[1429533978] ndomod: NDOMOD 2.0.0 (02-28-2014) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1429533978] ndomod: Successfully connected to data sink.  196 items lost, 5000 queued items to flush.

Code: Select all

mysql> select * from nagios_instances;
Empty set (0.00 sec)
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: ndo2db don't write anything to datadase

Post by jolson »

Could you check permissions on all directories nested in /usr/local/nagios please?

Code: Select all

ls -l /usr/local/nagios
It's possible that 'var' doesn't give 'nagios' write permissions.

Do you have any sort of application level security on this linux server?

Please also provide the output of

Code: Select all

ps aux | grep ndo
to ensure that the proper ndo binary and configs are being used.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
adengin
Posts: 15
Joined: Tue Feb 03, 2015 7:51 am
Location: Petrozavodsk, Russia

Re: ndo2db don't write anything to datadase

Post by adengin »

hi, jolson!

Code: Select all

root@nagios:~# ls -l /usr/local/nagios
total 32
drwxrwsr-x  2 nagios nagios 4096 Mar 31 17:45 bin
drwxrwsr-x  3 nagios nagios 4096 Apr 20 15:35 etc
drwxr-sr-x  2 root   staff  4096 Feb  2 17:38 include
drwxrwsr-x  3 nagios nagios 4096 Mar 25 14:59 libexec
drwxrwsr-x  5 root   staff  4096 Feb  2 17:38 perl
drwxrwsr-x  2 nagios nagios 4096 Mar 23 12:14 sbin
drwxrwsr-x 11 nagios nagios 4096 Mar 23 12:14 share
drwxrwsr-x  5 nagios nagios 4096 Apr 21 07:58 var
ndo2db is running

Code: Select all

root@nagios:~# ps aux | grep -v grep | grep ndo
nagios    4317  0.0  0.0   6844   524 ?        Ss   Apr20   0:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
nagios    4325  0.0  0.0   7232  1008 ?        S    Apr20   0:02 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
nagios    4335  0.0  0.0   7232  1008 ?        S    Apr20   0:02 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
There are no any applicatioт security software installed intentionally.

Code: Select all

acpi    1.6-1
acpi-support-base       0.140-5+deb7u3
acpid   1:2.0.16-1+deb7u1
adduser 3.113+nmu3
apache2 2.2.22-13+deb7u4
apache2-mpm-prefork     2.2.22-13+deb7u4
apache2-utils   2.2.22-13+deb7u4
apache2.2-bin   2.2.22-13+deb7u4
apache2.2-common        2.2.22-13+deb7u4
apcupsd 3.14.10-2
apt     0.9.7.9+deb7u7
apt-file        2.5.1
apt-listchanges 2.85.11
apt-utils       0.9.7.9+deb7u7
aptitude        0.6.8.2-1
aptitude-common 0.6.8.2-1
at      3.1.13-2+deb7u1
atftpd  0.7.dfsg-11
auditd  1:1.7.18-1.1
base-files      7.1wheezy8
base-passwd     3.5.26
bash    4.2+dfsg-0.1+deb7u3
bash-completion 1:2.0-1
bc      1.06.95-2
bind9-host      1:9.8.4.dfsg.P1-6+nmu2+deb7u4
binfmt-support  2.0.12
binutils        2.22-8+deb7u2
bsd-mailx       8.1.2-0.20111106cvs-1+deb7u1
bsdmainutils    9.0.3
bsdutils        1:2.20.1-5.3
build-essential 11.5
busybox 1:1.20.0-7
bzip2   1.0.6-4
ca-certificates 20130119+deb7u1
cli-common      0.8.2
console-setup   1.88
console-setup-linux     1.88
coreutils       8.13-3.5
cpio    2.11+dfsg-0.1+deb7u1
cpp     4:4.7.2-1
cpp-4.6 4.6.3-14
cpp-4.7 4.7.2-5
cron    3.0pl1-124
curl    7.26.0-1+wheezy12
daemon  0.6.4-1
dash    0.5.7-3
db5.1-util      5.1.29-5
dc      1.06.95-2
debconf 1.5.49
debconf-i18n    1.5.49
debian-archive-keyring  2014.3~deb7u1
debian-faq      5.0.1
debianutils     4.3.2
dictionaries-common     1.12.11
diffutils       1:3.2-6
discover        2.1.2-5.2
discover-data   2.2010.10.18
dmidecode       2.11-9
dmsetup 2:1.02.74-8
dnsutils        1:9.8.4.dfsg.P1-6+nmu2+deb7u4
doc-debian      6.1
dos2unix        6.0-1
dpkg    1.16.15
dpkg-dev        1.16.15
e2fslibs        1.42.5-1.1+deb7u1
e2fsprogs       1.42.5-1.1+deb7u1
eject   2.1.5+deb1+cvs20081104-13
exim4   4.80-7+deb7u1
exim4-base      4.80-7+deb7u1
exim4-config    4.80-7+deb7u1
exim4-daemon-light      4.80-7+deb7u1
fakeroot        1.18.4-2
file    5.11-2+deb7u8
findutils       4.4.2-4
fontconfig-config       2.9.0-7.1
freeipmi-common 1.1.5-3
ftp     0.17-27
g++     4:4.7.2-1
g++-4.7 4.7.2-5
gcc     4:4.7.2-1
gcc-4.6 4.6.3-14
gcc-4.6-base    4.6.3-14
gcc-4.7 4.7.2-5
gcc-4.7-base    4.7.2-5
gdb     7.4.1+dfsg-0.1
gdbserver       7.4.1+dfsg-0.1
geoip-database  20130213-1
gettext-base    0.18.1.1-9
gnupg   1.4.12-7+deb7u7
gpgv    1.4.12-7+deb7u7
grep    2.12-2
groff-base      1.21-9
grub-common     1.99-27+deb7u2
grub-pc 1.99-27+deb7u2
grub-pc-bin     1.99-27+deb7u2
grub2-common    1.99-27+deb7u2
gzip    1.5-1.1
host    1:9.8.4.dfsg.P1-6+nmu2+deb7u4
hostname        3.11
iamerican       3.3.02-6
ibritish        3.3.02-6
ienglish-common 3.3.02-6
ifupdown        0.7.8
info    4.13a.dfsg.1-10
initramfs-tools 0.109.1
initscripts     2.88dsf-41+deb7u1
insserv 1.14.0-5
install-info    4.13a.dfsg.1-10
installation-report     2.49
iproute 20120521-3+b3
iptables        1.4.14-3.1
iputils-ping    3:20101006-1+b1
isc-dhcp-client 4.2.2.dfsg.1-5+deb70u6
isc-dhcp-common 4.2.2.dfsg.1-5+deb70u6
iso-codes       3.41-1
ispell  3.3.02-6
javascript-common       7
kbd     1.15.3-9
keyboard-configuration  1.88
klibc-utils     2.0.1-3.1
kmod    9-3
krb5-locales    1.10.1+dfsg-5+deb7u3
laptop-detect   0.13.7
less    444-4
libacl1 2.2.51-8
libaio1 0.3.109-3
libalgorithm-diff-perl  1.19.02-2
libalgorithm-diff-xs-perl       0.04-2+b1
libalgorithm-merge-perl 0.08-2
libapache2-mod-php5     5.4.39-0+deb7u2
libapr1 1.4.6-3+deb7u1
libaprutil1     1.4.1-3
libaprutil1-dbd-sqlite3 1.4.1-3
libaprutil1-ldap        1.4.1-3
libapt-inst1.5  0.9.7.9+deb7u7
libapt-pkg-perl 0.1.26+b1
libapt-pkg4.12  0.9.7.9+deb7u7
libasprintf0c2  0.18.1.1-9
libattr1        1:2.4.46-8
libaudit0       1:1.7.18-1.1
libbind9-80     1:9.8.4.dfsg.P1-6+nmu2+deb7u4
libblkid1       2.20.1-5.3
libboost-iostreams1.49.0        1.49.0-3.2
libbsd0 0.4.2-1
libbz2-1.0      1.0.6-4
libc-bin        2.13-38+deb7u8
libc-dev-bin    2.13-38+deb7u8
libc6   2.13-38+deb7u8
libc6-dev       2.13-38+deb7u8
libc6-i686      2.13-38+deb7u8
libcairo2       1.12.2-3
libcap2 1:2.22-1.2
libclass-isa-perl       0.36-3
libcomerr2      1.42.5-1.1+deb7u1
libconfig-file-perl     1.50-2
libconfig-inifiles-perl 2.75-1
libcurl3        7.26.0-1+wheezy12
libcwidget3     0.5.16-3.4
libdb5.1        5.1.29-5
libdbd-mysql-perl       4.021-1+b1
libdbi-perl     1.622-1+deb7u1
libdevmapper1.02.1      2:1.02.74-8
libdiscover2    2.1.2-5.2
libdns88        1:9.8.4.dfsg.P1-6+nmu2+deb7u4
libdpkg-perl    1.16.15
libedit2        2.11-20080614-5
libept1.4.12    1.0.9
libevent-2.0-5  2.0.19-stable-3+deb7u1
libexif12       0.6.20-3
libexpat1       2.1.0-1+deb7u1
libexpat1-dev   2.1.0-1+deb7u1
libffi5 3.0.10-3
libfile-fcntllock-perl  0.14-2
libfontconfig1  2.9.0-7.1
libfontconfig1-dev      2.9.0-7.1
libfreeipmi12   1.1.5-3
libfreetype6    2.4.9-1.1+deb7u1
libfreetype6-dev        2.4.9-1.1+deb7u1
libfuse2        2.9.0-2+deb7u1
libgc1c2        1:7.1-9.1
libgcc1 1:4.7.2-5
libgcrypt11     1.5.0-5+deb7u3
libgd2-xpm      2.0.36~rc1~dfsg-6.1
libgd2-xpm-dev  2.0.36~rc1~dfsg-6.1
libgdbm3        1.8.3-11
libgdiplus      2.10-3+b1
libgeoip1       1.4.8+dfsg-3
libgif4 4.1.6-10
libglib2.0-0    2.33.12+really2.32.4-5
libglib2.0-data 2.33.12+really2.32.4-5
libgmp10        2:5.0.5+dfsg-2
libgnutls26     2.12.20-8+deb7u3
libgomp1        4.7.2-5
libgpg-error0   1.10-3.1
libgpgme11      1.2.0-1.4+deb7u1
libgpm2 1.20.4-6
libgssapi-krb5-2        1.10.1+dfsg-5+deb7u3
libgssglue1     0.4-2
libhtml-template-perl   2.91-1
libidn11        1.25-2
libio-socket-inet6-perl 2.69-2
libipmiconsole2 1.1.5-3
libipmidetect0  1.1.5-3
libisc84        1:9.8.4.dfsg.P1-6+nmu2+deb7u4
libisccc80      1:9.8.4.dfsg.P1-6+nmu2+deb7u4
libisccfg82     1:9.8.4.dfsg.P1-6+nmu2+deb7u4
libitm1 4.7.2-5
libjbig0        2.0-2+deb7u1
libjpeg8        8d-1+deb7u1
libjpeg8-dev    8d-1+deb7u1
libk5crypto3    1.10.1+dfsg-5+deb7u3
libkeyutils1    1.5.5-3+deb7u1
libklibc        2.0.1-3.1
libkmod2        9-3
libkrb5-3       1.10.1+dfsg-5+deb7u3
libkrb5support0 1.10.1+dfsg-5+deb7u3
libldap-2.4-2   2.4.31-2
liblist-moreutils-perl  0.33-1+b1
liblocale-gettext-perl  1.05-7+b1
liblockfile-bin 1.09-5
liblockfile1    1.09-5
liblwres80      1:9.8.4.dfsg.P1-6+nmu2+deb7u4
liblzma5        5.1.1alpha+20120614-2
libmagic1       5.11-2+deb7u8
libmemcached10  1.0.8-1
libmono-corlib4.0-cil   2.10.8.1-8+deb7u1
libmono-data-tds4.0-cil 2.10.8.1-8+deb7u1
libmono-i18n-west4.0-cil        2.10.8.1-8+deb7u1
libmono-i18n4.0-cil     2.10.8.1-8+deb7u1
libmono-security4.0-cil 2.10.8.1-8+deb7u1
libmono-system-configuration-install4.0-cil     2.10.8.1-8+deb7u1
libmono-system-configuration4.0-cil     2.10.8.1-8+deb7u1
libmono-system-data4.0-cil      2.10.8.1-8+deb7u1
libmono-system-drawing4.0-cil   2.10.8.1-8+deb7u1
libmono-system-enterpriseservices4.0-cil        2.10.8.1-8+deb7u1
libmono-system-security4.0-cil  2.10.8.1-8+deb7u1
libmono-system-transactions4.0-cil      2.10.8.1-8+deb7u1
libmono-system-xml4.0-cil       2.10.8.1-8+deb7u1
libmono-system4.0-cil   2.10.8.1-8+deb7u1
libmount1       2.20.1-5.3
libmpc2 0.9-4
libmpfr4        3.1.0-5
libmysql-cil-dev        6.4.3-2
libmysql6.4-cil 6.4.3-2
libmysqlclient-dev      5.5.41-0+wheezy1
libmysqlclient18        5.5.41-0+wheezy1
libmysqld-dev   5.5.41-0+wheezy1
libncurses5     5.9-10
libncursesw5    5.9-10
libnet-snmp-perl        6.0.1-2
libnewt0.52     0.52.14-11.1
libnfnetlink0   1.0.0-1.1
libnfsidmap2    0.25-4
libonig2        5.9.1-1
libp11-kit0     0.12-3
libpam-modules  1.1.3-7.1
libpam-modules-bin      1.1.3-7.1
libpam-runtime  1.1.3-7.1
libpam0g        1.1.3-7.1
libpcap0.8      1.3.0-1
libpci3 1:3.1.9-6
libpcre3        1:8.30-5
libperl5.14     5.14.2-21+deb7u2
libpipeline1    1.2.1-1
libpixman-1-0   0.26.0-4+deb7u1
libpng12-0      1.2.49-1
libpng12-dev    1.2.49-1
libpopt0        1.16-7
libpq5  9.1.14-0+deb7u1
libprocps0      1:3.3.3-3
libpth20        2.0.7-16
libpthread-stubs0       0.3-3
libpthread-stubs0-dev   0.3-3
libpython2.7    2.7.3-6+deb7u2
libqdbm14       1.8.78-2
libquadmath0    4.7.2-5
libradiusclient-ng2     0.5.6-1.1
libreadline6    6.2+dfsg-0.1
libregexp-assemble-perl 0.35-7
librtmp0        2.4+20111222.git4e06e21-1
libruby1.9.1    1.9.3.194-8.1+deb7u2
libsasl2-2      2.1.25.dfsg1-6+deb7u1
libsasl2-modules        2.1.25.dfsg1-6+deb7u1
libselinux1     2.1.9-5
libsemanage-common      2.1.6-6
libsemanage1    2.1.6-6
libsensors4     1:3.3.2-2+deb7u1
libsepol1       2.1.4-3
libsigc++-2.0-0c2a      2.2.10-0.2
libslang2       2.2.4-15
libsnmp-base    5.4.3~dfsg-2.8+deb7u1
libsnmp-perl    5.4.3~dfsg-2.8+deb7u1
libsnmp-session-perl    1.13-1.1~deb7u1
libsnmp15       5.4.3~dfsg-2.8+deb7u1
libsocket6-perl 0.23-1+b2
libsqlite3-0    3.7.13-1+deb7u1
libss2  1.42.5-1.1+deb7u1
libssh2-1       1.4.2-1.1+deb7u1
libssl-dev      1.0.1e-2+deb7u16
libssl-doc      1.0.1e-2+deb7u16
libssl1.0.0     1.0.1e-2+deb7u16
libstdc++6      4.7.2-5
libstdc++6-4.7-dev      4.7.2-5
libswitch-perl  2.16-2
libtalloc2      2.0.7+git20120207-1
libtasn1-3      2.13-2+deb7u1
libtdb1 1.2.10-2
libtext-charwidth-perl  0.04-7+b1
libtext-iconv-perl      1.7-5
libtext-wrapi18n-perl   0.06-7
libtiff4        3.9.6-11
libtimedate-perl        1.2000-1
libtinfo5       5.9-10
libtirpc1       0.2.2-5
libtokyocabinet9        1.4.47-2
libudev0        175-7.2
libupsclient1   2.6.4-2.3+deb7u1
libusb-0.1-4    2:0.1.12-20+nmu1
libusb-1.0-0    2:1.0.11-1
libustr-1.0-1   1.0.4-3
libuuid-perl    0.02-5
libuuid1        2.20.1-5.3
libwbclient0    2:3.6.6-6+deb7u4
libwrap0        7.6.q-24
libx11-6        2:1.5.0-1+deb7u1
libx11-data     2:1.5.0-1+deb7u1
libx11-dev      2:1.5.0-1+deb7u1
libx11-doc      2:1.5.0-1+deb7u1
libxapian22     1.2.12-2
libxau-dev      1:1.0.7-1
libxau6 1:1.0.7-1
libxcb-render0  1.8.1-2+deb7u1
libxcb-shm0     1.8.1-2+deb7u1
libxcb1 1.8.1-2+deb7u1
libxcb1-dev     1.8.1-2+deb7u1
libxdmcp-dev    1:1.1.1-1
libxdmcp6       1:1.1.1-1
libxext6        2:1.3.1-2+deb7u1
libxml2 2.8.0+dfsg1-7+wheezy3
libxmuu1        2:1.1.1-1
libxpm-dev      1:3.5.10-1
libxpm4 1:3.5.10-1
libxrender1     1:0.9.7-1+deb7u1
libyaml-0-2     0.1.4-2+deb7u5
linux-base      3.5
linux-headers-3.2.0-4-686-pae   3.2.65-1+deb7u2
linux-headers-3.2.0-4-common    3.2.65-1+deb7u2
linux-image-3.2.0-4-686-pae     3.2.65-1+deb7u2
linux-image-686-pae     3.2+46
linux-kbuild-3.2        3.2.17-1
linux-libc-dev  3.2.65-1+deb7u2
locales 2.13-38+deb7u8
login   1:4.1.5.1-1
logrotate       3.8.1-4
lsb-base        4.1+Debian8+deb7u1
lsb-release     4.1+Debian8+deb7u1
lsof    4.86+dfsg-1
m4      1.4.16-3
make    3.81-8.2
man-db  2.6.2-1
manpages        3.44-1
manpages-dev    3.44-1
mawk    1.3.3-17
mime-support    3.52-1+deb7u1
mlocate 0.23.1-1
module-init-tools       9-3
mono-4.0-gac    2.10.8.1-8+deb7u1
mono-gac        2.10.8.1-8+deb7u1
mono-runtime    2.10.8.1-8+deb7u1
mount   2.20.1-5.3
mpt-status      1.2.0-7
mrtg    2.17.4-2
multiarch-support       2.13-38+deb7u8
mutt    1.5.21-6.2+deb7u3
mysql-client    5.5.41-0+wheezy1
mysql-client-5.5        5.5.41-0+wheezy1
mysql-common    5.5.41-0+wheezy1
mysql-server    5.5.41-0+wheezy1
mysql-server-5.5        5.5.41-0+wheezy1
mysql-server-core-5.5   5.5.41-0+wheezy1
nagios-nrpe-plugin      2.13-3
nagios-plugins-basic    1.4.16-1
nagios-plugins-contrib  4.20120702
nagios-plugins-standard 1.4.16-1
nagios3-cgi     3.4.1-3+deb7u1
nagios3-common  3.4.1-3+deb7u1
nano    2.2.6-1+b1
ncurses-base    5.9-10
ncurses-bin     5.9-10
ncurses-term    5.9-10
net-tools       1.60-24.2
netbase 5.0
netcat-traditional      1.10-40
nfs-common      1:1.2.6-4
nut-client      2.6.4-2.3+deb7u1
nut-server      2.6.4-2.3+deb7u1
openbsd-inetd   0.20091229-2
openssh-blacklist       0.4.1+nmu1
openssh-blacklist-extra 0.4.1+nmu1
openssh-client  1:6.0p1-4+deb7u2
openssh-server  1:6.0p1-4+deb7u2
openssl 1.0.1e-2+deb7u16
os-prober       1.58
passwd  1:4.1.5.1-1
patch   2.6.1-3
pciutils        1:3.1.9-6
perl    5.14.2-21+deb7u2
perl-base       5.14.2-21+deb7u2
perl-modules    5.14.2-21+deb7u2
php5-cgi        5.4.39-0+deb7u2
php5-cli        5.4.39-0+deb7u2
php5-common     5.4.39-0+deb7u2
pkg-config      0.26-1
procmail        3.22-20+deb7u1
procps  1:3.3.3-3
psmisc  22.19-1+deb7u1
python  2.7.3-4+deb7u1
python-apt      0.8.8.2
python-apt-common       0.8.8.2
python-chardet  2.0.1-2
python-debian   0.1.21
python-debianbts        1.11
python-fpconst  0.7.2-5
python-minimal  2.7.3-4+deb7u1
python-openssl  0.13-2+deb7u1
python-pam      0.4.2-13
python-pkg-resources    0.6.24-1
python-ply      3.4-3
python-pywbem   0.7.0-4
python-reportbug        6.4.4+deb7u1
python-serial   2.5-2.1
python-soappy   0.12.0-4
python-support  1.0.15
python-twisted-bin      12.0.0-1
python-twisted-core     12.0.0-1
python-twisted-web      12.0.0-1
python-zope.interface   3.6.1-3
python2.6       2.6.8-1.1
python2.6-minimal       2.6.8-1.1
python2.7       2.7.3-6+deb7u2
python2.7-minimal       2.7.3-6+deb7u2
python3 3.2.3-6
python3-minimal 3.2.3-6
python3.2       3.2.3-7
python3.2-minimal       3.2.3-7
qstat   2.11-3
readline-common 6.2+dfsg-0.1
reportbug       6.4.4+deb7u1
rpcbind 0.2.0-8
rsyslog 5.8.11-3+deb7u2
ruby1.9.1       1.9.3.194-8.1+deb7u2
samba-common    2:3.6.6-6+deb7u4
screen  4.1.0~20120320gitdb59704-7
sed     4.2.1-10
sendemail       1.56-2
sensible-utils  0.0.7
sgml-base       1.26+nmu4
shared-mime-info        1.0-1+b1
smistrip        0.4.8+dfsg2-7
snmp    5.4.3~dfsg-2.8+deb7u1
snmp-mibs-downloader    1.1
snmpd   5.4.3~dfsg-2.8+deb7u1
snmptt  1.3-2
ssl-cert        1.0.32
sudo    1.8.5p2-1+nmu2
sysv-rc 2.88dsf-41+deb7u1
sysvinit        2.88dsf-41+deb7u1
sysvinit-utils  2.88dsf-41+deb7u1
tar     1.26+dfsg-0.1
task-english    3.14.1
task-ssh-server 3.14.1
tasksel 3.14.1
tasksel-data    3.14.1
tcpd    7.6.q-24
tcpdump 4.3.0-1+deb7u2
telnet  0.17-36
texinfo 4.13a.dfsg.1-10
tftpd   0.17-18
time    1.7-24
traceroute      1:2.0.18-3
ttf-dejavu-core 2.33-3
tzdata  2015b-0wheezy1
ucf     3.0025+nmu3
udev    175-7.2
update-inetd    4.43
usbutils        1:005-3
util-linux      2.20.1-5.3
util-linux-locales      2.20.1-5.3
vim     2:7.3.547-7
vim-common      2:7.3.547-7
vim-runtime     2:7.3.547-7
vim-tiny        2:7.3.547-7
w3m     0.5.3-8
wamerican       7.1-1
wget    1.13.4-3+deb7u2
whiptail        0.52.14-11.1
whois   5.1.1~deb7u1
x11proto-core-dev       7.0.23-1
x11proto-input-dev      2.2-1
x11proto-kb-dev 1.0.6-2
xauth   1:1.0.7-1
xkb-data        2.5.1-3
xml-core        0.13+nmu2
xorg-sgml-doctools      1:1.10-1
xtrans-dev      1.2.7-1
xz-utils        5.1.1alpha+20120614-2
zlib1g  1:1.2.7.dfsg-13
zlib1g-dev      1:1.2.7.dfsg-13
I don't know does it matter, but the system is installed on a virtual machine running on vmware esxi 5.5
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: ndo2db don't write anything to datadase

Post by ssax »

Might want to try to recompile it and see if that will help, save the output of those commands in a text file and attach that.

make clean
./configure
make
make install
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: ndo2db don't write anything to datadase

Post by jolson »

I copied your configuration files to my test Nagios Core machine, and everything works fine as configured. There are only a few places this could be failing, and I think that the most likely place is the ndomod.o binary. Could you please check the md5sum of your binary file to ensure that it matches mine?

Code: Select all

md5sum /usr/local/nagios/bin/ndomod.o
37ea1bbaceeef5d39c3acd7b09695879  /usr/local/nagios/bin/ndomod.o
If not, it's possible that you may need to use a different binary.

Code: Select all

ll /usr/local/nagios/bin/
total 1276
-rwxrwxr--. 1 nagios nagios  40017 Apr  2 06:56 file2sock
-rwxrwxr--. 1 nagios nagios  41743 Apr  2 06:56 log2ndo
-rwxrwxr--. 1 nagios nagios 676672 Mar 16 07:28 nagios
-rwxrwxr--. 1 nagios nagios  36896 Mar 16 07:28 nagiostats
-rwxr-xr-x. 1 nagios nagios 285293 Apr  2 06:56 ndo2db
-rwxr-xr-x. 1 nagios nagios 175450 Apr  2 06:56 ndomod.o
-rwxrwxr--. 1 nagios nagios  36141 Apr  2 06:56 sockdebug

Code: Select all

ll /usr/local/nagios/etc/
total 84
-rw-rw-r--. 1 nagios nagios 12033 Apr 15 04:54 cgi.cfg
-rw-r--r--. 1 root   root      49 Apr 15 04:49 htpasswd.users
-rw-rw-r--. 1 nagios nagios 44022 Apr  2 10:45 nagios.cfg
-rw-------. 1 root   root    4692 Apr 21 06:05 ndo2db.cfg
-rw-------. 1 nagios nagios  5045 Apr 21 06:04 ndomod.cfg
drwxrwxr-x. 2 nagios nagios  4096 Mar 18 10:41 objects
-rw-rw----. 1 nagios nagios  1312 Mar 16 07:28 resource.cfg
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
adengin
Posts: 15
Joined: Tue Feb 03, 2015 7:51 am
Location: Petrozavodsk, Russia

Re: ndo2db don't write anything to datadase

Post by adengin »

jolson, here are md5 sums, it differs from your.

Code: Select all

root@nagios:/usr/local/nagios/bin# md5sum ndo*
e273a95f0127ac20d440c55f8732cd41  ndo2db
7e54cc3431fd2e8b147e9e0785872804  ndomod-4x.o
7e54cc3431fd2e8b147e9e0785872804  ndomod.o
ssax, the configure log of my current installation attached to this post. Also i attached the configure log of ndoutils installation.
Attachments
ndoutils-config.log
(60.86 KiB) Downloaded 214 times
nagios-config.log
(58.62 KiB) Downloaded 179 times
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: ndo2db don't write anything to datadase

Post by jolson »

Regarding the different md5 sums - I do not think that is relevant to what's happening on your box. You are free to try my binaries, which are attached to this post.

To recap, I'd like to see everything as it's currently running so that I can reproduce this on an Ubuntu box in house.

Code: Select all

cat /etc/*release*

Code: Select all

uname -a

Code: Select all

cd /usr/local/nagios && cat etc/ndo* && cat etc/nagios.cfg && cat /etc/passwd && cat /etc/group && ls -l -R | tee /tmp/output.txt
Please provide me with the file '/tmp/output.txt'.

If it's still in your history, please show me how you compiled ndomod on this server, and which flags you used:

Code: Select all

history
You're still not seeing anything in ndo2db.debug, correct?

Code: Select all

cat /usr/local/nagios/var/ndo2db.debug
Also, nothing in MySQL?

Code: Select all

echo "select * from nagios_services \G;" | mysql -pexamplepassword nagios
Thanks - I look forward to your response.
Attachments
ndobins.zip
(164.42 KiB) Downloaded 182 times
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
adengin
Posts: 15
Joined: Tue Feb 03, 2015 7:51 am
Location: Petrozavodsk, Russia

Re: ndo2db don't write anything to datadase

Post by adengin »

Hi, jolson! Thank you for help!

I can not use your binaries:

Code: Select all

[1429770794] Error: Failed to load module '/usr/local/nagios/bin/ndomod.o'.
[1429770794] Error: Module loading failed. Aborting.

Code: Select all

root@nagios:/usr/local/nagios/bin# ./ndo2db
-bash: ./ndo2db: cannot execute binary file

Code: Select all

root@nagios:/usr/local/nagios/bin# ls -la
total 2064
drwxrwsr-x  2 nagios nagios   4096 Apr 23 09:30 .
drwxr-sr-x 11 root   staff    4096 Apr 21 09:00 ..
-rwxrwxr--  1 nagios nagios  38295 Mar 31 17:45 file2sock
-rwxrwxr--  1 nagios nagios  40359 Mar 31 17:45 log2ndo
-rwxrwxr--  1 nagios nagios 684440 Mar 23 12:14 nagios
-rwxrwxr--  1 nagios nagios  36876 Mar 23 12:14 nagiostats
-rwxrwxrwx  1 nagios nagios 285293 Apr 23 00:42 ndo2db
-rwxr-xr-x  1 nagios nagios 276780 Apr 23 09:30 ndo2db_old
-rwxr-xr-x  1 nagios nagios 180239 Mar 30 18:16 ndomod-4x.o
-rwxrwxr-x  1 nagios nagios 175450 Apr 23 00:42 ndomod.o
-rwxr-xr-x  1 nagios nagios 180239 Apr 23 09:30 ndomod.o_old
-rwxrwxr-x  1 nagios nagios 143564 Mar  4 16:19 nrpe
-rwxrwxr--  1 nagios nagios  35383 Mar 31 17:45 sockdebug
Further information about my system:

Code: Select all

root@nagios:/usr/local/nagios/bin# cat /etc/*release*
PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
NAME="Debian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"

Code: Select all

root@nagios:/usr/local/nagios/bin# uname -a
Linux nagios.lvs.ru 3.2.0-4-686-pae #1 SMP Debian 3.2.65-1+deb7u2 i686 GNU/Linux

Code: Select all

root@nagios:/usr/local/nagios# ls -la /usr/local/nagios/var/ndo2db.debug        -rwxrwxrwx 1 nagios nagios 0 Mar 31 14:52 /usr/local/nagios/var/ndo2db.debug

Code: Select all

root@nagios:/usr/local/nagios# mysql -u nagios -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.5.41-0+wheezy1-log (Debian)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use nagios;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from nagios_services;
Empty set (0.00 sec)

mysql>
output.txt is attached to this post.
Last edited by adengin on Fri Apr 24, 2015 1:37 am, edited 1 time in total.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: ndo2db don't write anything to datadase

Post by jdalrymple »

I guess either I never noticed or didn't ask about this being Debian...

is apparmor enabled?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: ndo2db don't write anything to datadase

Post by jolson »

I got this to work on a test system using your version, so there should be no issues.

Okay - let's start clean. I suggest you stop nagios/ndo2db and remove your ndo files:

Code: Select all

service nagios stop
service ndo2db stop

Code: Select all

rm /usr/local/nagios/bin/ndo*
rm /usr/local/nagios/etc/ndo*
Go back to your ndoutils directory and clean out your current configure:

Code: Select all

cd /tmp/ndoutils-2.0.0
make devclean
Run configure with the following flags:

Code: Select all

 ./configure --prefix=/usr/local/nagios/ --enable-mysql --disable-pgsql --with-ndo2db-user=nagios -with-ndo2db-group=nagcmd
Are there any errors with that configure? I had to install a mysql lib to get Debian to see mysql properly. That lib can be installed as follows:

Code: Select all

apt-get install libmysqlclient*
After the configuration is done and there are no errors, please copy the binaries:

Code: Select all

cp ./src/ndomod-4x.o /usr/local/nagios/bin/ndomod.o
cp ./src/ndo2db-4x /usr/local/nagios/bin/ndo2db
Appropriate permissions:

Code: Select all

chmod 774 /usr/local/nagios/bin/ndo*
chown nagios:nagios /usr/local/nagios/bin/ndo*
Copy example config files:

Code: Select all

cp ./config/ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg
cp ./config/ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg
Modify ndo2db.cfg to have the proper database password. Leave all other variables alone.

Insert the following line into nagios.cfg:

Code: Select all

 broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
Fingers crossed:

Code: Select all

service ndo2db restart
service nagios restart
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked