Page 1 of 2
Sync Missed?
Posted: Wed Dec 22, 2010 3:55 pm
by SeanFromIT
What does Sync Status 'Sync Missed' mean? I get this when I add a new service. Despite this, at the bottom it says "Data successfully inserted into the database!" However, I get errors when I try to Apply Configuration. Something isn't adding up.
Re: Sync Missed?
Posted: Mon Dec 27, 2010 4:41 pm
by mguthrie
The Core Config Manager (CCM) works as follows:
- A change is made in the CCM, and that info is saved in the database. This information will not take effect in Nagios until the "Apply Configuration" goes through successfully. If the Apply fails, then you have an error in your configuration. You can find this by using the "Configuration Snapshot'. The text file shows the configuration check, and will display where the error(s) are. You'll need to fix them in the CCM in order for the configuration to be applied successfully. Feel free to send us the text output from the Configuration Snapshot if you need help finding the issue.
Re: Sync Missed?
Posted: Tue Jan 25, 2011 3:38 pm
by SeanFromIT
I'd like to revisit this issue. There seems to be a timing issue between when all of the syncs occur. Ideally I would like to make a core config change, and then click Apply Configuration and have things transfer appropriately. But occasionally you see 'Sync Missed' or 'Out of Sync' in the Sync Status column. Sometimes time fixes this, sometimes it doesn't. Is there a way to force sync, so that I know there is really a configuration issue when I click Apply Configuration? When the config goes out of sync, what gets applied is not what the config should be, which can throw errors I shouldn't be receiving.
Re: Sync Missed?
Posted: Wed Jan 26, 2011 12:56 pm
by mguthrie
The Core Config Manager (CCM) stores all of it's information in the mysql database. The only time it attempts to sync with the actual configuration files is when you either Apply Configuration, or use the Write Config Tool. There isn't anything in the CCM that automatically syncs the DB with the files. Do not attempt to manually modify the configuration files unless they're in the /usr/local/nagios/etc/static directory.
If you attempt to Apply Configuration and there is a configuration error, the configuration will NOT be applied to the files. It rolls back to the last known good configuration in order to keep the Nagios engine running. The bad config is saved in the configuration snapshot, and you'll need to use that zip file, along with the text file that goes with it to determine where the bad configuration is. Feel free to send us both if you have an error and you're having trouble identifying it.
Hope that helps, let us know if you need more details on any of this.
Re: Sync Missed?
Posted: Wed Jan 26, 2011 2:13 pm
by SeanFromIT
Snapshot error:
Processing object config file '/usr/local/nagios/etc/services/Disks Free DBA 02.cfg'...
Error: Could not expand hostgroups and/or hosts specified in service (config file '/usr/local/nagios/etc/services/Disks Free DBA 02.cfg', starting on line 14)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Now when I go into services and find it:
Code: Select all
Config Name Service Name Active Sync Status
Disks Free DBA 02 Disks Free DBA 02 No Out of Sync
If it's not active, it should not be read. I've noticed this only happens to Sync Missed or Out of Sync services/hosts. I assume Out of Sync indicates that it has not been properly written to config files, since if it was Nagios wouldn't be trying to read the file (or it would at least be commented out in the file). How do I force a sync?
Re: Sync Missed?
Posted: Wed Jan 26, 2011 6:02 pm
by mguthrie
Can we see the full config for that particular service?
You can also manually write the configs to the file by using the Write Config Tool in the CCM. Double check the configuration for that service, and if it appears correct in the CCM, try that tool and then check your config.
Re: Sync Missed?
Posted: Thu Jan 27, 2011 10:14 am
by SeanFromIT
Write host configurations ...
Configuration file successfully written!
Write service configurations ...
Configuration file successfully written!
Write hostgroups.cfg ...
Configuration file successfully written!
Write servicegroups.cfg ...
Configuration file successfully written!
Write hosttemplates.cfg ...
Configuration file successfully written!
Write servicetemplates.cfg ...
Configuration file successfully written!
Write timeperiods.cfg ...
Configuration file successfully written!
Write commands.cfg ...
Configuration file successfully written!
Write contacts.cfg ...
Configuration file successfully written!
Write contactgroups.cfg ...
Configuration file successfully written!
Write contacttemplates.cfg ...
Configuration file successfully written!
Write servicedependencies.cfg ...
Configuration file successfully written!
Write hostdependencies.cfg ...
Configuration file successfully written!
Write serviceescalations.cfg ...
Configuration file successfully written!
Write hostescalations.cfg ...
Configuration file successfully written!
Write serviceextinfo.cfg ...
Configuration file successfully written!
Write hostextinfo.cfg ...
Configuration file successfully written!
Error: Could not expand hostgroups and/or hosts specified in service (config file '/usr/local/nagios/etc/services/Disks Free DBA 02.cfg', starting on line 14)
Error processing object config files!
After running the first three options in Write Config Tool I get the output above. Looking back at CCM for that service, it still shows "Out of Sync." Looking at the config file:
Code: Select all
###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2011-01-25 11:03:40
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################
define service {
service_description Disks Free DBA 02
use generic-disk-dba
hostgroup_name check-disk-dba-02
servicegroups Disk_Free_DBA
check_command nrpe!check_disk_dba2!!!!!!!
register 1
}
###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
Clearly, if it's not marked as active in CCM this file either should not exist or should be commented out after running Write Config Tool.
Re: Sync Missed?
Posted: Thu Jan 27, 2011 11:46 am
by mguthrie
I see what you mean. If the item is set as inactive in the CCM, go ahead and try manually deleting that configuration file, and then try the Write Config Tool again. Let me know if that works. We've occasionally seen the CCM do things like this where it fails to remove a file, but we haven't yet nailed down the cause of it.
Re: Sync Missed?
Posted: Thu Jan 27, 2011 3:26 pm
by SeanFromIT
I found the problem, but not what caused it. A good number of host group members disappeared on their own. Importing the host definitions from the last good configuration helped repopulate the host groups.
Re: Sync Missed?
Posted: Thu Jan 27, 2011 5:12 pm
by SeanFromIT
OK...I have no idea what's causing this. The Apply Configuration is now coming back green but if I go into CCM host groups nothing is defined when I click the little notebook for the add host/host group popup. The only things I did in between was:
create a new host group and add members to it
create new services and add host groups to it
How would adding new configs cause existing, unrelated configs to drop members?