Skip to content

Commit 779ac48

Browse files
authored
Merge pull request #125 from Icinga/feature/windows_terminal_integration
Adds Windows Terminal integration
2 parents b39af24 + e2d58ba commit 779ac48

File tree

8 files changed

+86
-6
lines changed

8 files changed

+86
-6
lines changed

doc/05-Icinga-Integration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ To get started, there are two ways to configure check command objects:
1818

1919
* [Automated configuration](icingaintegration/01-Director-Baskets.md) with Baskets
2020
* [Manual configuration](icingaintegration/02-Manual-Integration.md) of check commands
21-
* [Using PowerShell Arrays in Icinga](icingaintegration/03-PowerShell-Arrays.md)
21+
* [Using PowerShell Arrays in Icinga](icingaintegration/03-PowerShell-Arrays.md)
22+
* [Windows Terminal Integration](icingaintegration/50-Windows-Terminal.md)

doc/31-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Check Command configuration generated by Icinga for Windows 1.2.0 require Icinga
2828

2929
### Enhancements
3030

31+
* Adds configuration for [Windows Terminal integration](icingaintegration/50-Windows-Terminal.md)
3132
* Adds new Cmdlet `Show-IcingaPerformanceCounterInstances` to display all available instances for Performance Counters
3233
* [#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
3334
* [#87](https://github.com/Icinga/icinga-powershell-framework/issues/87) Adds wrapper command to test new code or functionality of Framework and/or plugins

doc/90-Roadmap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ The following list contains a bunch of features we are planning to implement int
4646
| 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]
4747
| 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]
4848
| 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]
49-
| 2 | Windows Terminal Integration | We should add support for the new Windows Terminal for easier usage and integration |
5049
| 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]
5150
| 3 | Hyper-V Monitoring | Add plugins for Hyper-V monitoring in an own separate module to cover this platform |
5251
| 3 | Exchange Server Monitoring | Add plugins for Exchange Server monitoring in an own separate module to cover this platform |
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Windows Terminal Integration
2+
3+
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.
4+
5+
In addition we can fully customize the apperance for our needs.
6+
7+
## Install the Icinga Shell Configuration
8+
9+
To install the Icinga Shell as native shell in your Windows Terminal dropdown, simply paste the following JSON under `profiles` -> `list`
10+
11+
```json
12+
{
13+
"fontFace" : "Consolas",
14+
"fontSize" : 12,
15+
"useAcrylic" : true,
16+
17+
"guid": "{fcd7a805-a41b-49f9-afee-9d17a2b76d42}",
18+
"name": "Icinga",
19+
"commandline" : "powershell.exe -noe -c \"&{ icinga }\"",
20+
"hidden": false,
21+
"icon" : "ms-appdata:///roaming/icingawhite.png",
22+
23+
"acrylicOpacity" : 0.85,
24+
"backgroundImage" : "ms-appdata:///roaming/icingawhite.png",
25+
"backgroundImageOpacity" : 0.50,
26+
"backgroundImageStretchMode" : "none",
27+
"backgroundImageAlignment" : "topRight",
28+
"tabTitle": "Icinga for Windows - Loading",
29+
"colorScheme": "Icinga-Default"
30+
}
31+
```
32+
33+
As we are using the the custom theme `Icinga-Default` we will have to add this as well directly under the `schemes` section:
34+
35+
```json
36+
{
37+
"name" : "Icinga-Default",
38+
"cursorColor": "#FFFFFF",
39+
"selectionBackground": "#61C2FF",
40+
"background": "#04062A",
41+
"foreground" : "#EED7AA",
42+
// Arguments
43+
"black" : "#CC88DD",
44+
"brightBlack" : "#CC88DD",
45+
// Debug messages
46+
"blue" : "#A6A6A6",
47+
"brightBlue" : "#A6A6A6",
48+
// Strings
49+
"cyan" : "#39B5C6",
50+
"brightCyan" : "#39B5C6",
51+
"green" : "#31BB6C",
52+
"brightGreen" : "#31BB6C",
53+
"purple" : "#00607A",
54+
"brightPurple" : "#00607A",
55+
"red" : "#FF6B7A",
56+
"brightRed" : "#FF6B7A",
57+
// Commands
58+
"white" : "#FFFFFF",
59+
"brightWhite" : "#FFFFFF",
60+
// Commands/Console Input
61+
"yellow" : "#FFAA44",
62+
"brightYellow" : "#FFFFFF"
63+
}
64+
```
65+
66+
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).
67+
68+
To install it, copy it directly into the following path:
69+
70+
```text
71+
%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState
72+
```
73+
74+
Now restart your Windows Terminal and enjoy the new look and the Icinga Shell integration!
75+
76+
![Windows Terminal](..\images\03_windows_terminal\icinga_shell.png)
14.5 KB
Loading
1.99 KB
Loading

icinga-powershell-framework.psm1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,15 @@ function Invoke-IcingaCommand()
282282
}
283283

284284
powershell.exe -NoExit -Command {
285-
$Script = $args[0];
286-
$RootPath = $args[1];
285+
$Script = $args[0];
286+
$RootPath = $args[1];
287+
$Version = $args[2];
287288

288289
# Load our Icinga Framework
289290
Use-Icinga;
290291

292+
$Host.UI.RawUI.WindowTitle = ([string]::Format('Icinga for Windows {0}', $Version));
293+
291294
# Set the location to the Icinga Framework module folder
292295
Set-Location $RootPath;
293296

@@ -304,7 +307,7 @@ function Invoke-IcingaCommand()
304307
return "> "
305308
}
306309

307-
} -Args $ScriptBlock, $PSScriptRoot;
310+
} -Args $ScriptBlock, $PSScriptRoot, $IcingaFrameworkData.PrivateData.Version;
308311
}
309312

310313
Set-Alias icinga Invoke-IcingaCommand -Description "Execute Icinga Framework commands in a new PowerShell instance for testing or quick access to data";

lib/core/logging/Write-IcingaConsoleWarning.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ function Write-IcingaConsoleWarning()
2929
Write-IcingaConsoleOutput `
3030
-Message $Message `
3131
-Objects $Objects `
32-
-ForeColor 'Yellow' `
32+
-ForeColor 'DarkYellow' `
3333
-Severity 'Warning';
3434
}

0 commit comments

Comments
 (0)