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
78 stars 33 forks source link

path to icinga-service.exe contains a leading backslash #722

Closed tectumopticum closed 7 months ago

tectumopticum commented 7 months ago

After an installation with framework 1.12.1 the output of "Icinga for Windows Service Path" contains a leading "\" in "show-icinga"-output when the cmdlet is called in the same ps-window directly after the kickstart-script has finished:

PS C:\> show-icinga

[Error]: The provided file "\C:\Program Files\icinga-framework-service\icinga-service.exe" does not exist
Icinga for Windows environment:
-----------

Environment configuration:

PowerShell Root                 => C:\Program Files\WindowsPowerShell\Modules\
Icinga for Windows Service Path => \C:\Program Files\icinga-framework-service\

As a result the info about the installed version for "service" keeps empty:

[...]
Installed components on this system:

Component    Version   Available
---          ---       ---
agent        2.14.2    2.14.2
framework    1.12.1    1.12.1
plugins      1.12.0    1.12.0
restapi      1.2.0     1.2.0
service                1.2.0
[...]

As a result the service couldn't be started by the installation-script.

If you open an new admin-ps-instance and call the same cmdlet again, everything seems to be ok again. Probably it is a result of a modification-process of a variable during the installation.

Tested it with Framework 1.11.1: no leading backslash. This means it is not a typo in our configuration and it has been introduced with framework >= 1.12.0.

OS: Windows Server 2022
Name                           Value
----                           -----
PSVersion                      5.1.20348.643
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.643
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

IfW framework >= 1.12.0
LordHepipud commented 7 months ago

I have tried to play around a little with this configuration and I can get the service path to contain a leading \. Does this happen on a regular basis by installing Icinga for Windows v.12.1 or v1.12.2 or does it appear random?

tectumopticum commented 7 months ago

It is reproducible with IfW v1.12.2 (probably v1.12.1 too, but I didn't check this)