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.
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 »

For "priority" support for Nagios Core, please see:
http://www.nagios.com/services/support/coresupportplans


That said, I looked back through the 5 pages in this thread and I see a bunch of mixed items, in some posts you are showing config files connecting to a mysql server on 10.106.10.197 on others you show localhost, in some threads you are showing mysqld logs from the same machine that is your nagios machine but have the DB linked to a different server...

So here is the questions:

What are you trying to accomplish?
Is the correct table structure setup on the database server?
Have you verified that the database server, and the user you are using to connect, actually has the appropriate permissions on that server to write to the nagios database?

Can you verify that when you start ndo2db it is actually making the connection to the remote mysql server?

Also, make sure on the nagios server in /etc/sysctl.conf you have

Code: Select all

 kernel.msgmni = 256000
then

Code: Select all

sysctl -p
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
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,

As i mentioned before 10.106.10.197 is ip address of localhost and for trail and error method we provide ip instead of localhost and tested but it didn't work.
Also correct tables are set-up in database server, user nagios had the full privilege and able to connect.
And there is no remote mysql server both nagios and mysql server are in a same box.
As from past we tried all options suggested by you guys but still the same issue all nagios tables are empty.

Please find the details below:

Nagios Privilege:

mysql> SHOW GRANTS FOR CURRENT_USER;
+---------------------------------------------------------------------------------------------------------------+
| Grants for nagios@localhost |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'nagios'@'localhost' IDENTIFIED BY PASSWORD '*82802C50A7A5CDFDEA2653A1503FC4B8939C4047' |
| GRANT ALL PRIVILEGES ON `nagios`.* TO 'nagios'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE ON `ndo`.* TO 'nagios'@'localhost' |
+---------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

Nagios tables:

mysql> show tables;
+----------------------------------------+
| Tables_in_nagios |
+----------------------------------------+
| nagios_acknowledgements |
| nagios_commands |
| nagios_commenthistory |
| nagios_comments |
| nagios_configfiles |
| nagios_configfilevariables |
| nagios_conninfo |
| nagios_contact_addresses |
| nagios_contact_notificationcommands |
| nagios_contactgroup_members |
| nagios_contactgroups |
| nagios_contactnotificationmethods |
| nagios_contactnotifications |
| nagios_contacts |
| nagios_contactstatus |
| nagios_customvariables |
| nagios_customvariablestatus |
| nagios_dbversion |
| nagios_downtimehistory |
| nagios_eventhandlers |
| nagios_externalcommands |
| nagios_flappinghistory |
| nagios_host_contactgroups |
| nagios_host_contacts |
| nagios_host_parenthosts |
| nagios_hostchecks |
| nagios_hostdependencies |
| nagios_hostescalation_contactgroups |
| nagios_hostescalation_contacts |
| nagios_hostescalations |
| nagios_hostgroup_members |
| nagios_hostgroups |
| nagios_hosts |
| nagios_hoststatus |
| nagios_instances |
| nagios_logentries |
| nagios_notifications |
| nagios_objects |
| nagios_processevents |
| nagios_programstatus |
| nagios_runtimevariables |
| nagios_scheduleddowntime |
| nagios_service_contactgroups |
| nagios_service_contacts |
| nagios_service_parentservices |
| nagios_servicechecks |
| nagios_servicedependencies |
| nagios_serviceescalation_contactgroups |
| nagios_serviceescalation_contacts |
| nagios_serviceescalations |
| nagios_servicegroup_members |
| nagios_servicegroups |
| nagios_services |
| nagios_servicestatus |
| nagios_statehistory |
| nagios_systemcommands |
| nagios_timedeventqueue |
| nagios_timedevents |
| nagios_timeperiod_timeranges |
| nagios_timeperiods |
+----------------------------------------+
60 rows in set (0.00 sec)


And in Error file we can see below details:

