Out of sync databases after Configuration Snapshot Restore
Posted: Thu Jan 18, 2018 4:30 pm
When running a rollback via the configuration snapshot restore, the nagios and nagiosql databases get out of sync (see: https://support.nagios.com/kb/article/n ... t-407.html).
For example, the host below has 1 entry in the nagiosql.tbl_service table. But in the nagios.nagios_services table has more entries. In CCM, the 1 entry shows up when editing services for the host. Outside of CCM, the other services are still monitored and listed. The services config on the filesystem (/usr/local/nagios/etc/services/...) reflect that of nagios.nagios_services.
The current workaround I've used is to manually set the timestamp for out of sync hosts. Example:
Then "apply configuration" in CCM and it will now be synced.
Is this expected behavior? Is there a way to force all configs to be redeployed to avoid anything else being out of sync?
For example, the host below has 1 entry in the nagiosql.tbl_service table. But in the nagios.nagios_services table has more entries. In CCM, the 1 entry shows up when editing services for the host. Outside of CCM, the other services are still monitored and listed. The services config on the filesystem (/usr/local/nagios/etc/services/...) reflect that of nagios.nagios_services.
Code: Select all
MariaDB [nagiosql]> select name,active,config_name,host_name,service_description from tbl_service where config_name like '%XYZ%';
+------+--------+----------------------------+-----------+---------------------------+
| name | active | config_name | host_name | service_description |
+------+--------+----------------------------+-----------+---------------------------+
| | 1 | xyz....................... | 1 | example-description1..... |
+------+--------+----------------------------+-----------+---------------------------+
1 row in set (0.00 sec)
MariaDB [nagios]> select service_id, host_object_id, service_object_id, display_name from nagios_services where host_object_id=4757;
+------------+----------------+-------------------+---------------------------+
| service_id | host_object_id | service_object_id | display_name |
+------------+----------------+-------------------+---------------------------+
| 11608837 | 4757 | 6395 | example-description1..... |
| 11608835 | 4757 | 5300 | xxa.................. |
| 11608836 | 4757 | 5301 | xxb.................. |
| 11608833 | 4757 | 5298 | xxc.................. |
| 11608834 | 4757 | 5299 | xxd.................. |
| 11608832 | 4757 | 5297 | xxe.................. |
| 11608831 | 4757 | 5296 | xxf.................. |
+------------+----------------+-------------------+---------------------------+
Code: Select all
update tbl_service set last_modified=NOW() where id=123;Is this expected behavior? Is there a way to force all configs to be redeployed to avoid anything else being out of sync?