mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Improved Check-Command config by adding a Base Command
This commit is contained in:
parent
9096a3d0f6
commit
98c5704c16
1 changed files with 24 additions and 11 deletions
|
|
@ -82,6 +82,25 @@ function Get-IcingaCheckCommandConfig()
|
||||||
$Basket.Add('DataList', @{});
|
$Basket.Add('DataList', @{});
|
||||||
$Basket.Add('Command', @{});
|
$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
|
# "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) {
|
if ($Basket.DataList.ContainsKey('PowerShell Verbose') -eq $FALSE) {
|
||||||
$Basket.DataList.Add(
|
$Basket.DataList.Add(
|
||||||
|
|
@ -128,24 +147,18 @@ function Get-IcingaCheckCommandConfig()
|
||||||
# Add command Structure
|
# Add command Structure
|
||||||
$Basket.Command.Add(
|
$Basket.Command.Add(
|
||||||
$Data.Name, @{
|
$Data.Name, @{
|
||||||
'arguments'= @{
|
'arguments' = @{
|
||||||
# Gets set for every command as default
|
# Set the Command handling for every check command
|
||||||
'-C' = @{
|
'-C' = @{
|
||||||
'value' = [string]::Format('Use-Icinga; {0}', $Data.Name);
|
'value' = [string]::Format('Use-Icinga; {0}', $Data.Name);
|
||||||
'order' = '0';
|
'order' = '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'command' = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe";
|
|
||||||
'disabled' = $FALSE;
|
|
||||||
'fields' = @();
|
'fields' = @();
|
||||||
'imports' = @();
|
'imports' = @( 'PowerShell Base' );
|
||||||
'is_string' = $NULL;
|
|
||||||
'methods_execute' = 'PluginCheck';
|
|
||||||
'object_name' = $Data.Name;
|
'object_name' = $Data.Name;
|
||||||
'object_type' = 'object';
|
'object_type' = 'object';
|
||||||
'timeout' = '180';
|
|
||||||
'vars' = @{};
|
'vars' = @{};
|
||||||
'zone' = $NULL;
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue