mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
25 lines
503 B
PowerShell
25 lines
503 B
PowerShell
|
|
function Get-IcingaThresholdCache()
|
||
|
|
{
|
||
|
|
param (
|
||
|
|
[string]$CheckCommand = $null
|
||
|
|
);
|
||
|
|
|
||
|
|
if ([string]::IsNullOrEmpty($CheckCommand)) {
|
||
|
|
return $null;
|
||
|
|
}
|
||
|
|
|
||
|
|
if ($null -eq $Global:Icinga) {
|
||
|
|
return $null;
|
||
|
|
}
|
||
|
|
|
||
|
|
if ($Global:Icinga.ContainsKey('ThresholdCache') -eq $FALSE) {
|
||
|
|
return $null;
|
||
|
|
}
|
||
|
|
|
||
|
|
if ($Global:Icinga.ThresholdCache.ContainsKey($CheckCommand) -eq $FALSE) {
|
||
|
|
return $null;
|
||
|
|
}
|
||
|
|
|
||
|
|
return $Global:Icinga.ThresholdCache[$CheckCommand];
|
||
|
|
}
|