2021-11-25 07:07:48 -05:00
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
|
|
|
|
Creates all environment variables for Icinga for Windows for the
|
|
|
|
|
PowerShell session
|
|
|
|
|
.DESCRIPTION
|
|
|
|
|
Creates all environment variables for Icinga for Windows for the
|
|
|
|
|
PowerShell session
|
|
|
|
|
.EXAMPLE
|
|
|
|
|
New-IcingaEnvironmentVariable;
|
|
|
|
|
#>
|
|
|
|
|
|
|
|
|
|
function New-IcingaEnvironmentVariable()
|
|
|
|
|
{
|
2021-12-09 11:42:06 -05:00
|
|
|
if ($null -eq $Global:Icinga) {
|
|
|
|
|
$Global:Icinga = @{ };
|
2021-11-25 07:07:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Session specific configuration for this shell
|
2021-12-09 11:42:06 -05:00
|
|
|
if ($Global:Icinga.ContainsKey('Private') -eq $FALSE) {
|
|
|
|
|
$Global:Icinga.Add('Private', @{ });
|
|
|
|
|
|
|
|
|
|
$Global:Icinga.Private.Add('Daemons', @{ });
|
|
|
|
|
$Global:Icinga.Private.Add('Timers', @{ });
|
|
|
|
|
|
|
|
|
|
$Global:Icinga.Private.Add(
|
|
|
|
|
'Scheduler',
|
|
|
|
|
@{
|
|
|
|
|
'CheckData' = @{ };
|
|
|
|
|
'ThresholdCache' = @{ };
|
|
|
|
|
'CheckResults' = @();
|
|
|
|
|
'PerformanceData' = @();
|
|
|
|
|
'PluginException' = $null;
|
|
|
|
|
'ExitCode' = $null;
|
|
|
|
|
}
|
|
|
|
|
);
|
2022-01-25 05:25:01 -05:00
|
|
|
|
|
|
|
|
$Global:Icinga.Private.Add(
|
|
|
|
|
'PerformanceCounter',
|
|
|
|
|
@{
|
|
|
|
|
'Cache' = @{ };
|
|
|
|
|
}
|
|
|
|
|
);
|
2021-11-25 07:07:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Shared configuration for all threads
|
2021-12-09 11:42:06 -05:00
|
|
|
if ($Global:Icinga.ContainsKey('Public') -eq $FALSE) {
|
|
|
|
|
$Global:Icinga.Add('Public', [hashtable]::Synchronized(@{ }));
|
2021-11-25 07:07:48 -05:00
|
|
|
|
2021-12-09 11:42:06 -05:00
|
|
|
$Global:Icinga.Public.Add('Daemons', @{ });
|
|
|
|
|
$Global:Icinga.Public.Add('Threads', @{ });
|
|
|
|
|
$Global:Icinga.Public.Add('ThreadPools', @{ });
|
2021-11-25 07:07:48 -05:00
|
|
|
}
|
2021-12-09 11:42:06 -05:00
|
|
|
|
|
|
|
|
# Session specific configuration which should never be modified by users!
|
|
|
|
|
if ($Global:Icinga.ContainsKey('Protected') -eq $FALSE) {
|
|
|
|
|
$Global:Icinga.Add('Protected', @{ });
|
|
|
|
|
|
|
|
|
|
$Global:Icinga.Protected.Add('DebugMode', $FALSE);
|
|
|
|
|
$Global:Icinga.Protected.Add('JEAContext', $FALSE);
|
|
|
|
|
$Global:Icinga.Protected.Add('RunAsDaemon', $FALSE);
|
|
|
|
|
$Global:Icinga.Protected.Add('Minimal', $FALSE);
|
2021-11-25 07:07:48 -05:00
|
|
|
}
|
|
|
|
|
}
|