Page 1 of 2

Not able to apply configuration after Mysql Offload

Posted: Thu Feb 04, 2016 1:07 pm
by ellism
A little history:
I have installed the latest Nagioxi on RedHat 6.7 as and evaluation prior to doing this with the production system. I have also created a separate VM with RedHat 6.7 and MySQl 5.7.10. I then followed the NagiosXi offload MySQL to remote server and things seemed to work OK. I could login, did a check configuration no issues. Now when I try to add just one host via the configuration wizard, it finds the host correctly but when I try to apply the configuration it fails every time. I have checked all the files you have to change for the offload multiple times, and I see not issues.

Tells me I have no service defined. If I go to the "Services" selection, all the hosts I had defined and loaded in to Nagiosxi are there and it says " Changes detected! Apply Configuration for new changes to take affect" When I select the "Apply Configuration" button it fails.

Any ideas or help. I have looked on the forum and loads of folks seem to have issues with offloading the Mysql database. Any help would be appreciated.

Re: Not able to apply configuration after Mysql Offload

Posted: Thu Feb 04, 2016 3:33 pm
by rkennedy
Does the Nagios server have proper access to the remote SQL DB (possible IP restriction)?

Re: Not able to apply configuration after Mysql Offload

Posted: Fri Feb 05, 2016 9:56 am
by ellism
Yes. I made sure iptables is off on both servers. Also when I do a "ss dport == 3306" I can see all the connections to the remote mySQL database.

Re: Not able to apply configuration after Mysql Offload

Posted: Fri Feb 05, 2016 12:55 pm
by lmiltchev
Can you verify that the date/time is synced between these two servers? Run the following commands from the CLI on the Nagios XI server and show the output in code wraps:

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
grep server /var/www/html/nagiosql/config/settings.php
echo 'select now();'|mysql -t -u <username> -p<password> -h <remote ip>
echo 'show tables;'|mysql -t -u <username> -p<password> -h <remote ip>
echo 'select count(*) from nagios_hosts;'|mysql -t -u <username> -p<password> nagios -h <remote ip>
echo 'select count(*) from nagios_services;'|mysql -t -u <username> -p<password> nagios -h <remote ip>

Re: Not able to apply configuration after Mysql Offload

Posted: Mon Feb 08, 2016 7:48 am
by ellism
Will do, I am off-site today and maybe tomorrow so will try as soon as I can. Thanks for the idea.

Re: Not able to apply configuration after Mysql Offload

Posted: Mon Feb 08, 2016 10:32 am
by rkennedy
Sounds good, let us know when you get a chance to review.

Re: Not able to apply configuration after Mysql Offload

Posted: Tue Feb 09, 2016 6:47 am
by ellism
Here is the output:

The clocks were not the same, one was UTC the other EST so they are now both EST for time and date.

grep server /var/www/html/nagiosql/config/settings.php
server = 192.168.7.80
+---------------------+
| now() |
+---------------------+
| 2016-02-09 06:45:01 |
+---------------------+
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)

mysql> select count(*) from nagios_hosts;
+----------+
| count(*) |
+----------+
| 78 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from nagios_services;
+----------+
| count(*) |
+----------+
| 264 |
+----------+
1 row in set (0.00 sec)

Re: Not able to apply configuration after Mysql Offload

Posted: Tue Feb 09, 2016 10:55 am
by hsmith
I'm going to assume fixing the time did not fix this issue then?

Did you double check to make sure that the database information is correct inside of the core configuration manager? ( Configure > Config Manager Admin > Config Manager Settings )

How much latency is there between these locations?

Can you got to Admin > System Information > Monitoring Engine Status and make sure everything looks healthy? (You can post a screenshot if you're unsure)

Anything useful in this file?

Code: Select all

tail /var/log/cron

Re: Not able to apply configuration after Mysql Offload

Posted: Tue Feb 09, 2016 11:21 am
by ellism
The time change did not fix the issue.

Settings in core configuration manager are correct.

These VM's are on the same subnet and the same EXI server so no real latency.
When I go to Admin > System Information > Monitoring Engine Status this on the GUI is showing "Red". I select the action to start it the GUI says command submitted successfully but this never changes to "Green". I will upload two screen shots.

The tail on the /var/log/cron does not really show any useful information.

Re: Not able to apply configuration after Mysql Offload

Posted: Tue Feb 09, 2016 3:56 pm
by rkennedy
This could be a few different things -
- From the XI machine, can you run an nmap against the SQL machine and post the result?
- Verify the information in /usr/local/nagios/etc/ndo2db.cfg, are these the right connection settings?