Page 1 of 1

Nagios core 4 n centos 6 not populating host and service tab

Posted: Wed Sep 20, 2017 11:32 am
by Daithi
After a system crash I couldn't find the files for our old version of Nagios (ver 3)
so I installed version 4 and associated packages. It seems to be working OK but
there are several MySQL tables that are empty i.e. nagios_hosts and nagios_services
These have data:
nagios_commands
nagios_commenthistory
nagios_comments
nagios_configfilevariables
nagios_conninfo
nagios_contact_notificationcommands
nagios_contacts
nagios_contactstatus
nagios_externalcommands
nagios_hostchecks
nagios_hoststatus
nagios_logentries
nagios_objects
nagios_processevents
nagios_servicechecks
nagios_servicestatus
nagios_timeperiods
nagios_timeperiod_timeranges

All other tables are empty. I have set event_broker_options=-1 in nagios.cfg but it doesn't seem to affect this problem

CentOS release 6.5
nagios-4.3.2-5.el6.x86_64
nagios-common-4.3.2-5.el6.x86_64
nsca-2.7.2-8.el6.x86_64
ndoutils-1.5.2-1.el6.x86_64
ndoutils-mysql-1.5.2-1.el6.x86_64

Any help or suggestions welcomed!

Thanks
Dave Gavin

Re: Nagios core 4 n centos 6 not populating host and service

Posted: Wed Sep 20, 2017 1:57 pm
by dwasswa
When you installed Nagios 4 was it a clean installe or you installed it on top of the crashed Nagios 3 server?

Also,did you backup your old Nasgios 3 server before it crashed?

Re: Nagios core 4 n centos 6 not populating host and service

Posted: Wed Sep 20, 2017 3:21 pm
by Daithi
It's a cloud server and has other functions so I can't flush it.
I have saved the configuration files for reference and I have several backups.

Thanks,
Dave

Re: Nagios core 4 n centos 6 not populating host and service

Posted: Wed Sep 20, 2017 3:24 pm
by Daithi
I just checked with the guy who runs the other functions and as as they feed off the nagios database tables we can back everything up and rebuild the server if it really makes that much of a difference, I've seen this warning on most of the nagios discussions I've found so I guess it must be an issue.

Re: Nagios core 4 n centos 6 not populating host and service

Posted: Wed Sep 20, 2017 4:36 pm
by dwasswa
Okay lets try repairing this database;follow the steps below:

1.

Code: Select all

service mysqld stop
2.

Code: Select all

cd /var/lib/mysql/nagios
3.

Code: Select all

myisamchk -r -f nagios_<corrupted_table>
4.

Code: Select all

service mysqld start

Re: Nagios core 4 n centos 6 not populating host and service

Posted: Wed Sep 27, 2017 1:28 pm
by Daithi
It turns out that nagios stopped writing host and service info to the database tables in version 3, they use retention.dat and status.dat, flushing the memory data periodically and before shutdown. nagios xi has returned to using the hosts and services db tables so I guess we'll just have to pay the price to continue using nagios.

Thanks for the help
Dave

Re: Nagios core 4 n centos 6 not populating host and service

Posted: Wed Sep 27, 2017 1:58 pm
by npolovenko
@Daithi, Glad you figured out this issue. Let us know if you need any other questions.