You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #386 from Icinga:fix/check_generator_for_alias_checks
Fix: Check command generator for aliases
In case we are using aliases for check commands, to keep backwards compatibility, we have to ensure that check commands actually use the name of the alias for custom variables, to not break the naming and prevent wrong usage of custom variables.
Copy file name to clipboardExpand all lines: doc/100-General/10-Changelog.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
17
17
*[#376](https://github.com/Icinga/icinga-powershell-framework/pull/376) Fixes IMC error handling on invalid JSON for installation command/file
18
18
*[#377](https://github.com/Icinga/icinga-powershell-framework/issues/377) Fixes overhead for testing of modules being loaded, which returned invalid path values and wrong exceptions, which was unnecessary in first place
19
19
*[#381](https://github.com/Icinga/icinga-powershell-framework/issues/381) Fixes Repository Hash generator for new repositories, which always returned the same hash regardless of the files inside
20
+
*[#386](https://github.com/Icinga/icinga-powershell-framework/pull/386) Fixes check command config generator for Icinga Director baskets/Icinga 2 conf files, in case we are using a check command with an alias as reference to a new name of a check command
@@ -195,17 +197,17 @@ function Get-IcingaCheckCommandConfig()
195
197
196
198
# Add command Structure
197
199
$Basket.Command.Add(
198
-
$Data.Name,@{
200
+
$check,@{
199
201
'arguments'=@{
200
202
# Set the Command handling for every check command
201
203
'-C'=@{
202
-
'value'= [string]::Format('try {{ Use-Icinga -Minimal; }} catch {{ Write-Output {1}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{1}; Write-Output {1}Error:{1} $$($$_.Exception.Message)Components:`r`n$$( Get-Module -ListAvailable {1}icinga-powershell-*{1} )`r`n{1}Module-Path:{1}`r`n$$($$Env:PSModulePath); exit 3; }}; Exit-IcingaExecutePlugin -Command {1}{0}{1} ',$Data.Name,"'");
204
+
'value'= [string]::Format('try {{ Use-Icinga -Minimal; }} catch {{ Write-Output {1}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{1}; Write-Output {1}Error:{1} $$($$_.Exception.Message)Components:`r`n$$( Get-Module -ListAvailable {1}icinga-powershell-*{1} )`r`n{1}Module-Path:{1}`r`n$$($$Env:PSModulePath); exit 3; }}; Exit-IcingaExecutePlugin -Command {1}{0}{1} ',$check,"'");
203
205
'order'='0';
204
206
};
205
207
}
206
208
'fields'=@();
207
209
'imports'=@( 'PowerShell Base' );
208
-
'object_name'=$Data.Name;
210
+
'object_name'=$check;
209
211
'object_type'='object';
210
212
'vars'=@{ };
211
213
}
@@ -238,19 +240,19 @@ function Get-IcingaCheckCommandConfig()
0 commit comments