Adds Windows Terminal integration

This commit is contained in:
Lord Hepipud 2020-08-28 15:24:48 +02:00
parent b39af24b14
commit e2d58ba182
8 changed files with 86 additions and 6 deletions

View file

@ -19,3 +19,4 @@ To get started, there are two ways to configure check command objects:
* [Automated configuration](icingaintegration/01-Director-Baskets.md) with Baskets
* [Manual configuration](icingaintegration/02-Manual-Integration.md) of check commands
* [Using PowerShell Arrays in Icinga](icingaintegration/03-PowerShell-Arrays.md)
* [Windows Terminal Integration](icingaintegration/50-Windows-Terminal.md)

View file

@ -28,6 +28,7 @@ Check Command configuration generated by Icinga for Windows 1.2.0 require Icinga
### Enhancements
* Adds configuration for [Windows Terminal integration](icingaintegration/50-Windows-Terminal.md)
* Adds new Cmdlet `Show-IcingaPerformanceCounterInstances` to display all available instances for Performance Counters
* [#76](https://github.com/Icinga/icinga-powershell-framework/issues/76) Adds support to test for required .NET Framework Version 4.6.0 or above before trying to install the Icinga Agent
* [#87](https://github.com/Icinga/icinga-powershell-framework/issues/87) Adds wrapper command to test new code or functionality of Framework and/or plugins

View file

@ -46,7 +46,6 @@ The following list contains a bunch of features we are planning to implement int
| 1 | Improve module caching | While running the Icinga for Windows solution as background daemon we should make sure that recurring tasks/events are properly cached. For this we will need to cache objects recursively, including arrays and hashtables<br><br>Issue: [#5]
| 1 | Improve Performance Counter Cache | We should improve the Performance Counter cache to be able to recognize if certain counter/instances are no longer present or have been added. This will resolve an issue while using the background daemon for regular tasks<br><br>Issue: [#11]
| 2 | Icinga Service Recovery | By default the Icinga Agent installer is not shipping with a service recovery solution in case the service crashes. We should allow the user to configure a custom rule set on what happens if Icinga crashes and how often a restart attempt is done for example<br><br>Issue: [#40]
| 2 | Windows Terminal Integration | We should add support for the new Windows Terminal for easier usage and integration |
| 3 | Windows Update Installation | The idea behind this is for smaller customer environments to allow the installation of certain Windows updates by using Icinga for Windows. This was an initial requests and should be taken into consideration when nothing else is to do<br><br>Issue: [#7]
| 3 | Hyper-V Monitoring | Add plugins for Hyper-V monitoring in an own separate module to cover this platform |
| 3 | Exchange Server Monitoring | Add plugins for Exchange Server monitoring in an own separate module to cover this platform |

View file

@ -0,0 +1,76 @@
# Windows Terminal Integration
The new [Windows Terminal](https://www.microsoft.com/en-US/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab) provided by Microsoft offers a huge flexibility when it comes to working with different kind of shells. Not only does it finally support tabs and to split the current view into separate shells, it also allows the integration of pre-defined commands to execute for loading shells or environments.
In addition we can fully customize the apperance for our needs.
## Install the Icinga Shell Configuration
To install the Icinga Shell as native shell in your Windows Terminal dropdown, simply paste the following JSON under `profiles` -> `list`
```json
{
"fontFace" : "Consolas",
"fontSize" : 12,
"useAcrylic" : true,
"guid": "{fcd7a805-a41b-49f9-afee-9d17a2b76d42}",
"name": "Icinga",
"commandline" : "powershell.exe -noe -c \"&{ icinga }\"",
"hidden": false,
"icon" : "ms-appdata:///roaming/icingawhite.png",
"acrylicOpacity" : 0.85,
"backgroundImage" : "ms-appdata:///roaming/icingawhite.png",
"backgroundImageOpacity" : 0.50,
"backgroundImageStretchMode" : "none",
"backgroundImageAlignment" : "topRight",
"tabTitle": "Icinga for Windows - Loading",
"colorScheme": "Icinga-Default"
}
```
As we are using the the custom theme `Icinga-Default` we will have to add this as well directly under the `schemes` section:
```json
{
"name" : "Icinga-Default",
"cursorColor": "#FFFFFF",
"selectionBackground": "#61C2FF",
"background": "#04062A",
"foreground" : "#EED7AA",
// Arguments
"black" : "#CC88DD",
"brightBlack" : "#CC88DD",
// Debug messages
"blue" : "#A6A6A6",
"brightBlue" : "#A6A6A6",
// Strings
"cyan" : "#39B5C6",
"brightCyan" : "#39B5C6",
"green" : "#31BB6C",
"brightGreen" : "#31BB6C",
"purple" : "#00607A",
"brightPurple" : "#00607A",
"red" : "#FF6B7A",
"brightRed" : "#FF6B7A",
// Commands
"white" : "#FFFFFF",
"brightWhite" : "#FFFFFF",
// Commands/Console Input
"yellow" : "#FFAA44",
"brightYellow" : "#FFFFFF"
}
```
Last but not least we can setup our logo to appear on the top-right corner and as terminal icon. You can get the logo [here](..\images\03_windows_terminal\icingawhite.png).
To install it, copy it directly into the following path:
```text
%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState
```
Now restart your Windows Terminal and enjoy the new look and the Icinga Shell integration!
![Windows Terminal](..\images\03_windows_terminal\icinga_shell.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -282,12 +282,15 @@ function Invoke-IcingaCommand()
}
powershell.exe -NoExit -Command {
$Script = $args[0];
$RootPath = $args[1];
$Script = $args[0];
$RootPath = $args[1];
$Version = $args[2];
# Load our Icinga Framework
Use-Icinga;
$Host.UI.RawUI.WindowTitle = ([string]::Format('Icinga for Windows {0}', $Version));
# Set the location to the Icinga Framework module folder
Set-Location $RootPath;
@ -304,7 +307,7 @@ function Invoke-IcingaCommand()
return "> "
}
} -Args $ScriptBlock, $PSScriptRoot;
} -Args $ScriptBlock, $PSScriptRoot, $IcingaFrameworkData.PrivateData.Version;
}
Set-Alias icinga Invoke-IcingaCommand -Description "Execute Icinga Framework commands in a new PowerShell instance for testing or quick access to data";

View file

@ -29,6 +29,6 @@ function Write-IcingaConsoleWarning()
Write-IcingaConsoleOutput `
-Message $Message `
-Objects $Objects `
-ForeColor 'Yellow' `
-ForeColor 'DarkYellow' `
-Severity 'Warning';
}