Icinga / icinga-powershell-framework

This PowerShell module will allow to fetch data from Windows hosts and use them for inventory and monitoring solutions. Together with the Icinga Web 2 module, a detailed overview of your Windows infrastructure will be drawn.
MIT License
74 stars 33 forks source link

Update-Icinga command does nothing in case the component is currently not installed #729

Closed log1-c closed 3 months ago

log1-c commented 4 months ago

Hello.

I just stumbled upon this behavior. We install the framework and plugins from a powershell script called via ansible.

Looks like some time in the past the installation of the plugins package failed and some machines have the framework installed, but not the plugin package.

Running the script again then uses the Update-icinga cmdlet instead of Install-IcingaComponent. But this does not install the plugins package and also does not produce any output, that the package can't be updated/is not currently installed. image

For comparison that same command run on an installed "framework" package

PS C:\Program Files\WindowsPowerShell\Modules> update-icinga -Name "framework" -Version "1.11.1"
[Notice]: The installed version "1.11.1" of component "framework" is identical or lower than the new version "1.11.1". Use "-Force" to install anyway

I would like to suggest one of the following:

  1. Produce some form of output that the user can work with like "Can't update <package> because it is not installed" or
  2. Install the package in the desired (or latest) version by calling the Install-IcingaComponent cmdlet.