All mysql nagios tables are Empty

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.
deepak_symphony
Posts: 37
Joined: Wed Jan 28, 2015 4:18 pm
Location: India

Re: All mysql nagios tables are Empty

Post by deepak_symphony »

lnx0202:root# ll /usr/local/nagios/var/
total 900
drwxr-xr-x 2 nagios nagios 4096 Jan 29 23:59 archives
-rwxr-xr-x 1 nagios nagios 13512 Jan 29 14:41 host-perfdata
-rwxr-xr-x 1 nagios nagios 13092 Jan 29 14:41 host-perfdata.out
-rw-r--r-- 1 nagios nagios 34 Jan 30 13:20 nagios.configtest
-rw-r--r-- 1 nagios nagios 6 Jan 30 13:20 nagios.lock
-rwxr-xr-x 1 nagios nagios 46037 Jan 30 13:21 nagios.log
-rwxr-xr-x 1 nagios nagios 149251 Jan 29 23:39 nagios.log_old
-rwxr-xr-x 1 nagios nagios 0 Jan 22 15:31 ndo2db.debug
-rwxr-xr-x 1 nagios nagios 5 Jan 29 17:11 ndo2db.lock
-rwxr-xr-x 1 nagios nagios 0 Jan 29 15:43 ndomod.tmp
srwxrwxr-x 1 nagios nagios 0 Jan 29 17:11 ndo.sock
srwxr-xr-x 1 nagios nagios 0 Jan 20 12:00 ndo.sock_back
-rwxr-xr-x 1 nagios nagios 83145 Jan 30 13:20 objects.cache
-rwxr-xr-x 1 nagios nagios 83145 Jan 30 13:20 objects.precache
-rw------- 1 nagios nagios 130415 Jan 30 13:20 retention.dat
drwxr-sr-x 2 nagios nagios 4096 Jan 30 13:21 rw
-rwxr-xr-x 1 nagios nagios 101976 Jan 29 14:41 service-perfdata
-rwxr-xr-x 1 nagios nagios 97992 Jan 29 14:41 service-perfdata.out
drwxr-xr-x 3 nagios nagios 4096 Dec 10 06:22 spool
-rw-rw-r-- 1 nagios nagios 130072 Jan 30 13:32 status.dat
lnx0202:root# ll /usr/local/nagios/var/rw
total 0
prw-rw---- 1 nagios nagios 0 Jan 30 13:21 nagios.cmd
srw-rw---- 1 nagios nagios 0 Jan 30 13:20 nagios.qh
Configured ndoutils in nagios but all mysql nagios tables are empty
deepak_symphony
Posts: 37
Joined: Wed Jan 28, 2015 4:18 pm
Location: India

Re: All mysql nagios tables are Empty

Post by deepak_symphony »

I changed permission and restarted nagios:
Getting below error:

lnx0202:root# tail -f /usr/local/nagios/var/nagios.log
[1422647157] wproc: Registry request: name=Core Worker 18081;pid=18081
[1422647157] wproc: Registry request: name=Core Worker 18083;pid=18083
[1422647157] wproc: Registry request: name=Core Worker 18082;pid=18082
[1422647157] wproc: Registry request: name=Core Worker 18085;pid=18085
[1422647157] ndomod: NDOMOD 2.0.0 (02-28-2014) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1422647157] ndomod: Could not open data sink! I'll keep trying, but some output may get lost...
[1422647157] ndomod registered for contact data'
[1422647157] ndomod registered for contact notification data'
[1422647157] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1422647159] Successfully launched command file worker with pid 18161
Configured ndoutils in nagios but all mysql nagios tables are empty
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: All mysql nagios tables are Empty

Post by scottwilkerson »

is ndo2db service running?

Code: Select all

service ndo2db status
is mysqld service running?

Code: Select all

service mysqld status
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
deepak_symphony
Posts: 37
Joined: Wed Jan 28, 2015 4:18 pm
Location: India

Re: All mysql nagios tables are Empty

Post by deepak_symphony »

lnx0202:root# service mysqld status
mysqld (pid 8526) is running...
lnx0202:root# ps -ef | grep ndo2db
nagios 8473 1 0 Jan29 ? 00:00:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
root 18745 26330 0 13:53 pts/2 00:00:00 grep ndo2db
Configured ndoutils in nagios but all mysql nagios tables are empty
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: All mysql nagios tables are Empty

Post by scottwilkerson »

finally lets do a tail of the syslog and grep for ndo2db to see if we are having any errors there

I'm assuming you are still seeing nothing in and of the tables of the nagios DB
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
deepak_symphony
Posts: 37
Joined: Wed Jan 28, 2015 4:18 pm
Location: India

Re: All mysql nagios tables are Empty

Post by deepak_symphony »

I cant see any errors.

lnx0202:root# tail -f /var/log/messages
Jan 30 15:05:13 lnx0202 snmpd[1833]: Connection from UDP: [171.74.58.58]:56488->[10.106.10.197]
Jan 30 15:05:13 lnx0202 snmpd[1833]: Connection from UDP: [171.74.58.58]:56488->[10.106.10.197]
Jan 30 15:05:13 lnx0202 snmpd[1833]: Connection from UDP: [171.74.58.58]:56488->[10.106.10.197]
Jan 30 15:05:13 lnx0202 snmpd[1833]: Connection from UDP: [171.74.58.58]:56488->[10.106.10.197]
Jan 30 15:05:13 lnx0202 snmpd[1833]: Connection from UDP: [171.74.58.58]:56488->[10.106.10.197]
Jan 30 15:05:13 lnx0202 snmpd[1833]: Connection from UDP: [171.74.58.58]:56488->[10.106.10.197]
Jan 30 15:05:13 lnx0202 snmpd[1833]: Connection from UDP: [171.74.58.58]:56488->[10.106.10.197]
Jan 30 15:05:13 lnx0202 snmpd[1833]: Connection from UDP: [171.74.58.58]:56488->[10.106.10.197]
Jan 30 15:05:13 lnx0202 snmpd[1833]: Connection from UDP: [171.74.58.58]:56488->[10.106.10.197]
Jan 30 15:05:13 lnx0202 snmpd[1833]: Connection from UDP: [171.74.58.58]:56488->[10.106.10.197]
^C
lnx0202:root# tail -f /var/log/messages | grep ndodb
Configured ndoutils in nagios but all mysql nagios tables are empty
deepak_symphony
Posts: 37
Joined: Wed Jan 28, 2015 4:18 pm
Location: India

Re: All mysql nagios tables are Empty

Post by deepak_symphony »

Still all tables are empty:
Logs can see this:
lnx0202:root# tail -f /usr/local/nagios/var/nagios.log
[1422647773] wproc: Registry request: name=Core Worker 18923;pid=18923
[1422647773] wproc: Registry request: name=Core Worker 18925;pid=18925
[1422647773] ndomod: NDOMOD 2.0.0 (02-28-2014) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1422647773] ndomod: Could not open data sink! I'll keep trying, but some output may get lost...
[1422647773] ndomod registered for contact data'
[1422647773] ndomod registered for contact notification data'
[1422647773] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1422647775] Successfully launched command file worker with pid 18927
[1422651372] Auto-save of retention data completed successfully.
Configured ndoutils in nagios but all mysql nagios tables are empty
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: All mysql nagios tables are Empty

Post by scottwilkerson »

Can you confirm that your /usr/local/nagios/etc/ndo2db.cfg has correct credentials, and that you can make a connection via mysql from the command line with those credentials.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
deepak_symphony
Posts: 37
Joined: Wed Jan 28, 2015 4:18 pm
Location: India

Re: All mysql nagios tables are Empty

Post by deepak_symphony »

Hi,
Provided correct db user name and password but still same issue:

lnx0202:root# mysql -u nagios -p nagios
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.1.66 Source distribution

Copyright (c) 2000, 2012, 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>

ndo2db.cfg:

lnx0202:root# egrep -v "^#|^$" ndo2db.cfg
lock_file=/usr/local/nagios/var/ndo2db.lock
ndo2db_user=nagios
ndo2db_group=nagios
socket_type=unix
socket_name=/usr/local/nagios/var/ndo.sock
tcp_port=5668
use_ssl=0
db_servertype=mysql
db_host=10.106.10.197
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
max_notifications_age=44640
max_contactnotifications=44640
max_contactnotificationmethods=44640
max_logentries_age=129600
max_acknowledgements_age=44640
debug_level=-1
debug_verbosity=1
debug_file=/usr/local/nagios/var/ndo2db.debug
max_debug_file_size=1000000
Configured ndoutils in nagios but all mysql nagios tables are empty
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: All mysql nagios tables are Empty

Post by tgriep »

Can you run this command and post the output?

Code: Select all

ll /usr/local/nagios/etc/
Are there any errors in the ndo2db.debug log file?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked