Subject says it all, really. I just ran into this again. I removed (deleted) a host from our Nagios instance (2012R2.9) and then ran the apply configuration. The apply failed because there was a dependency I wasn't aware of. No big deal, I went in and resolved the dependency. Apply the config again which succeeded. However, the host is still being monitored because the .cfg file still exists.
From what I'm seeing, the config files are reverted, but the database isn't reverted. Without the database being reverted, it appears that the only way to resolve this is to manually delete the .cfg file from the file system.
This appears to be similar to this locked topic :
http://support.nagios.com/forum/viewtop ... ot+removed
Is this a known issue? I seem to remember it being brought up before, but I'm not sure I've ever seen a resolution.
Fail on apply config reverts config but not database
Re: Fail on apply config reverts config but not database
This is a known issue and as you said, easily resolved by manually deleting the file. The way I make sure this doesn't happen to me anymore, is I use the write config files link and then verify, if no issue I then do an apply. If there was an issue, I correct it first. This way my configurations and database never get out of sync. I mainly only do this when doing a deletion.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Fail on apply config reverts config but not database
It's easy enough to work around, sure, but it's unexpected behavior. I wanted to point it out again so maybe it gets fixed. 
Re: Fail on apply config reverts config but not database
I can't argue thatXenoPhage wrote:It's easy enough to work around, sure, but it's unexpected behavior. I wanted to point it out again so maybe it gets fixed.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Fail on apply config reverts config but not database
It is a known issue, and yes, it will be fixed in Nagios XI 2014.
Be sure to check out our Knowledgebase for helpful articles and solutions!