|
| 1 | +# Icinga Knowledge Base - IWKB000010 |
| 2 | + |
| 3 | +## Short Message |
| 4 | + |
| 5 | +The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check https://icinga.com/docs/windows for further details |
| 6 | +Error: The term 'Use-Icinga' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. |
| 7 | + |
| 8 | +Components: |
| 9 | + |
| 10 | +Module-Path: |
| 11 | + |
| 12 | +C:\windows\ServiceProfiles\NetworkService\Documents\WindowsPowerShell\Modules;C:\Program Files (x86)\WindowsPowerShell\Modules;C:\windows\system32\WindowsPowerShell\v1.0\Modules |
| 13 | + |
| 14 | +## Reason |
| 15 | + |
| 16 | +The Icinga PowerShell Framework is either not installed on the system, the service user running the Icinga Agent is unable to access the PowerShell module folder it is installed into or you have installed the wrong architecture of the Icinga Agent. |
| 17 | + |
| 18 | +## Solution |
| 19 | + |
| 20 | +### Test Installation |
| 21 | + |
| 22 | +First check locally if Icinga for Windows is installed properly. You can do so by opening a PowerShell and type `icinga` into the prompt. If you are greeted with an Icinga shell, the installation is working properly. |
| 23 | + |
| 24 | +In case this fails, ensure you are running the correct PowerShell on your system. |
| 25 | + |
| 26 | +For `x86` systems, there is only one PowerShell present. |
| 27 | + |
| 28 | +For `x64` systems (the majority), you will have to open the `Windows PowerShell`, **NOT** the `Windows PowerShell (x86)`. |
| 29 | + |
| 30 | +If you have ensured the correct PowerShell is started, try again with the `icinga` command |
| 31 | + |
| 32 | +### Check PowerShell Module Folders |
| 33 | + |
| 34 | +Ensure that the folder you have installed the Icinga PowerShell Framework into is listed at `$Env:PSModulePath`. The above error message also provides a list of module folders which are checked by the service user. Ensure the module folder you have installed everything into is listed there. |
| 35 | +If it is not present, either move the Icinga for Windows files to a listed folder or add it to the environment variables. |
| 36 | + |
| 37 | +If you installed Icinga for Windows into `C:\Program Files\WindowsPowerShell\Modules` and it is not listed in aboves messages, please read on. |
| 38 | + |
| 39 | +### Wrong Agent Architecture |
| 40 | + |
| 41 | +In case you receive above error while installing Icinga for Windows into `C:\Program Files\WindowsPowerShell\Modules`, it means you have installed the `x86` version of the Icinga Agent instead of the `x64` version. |
| 42 | +This mostly happens when you start the wrong PowerShell architecture (see `Test Installation` above) and install Icinga for Windows from this shell. If you started an `x86` shell on an `x64` system, the Icinga for Windows installer will install the `x86` Icinga Agent, which then have no access to the `x64` files, causing the above error. |
| 43 | + |
| 44 | +To resolve this, open the correct PowerShell and run the following command: |
| 45 | + |
| 46 | +```powershell |
| 47 | +Install-IcingaComponent -Name agent -Force -Confirm; |
| 48 | +``` |
| 49 | + |
| 50 | +This will uninstall the wrong `x86` and install the correct `x64` version of the Icinga Agent. |
| 51 | + |
| 52 | +If you receive an error `[SC] ChangeServiceConfig FAILED 1072: The specified service has been marked for deletion` error, please have a look on the next [Knowledge Base entry IWKB000011](IWKB000011.md) |
0 commit comments