Out of Sync Configurations from CCM
Posted: Wed Aug 21, 2013 11:37 pm
So I ran into the sync problem again today, and I've figured out how it gets out of sync.
[working configuration, in sync, snapshot is from this point]
Delete a host
Host's .cfg file gets deleted in the filesystem (etc/hosts/host.cfg)
Repeat 1 and 2
A hostgroup which is defined in CCM becomes empty (because it does not check if a host group has a valid configuration)
Apply Configuration
Files are output to filesystem by XI
Nagios -v is run to verify config
Config verify fails (empty hostgroup)
Config snapshot is rolled back. Deleted host files are brought back as a part of that snapshot rollback.
[out of sync configuration]
And until such time as you fix the config fault (like I just had to), and then delete the out of sync files, you'll be stuck.
I postulate that after you fix the config fault (i.e. don't have an empty hostgroup) and remove all the generated files from etc/hosts, etc/services and then rerun the apply config, the broken files won't creep back in (provided of course the resulting config is valid to nagios this run).
:words:
Obviously, not clearing all the generated files at the time of generating new config files (especially because it generates a file for each host) is pretty stupid. That's the crux of the issue.
[working configuration, in sync, snapshot is from this point]
Delete a host
Host's .cfg file gets deleted in the filesystem (etc/hosts/host.cfg)
Repeat 1 and 2
A hostgroup which is defined in CCM becomes empty (because it does not check if a host group has a valid configuration)
Apply Configuration
Files are output to filesystem by XI
Nagios -v is run to verify config
Config verify fails (empty hostgroup)
Config snapshot is rolled back. Deleted host files are brought back as a part of that snapshot rollback.
[out of sync configuration]
And until such time as you fix the config fault (like I just had to), and then delete the out of sync files, you'll be stuck.
I postulate that after you fix the config fault (i.e. don't have an empty hostgroup) and remove all the generated files from etc/hosts, etc/services and then rerun the apply config, the broken files won't creep back in (provided of course the resulting config is valid to nagios this run).
:words:
Obviously, not clearing all the generated files at the time of generating new config files (especially because it generates a file for each host) is pretty stupid. That's the crux of the issue.