Improved Check-Command config by adding a Base Command

This commit is contained in:
Lord Hepipud 2019-09-25 19:56:05 +02:00
parent e8fb372546
commit 928602a2e6

View file

@ -82,6 +82,25 @@ function Get-IcingaCheckCommandConfig()
$Basket.Add('DataList', @{});
$Basket.Add('Command', @{});
# At first generate a base Check-Command we can use as import source for all other commands
$Basket.Command.Add(
'PowerShell Base',
@{
'arguments' = @{};
'command' = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe';
'disabled' = $FALSE;
'fields' = @();
'imports' = @();
'is_string' = $NULL;
'methods_execute' = 'PluginCheck';
'object_name' = 'PowerShell Base';
'object_type' = 'object';
'timeout' = '180';
'vars' = @{};
'zone' = $NULL;
}
);
# "Verbose" gets added to all Checks build and exported no matter what, so we add it from the start
if ($Basket.DataList.ContainsKey('PowerShell Verbose') -eq $FALSE) {
$Basket.DataList.Add(
@ -129,23 +148,17 @@ function Get-IcingaCheckCommandConfig()
$Basket.Command.Add(
$Data.Name, @{
'arguments' = @{
# Gets set for every command as default
# Set the Command handling for every check command
'-C' = @{
'value' = [string]::Format('Use-Icinga; {0}', $Data.Name);
'order' = '0';
}
}
'command' = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe";
'disabled' = $FALSE;
'fields' = @();
'imports' = @();
'is_string' = $NULL;
'methods_execute' = 'PluginCheck';
'imports' = @( 'PowerShell Base' );
'object_name' = $Data.Name;
'object_type' = 'object';
'timeout' = '180';
'vars' = @{};
'zone' = $NULL;
}
);