I have been using Nagios 4.0.8 for a some time. Recently I have to install NDOUtils 2.0 to save all nagios data in database.
It have been installed without any errors. But ndo2db don't fill the database.
In the Nagios Log i see that NDOMOD starts properly:
Code: Select all
[1427869955] ndomod: NDOMOD 2.0.0 (02-28-2014) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1427869955] ndomod: Successfully connected to data sink. 0 queued items to flush.
[1427869955] ndomod registered for process data
[1427869955] ndomod registered for timed event data
[1427869955] ndomod registered for log data'
[1427869955] ndomod registered for system command data'
[1427869955] ndomod registered for event handler data'
[1427869955] ndomod registered for notification data'
[1427869955] ndomod registered for service check data'
[1427869955] ndomod registered for host check data'
[1427869955] ndomod registered for comment data'
[1427869955] ndomod registered for downtime data'
[1427869955] ndomod registered for flapping data'
[1427869955] ndomod registered for program status data'
[1427869955] ndomod registered for host status data'
[1427869955] ndomod registered for service status data'
[1427869955] ndomod registered for adaptive program data'
[1427869955] ndomod registered for adaptive host data'
[1427869955] ndomod registered for adaptive service data'
[1427869955] ndomod registered for external command data'
[1427869955] ndomod registered for aggregated status data'
[1427869955] ndomod registered for retention data'
[1427869955] ndomod registered for contact data'
[1427869955] ndomod registered for contact notification data'
[1427869955] ndomod registered for acknowledgement data'
[1427869955] ndomod registered for contact status data'
[1427869955] ndomod registered for adaptive contact data'
[1427869955] Event broker module '/usr/local/nagios/bin/ndomod-4x.o' initialized successfully.
[1427869955] Successfully launched command file worker with pid 7527
[1427870144] ndomod: Error writing to data sink! Some output may get lost...
[1427870144] ndomod: Please check remote ndo2db log, database connection or SSL Parameters
[1427870160] ndomod: Successfully reconnected to data sink! 0 items lost, 69 queued items to flush.
[1427870160] ndomod: Successfully flushed 69 queued items to data sink.
Code: Select all
root@nagios:~# ps aux | grep -v grep | grep "ndo2db"
nagios 7656 0.0 0.0 6848 528 ? Ss 09:35 0:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
Code: Select all
root@nagios:~# mysql -u nagios -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 112
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> SHOW GRANTS FOR nagios@localhost;
+---------------------------------------------------------------------------------------------------------------+
| Grants for nagios@localhost |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'nagios'@'localhost' IDENTIFIED BY PASSWORD '****************************' |
| GRANT ALL PRIVILEGES ON `nagios`.* TO 'nagios'@'localhost' |
+---------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> select * from nagios_instances;
Empty set (0.01 sec)
Linux version 3.2.0-4-686-pae (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.65-1+deb7u1
nagios-4.0.8
ndoutils-2.0.0
mysql-server 5.5.41-0
libmysqlclient-dev 5.5.41
Here is my config files:
nagios.cfg:
Code: Select all
event_broker_options=-1
broker_module=/usr/local/nagios/bin/ndomod-4x.o config_file=/usr/local/nagios/etc/ndomod.cfg
Code: Select all
instance_name=default
output_type=tcpsocket
output=127.0.0.1
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
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_options=1
Code: Select all
lock_file=/usr/local/nagios/var/ndo2db.lock
ndo2db_user=nagios
ndo2db_group=*****
socket_type=tcp
tcp_port=5668
use_ssl=0
db_servertype=mysql
db_host=127.0.0.1
db_port=3306
db_name=nagios
db_prefix=nagios_
db_user=nagios
db_pass=******
max_timedevents_age=1440
max_systemcommands_age=10080
max_servicechecks_age=10080
max_hostchecks_age=10080
max_eventhandlers_age=44640
max_externalcommands_age=44640
max_notifications_age=44640
max_contactnotifications=44640
max_contactnotificationmethods=44640
max_logentries_age=129600
max_acknowledgements_age=44640
debug_level=-1
debug_verbosity=2
debug_file=/usr/local/nagios/var/ndo2db.debug
max_debug_file_size=1000000
If i start tcpdump i see a traffic flow in tcp:5668 socket, but nothing in tcp:3306 socket.
Here is the file permissions:
Code: Select all
root@nagios:~# ls -ls /usr/local/nagios/etc/
total 88
12 -rw-rw-r-- 1 nagios nagios 11945 Feb 13 12:26 cgi.cfg
4 -rw-r--r-- 1 nagios nagcmd 50 Feb 2 17:22 htpasswd.users
48 -rw-rw-r-- 1 nagios nagios 45222 Mar 31 16:37 nagios.cfg
8 -rwxrwxrwx 1 nagios nagios 4829 Apr 1 09:31 ndo2db.cfg
8 -rw------- 1 nagios nagios 5104 Mar 31 20:15 ndomod.cfg
4 drwxrwsr-x 2 nagios nagios 4096 Mar 31 20:17 objects
4 -rw-rw---- 1 nagios nagios 1312 Feb 2 17:19 resource.cfg
root@nagios:~# ls -ls /usr/local/nagios/var/
total 1164
4 drwxrwsr-x 2 nagios nagios 4096 Mar 31 23:59 archives
4 -rw-r--r-- 1 nagios nagios 1527 Apr 1 09:32 nagios.configtest
4 -rw-r--r-- 1 nagios nagios 5 Apr 1 09:32 nagios.lock
40 -rw-r--r-- 1 nagios nagios 40193 Apr 1 09:51 nagios.log
0 -rwxrwxrwx 1 nagios nagios 0 Mar 31 14:52 ndo2db.debug
4 -rw-r--r-- 1 nagios nagios 5 Apr 1 09:35 ndo2db.lock
4 -rw-r--r-- 1 nagios nagios 6 Mar 31 20:13 ndo2db.run
0 -rw-r--r-- 1 nagios nagios 0 Apr 1 09:32 ndomod.tmp
212 -rw-r--r-- 1 nagios nagios 214522 Apr 1 09:32 objects.cache
212 -rw-r--r-- 1 nagios nagios 214522 Apr 1 09:32 objects.precache
336 -rw------- 1 nagios nagios 343342 Apr 1 09:32 retention.dat
4 drwxrwsr-x 2 nagios nagcmd 4096 Apr 1 09:32 rw
4 drwxrwsr-x 3 root nagios 4096 Feb 2 17:19 spool
336 -rw-rw-r-- 1 nagios nagios 342232 Apr 1 09:53 status.dat
root@nagios:~# ls -la /usr/local/nagios/bin/
total 1612
drwxrwsr-x 2 nagios nagios 4096 Mar 31 17:45 .
drwxr-sr-x 11 root staff 4096 Mar 25 17:18 ..
-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
-rwxr-xr-x 1 nagios nagios 276780 Mar 31 17:45 ndo2db
-rwxr-xr-x 1 nagios nagios 180239 Mar 30 18:16 ndomod-4x.o
-rwxr-xr-x 1 nagios nagios 180239 Mar 31 17:45 ndomod.o
-rwxrwxr-x 1 nagios nagios 143564 Mar 4 16:19 nrpe
-rwxrwxr-- 1 nagios nagios 35383 Mar 31 17:45 sockdebug
I would be grateful for any help!
Thank you!