icinga-powershell-framework
icinga-powershell-framework copied to clipboard
When updating the agent, save indiviudal settings from the icinga service
Maybe it's a bug or a feature request for you - your decision :-) :
We set some individual settings to the icinga service, like if the icinga service is crashing, the service should restart automatic.
e.g.:
If you start the Cmdlet "Start-IcingaAgentInstallWizard" fyou uninstall the old version and than you install the new version. It looks like during the uninstall process the service will be deleted and after the install the service will be recreated.
While a backup of the icinga configuration will be created during the hole update process and restored afterwards, this should also be done with the settings of the service.
Expected Behavior
Save indiviudal settings of the service, if set and restore it after the update process. This could also be switch, for people who think this should not be don automatic.
Your Environment
Tested with W2012R2, W2016 and W2019 PS: 4.6 and 4.7 Icinga-PowerShell-Framework 1.3.0
Basically this can be seen as bug/feature request in both ways. The issue here is that for updating/downgrading the Agent we have to uninstall the Agent first, because the MSI installer is not allowing proper upgrades by cli. By doing so, the Icinga Agent service is uninstalled and reinstalled.
A proper fix for this would be, if the MSI installer allows an upgrade and leaves the service as it is. So this is a feature for the Icinga Agent MSI installer and a small re-write on the upgrade procedure of the module. I will have a look on this.
If I'm correct, you've fixed this with https://github.com/Icinga/icinga-powershell-framework/pull/521 in 1.10.0.?
The settings of the Agent are not saved, but we set the recover states by default now. But in general yes, recovery is set with the mentioned PR.
ref/NC/761567
The same applies for "update-icinga -name agent": all individual settings of the agent-service like "Recovery" or "Startup type" were reset after updating the agent.
Additionaly it would be nice to have an explizit option to set the Startup Type, which could be used with an installer configuration.