Deactivated Hosts Aren't Removed from Core
Re: Deactivated Hosts Aren't Removed from Core
You should've done the following:
1. Ran "Verify" to confirm the unchanged config was valid. It was.
2. Deactivated a host that I knew would make the config invalid.
3. Ran "Write" to write the configs to file
4. Ran "Verify" to verify the configuration
4. Activated the host.
5. Ran "Write" to write the configs to file
6. Ran "Verify" to verify the configuration
1. Ran "Verify" to confirm the unchanged config was valid. It was.
2. Deactivated a host that I knew would make the config invalid.
3. Ran "Write" to write the configs to file
4. Ran "Verify" to verify the configuration
4. Activated the host.
5. Ran "Write" to write the configs to file
6. Ran "Verify" to verify the configuration
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Deactivated Hosts Aren't Removed from Core
I understand what you were saying, but your first step 3 wasn't done. Using your logic, my verify after deactivating the host should've returned valid since the invalid config hadn't been written, but it didn't -- it returned invalid. So, something wrote the config even though I never clicked "Write."lmiltchev wrote:You should've done the following:
1. Ran "Verify" to confirm the unchanged config was valid. It was.
2. Deactivated a host that I knew would make the config invalid.
3. Ran "Write" to write the configs to file
4. Ran "Verify" to verify the configuration
4. Activated the host.
5. Ran "Write" to write the configs to file
6. Ran "Verify" to verify the configuration
EDIT: ... The confusing part is that the third "Verify" I ran (after re-activating the host) still failed. So, why would the config be written in one case and not another?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Deactivated Hosts Aren't Removed from Core
In reading through this thread, I became aware of the ability to deactivate a host / service by unchecking the "Active" checkbox on the edit page and clicking save.
I added some validation into the CCM to not allow this, as it should check for dependencies before allowing this.
Attached is the CCM component with the changes you can install through Admin -> Manage Components
I added some validation into the CCM to not allow this, as it should check for dependencies before allowing this.
Attached is the CCM component with the changes you can install through Admin -> Manage Components
You do not have the required permissions to view the files attached to this post.
Re: Deactivated Hosts Aren't Removed from Core
That's cool, but I think there's still the problem of CCM "forgetting" that it needs to still delete CFG files if the first attempt at Apply Configuration fails. Can you also write a fix for this?scottwilkerson wrote:In reading through this thread, I became aware of the ability to deactivate a host / service by unchecking the "Active" checkbox on the edit page and clicking save.
I added some validation into the CCM to not allow this, as it should check for dependencies before allowing this.
Attached is the CCM component with the changes you can install through Admin -> Manage Components
I was talking to another admin peer and he said that the delete operations CCM attempts to do in the first attempt are not attempted in subsequent attempts, resulting in orphaned CFG files.
Re: Deactivated Hosts Aren't Removed from Core
Does this fix also apply to the batch deactivate you can do by checking hosts/services/etc in the list view and using the "With Checked:" drop-down?scottwilkerson wrote:In reading through this thread, I became aware of the ability to deactivate a host / service by unchecking the "Active" checkbox on the edit page and clicking save.
I added some validation into the CCM to not allow this, as it should check for dependencies before allowing this.
Attached is the CCM component with the changes you can install through Admin -> Manage Components
Re: Deactivated Hosts Aren't Removed from Core
This functionality hasn't changed, so this should be fine.Does this fix also apply to the batch deactivate you can do by checking hosts/services/etc in the list view and using the "With Checked:" drop-down?
I noticed a small, "cosmetic" bug with this one. If you try to deactivate some hosts, that cannot be deactivated, because of dependencies, you will get the correct messages, for example:
Code: Select all
Item x.x.x.1 cannot be disabled because it has dependent relationships
Item x.x.x.2 cannot be disabled because it has dependent relationships
Item x.x.x.3 cannot be disabled because it has dependent relationships
Close Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Deactivated Hosts Aren't Removed from Core
What about this fix?Hossy wrote:That's cool, but I think there's still the problem of CCM "forgetting" that it needs to still delete CFG files if the first attempt at Apply Configuration fails. Can you also write a fix for this?
I was talking to another admin peer and he said that the delete operations CCM attempts to do in the first attempt are not attempted in subsequent attempts, resulting in orphaned CFG files.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Deactivated Hosts Aren't Removed from Core
This will not likely be changed because the whole goal of the automated snapshot reverting to the last know good running configuration would be negated. Leaving you with a monitoring engine that cannot start, and monitoring would cease.Hossy wrote: That's cool, but I think there's still the problem of CCM "forgetting" that it needs to still delete CFG files if the first attempt at Apply Configuration fails. Can you also write a fix for this?
Re: Deactivated Hosts Aren't Removed from Core
I don't think you're following what I'm saying. I don't want to change the automated snapshot reverting, I'm asking that you fix the inconsistency caused by it: the inconsistency between the database and the config files.scottwilkerson wrote:This will not likely be changed because the whole goal of the automated snapshot reverting to the last know good running configuration would be negated. Leaving you with a monitoring engine that cannot start, and monitoring would cease.Hossy wrote: That's cool, but I think there's still the problem of CCM "forgetting" that it needs to still delete CFG files if the first attempt at Apply Configuration fails. Can you also write a fix for this?
Here's what happens:
1. Deactivate a host (and possibly another type of change) that causes the "Verify" step to fail.
2. Apply Configuration (this fails).
3. CCM reverts the config files to their previous state, but leaves the database settings unchanged.
4. User fixes the error.
5. Apply Configuration (this succeeds this time).
At step 5, the deletes of the host CFG files that would've occurred in step 2 if step 2 succeeded never occur. The CFG files now become orphans and require manual cleanup.
Whatever mechanism generates the delete commands for the CFG files in step 2, should either 1) continue to generate those delete commands until a successful Apply Configuration happens so that the commands are issued in step 5 or 2) not remove those commands from the "to do" list until a successful Apply Configuration happens. Either way, upon failure, the automated snapshot reverting will keep the original config and to-be-deleted CFG files in place until a successful Apply Configuration happens. (I don't know how the automated snapshot reverting works -- either making a temp copy of the config or rebuilding the config files from a previous DB revision/state).
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Deactivated Hosts Aren't Removed from Core
Now I understand what you are saying.
I will add this to our internal TODO, I believe I know how we can accomplish it, but it will be a major change that will require significant testing...
I will add this to our internal TODO, I believe I know how we can accomplish it, but it will be a major change that will require significant testing...