[1424333787] ndomod: Successfully connected to data sink. 0 queued items to flush.
[1424333787] ndomod registered for timed event data
[1424333787] ndomod registered for log data'
[1424333787] ndomod registered for system command data'
[1424333787] ndomod registered for event handler data'
[1424333787] ndomod registered for notification data'
[1424333787] ndomod registered for service check data'
[1424333787] ndomod registered for host check data'
[1424333787] ndomod registered for comment data'
[1424333787] ndomod registered for downtime data'
[1424333787] ndomod registered for flapping data'
[1424333787] ndomod registered for program status data'
[1424333787] ndomod registered for host status data'
[1424333787] ndomod registered for service status data'
[1424333787] ndomod registered for adaptive program data'
[1424333787] ndomod registered for adaptive host data'
[1424333787] ndomod registered for adaptive service data'
[1424333787] ndomod registered for external command data'
[1424333787] ndomod registered for aggregated status data'
[1424333787] ndomod registered for retention data'
[1424333787] ndomod registered for contact data'
[1424333787] ndomod registered for contact notification data'
[1424333787] ndomod registered for acknowledgement data'
[1424333787] ndomod registered for contact status data'
[1424333787] ndomod registered for adaptive contact data'
[1424333787] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1424333789] Successfully launched command file worker with pid 5451
[1424334606] ndomod: Error writing to data sink! Some output may get lost...
[1424334606] ndomod: Please check remote ndo2db log, database connection or SSL Parameters
[1424334618] SERVICE NOTIFICATION: nagiosadmin;win0004.ch3.prod.i.com;BWS - Internal-win0004;CRITICAL;notify-service-by-email;CRITICAL - Socket timeout after 10 seconds
[1424334622] ndomod: Still unable to reconnect to data sink. 0 items lost, 121 queued items to flush.
[1424334638] ndomod: Successfully reconnected to data sink! 0 items lost, 266 queued items to flush.
[1424334638] ndomod: Successfully flushed 266 queued items to data sink.
[1424334776] Caught SIGTERM, shutting down...
[1424334776] Successfully shutdown... (PID=5441)
[1424334776] Event broker module 'NERD' deinitialized successfully.
[1424334776] ndomod: Shutdown complete.
[1424334776] Event broker module '/usr/local/nagios/bin/ndomod.o' deinitialized successfully.
[1424334777] Nagios 4.0.8 starting... (PID=10586)
[1424334777] Local time is Thu Feb 19 02:32:57 CST 2015
[1424334777] LOG VERSION: 2.0
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 »

deepak_symphony wrote:As i mentioned before 10.106.10.197 is ip address of localhost and for trail and error method we provide ip instead of localhost and tested but it didn't work.
That makes a difference, you need to revert you ndo2db.cfg to be localhost and then restart the service. If it tries to connect to 10.106.10.197 it is going to make a TCP connection, vs a socket connection.

We had fixed some other issues earlier in the thread, but you had already switched to IP.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
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,

We changed to localhost and tried but still its same only.
All database tables are empty.
We tested by providing dummy values in ndo2db.cfg file and started but it didn't gave any error whereas if we change datatype value in ndo2db.cfg and start the ndo2db it will throw an error say processing error.
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 »

scottwilkerson wrote: Also, make sure on the nagios server in /etc/sysctl.conf you have

Code: Select all

 kernel.msgmni = 256000
then

Code: Select all

sysctl -p
Did you do this?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
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# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
kernel.msgmnb = 131072000
kernel.msgmax = 131072000
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.msgmni = 256000
Configured ndoutils in nagios but all mysql nagios tables are empty
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: All mysql nagios tables are Empty

Post by abrist »

Can you post a large tail of the ndo2db.debug file? (you may need to enable logging in ndo2db.cfg - also, increase the debug level)

Code: Select all

tail -50 /usr/local/nagios/var/ndo2db.debug
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
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,

As we discussed earlier we enabled debug but debug file is empty.
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 »

deepak_symphony wrote:Hi,

As we discussed earlier we enabled debug but debug file is empty.
Have you restarted ndo2db since then?

Code: Select all

service ndo2db restart
If the file is still empty, and debug is on, I would have to believe your ndo2db is using a different configuration file than the one you are editing...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
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,

After restart also its same, debug file is empty.
Configured ndoutils in nagios but all mysql nagios tables are empty
Locked