mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Fixes plain plugin cmdlet execution on shell
This commit is contained in:
parent
bbbc6ee8e9
commit
d59bed6595
3 changed files with 11 additions and 3 deletions
|
|
@ -25,6 +25,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
||||||
* [#343](https://github.com/Icinga/icinga-powershell-framework/pull/343) Fixes freeze within Icinga Management Console, in case commands which previously existed were removed/renamed or the user applied an invalid configuration with unknown commands as install file or install command
|
* [#343](https://github.com/Icinga/icinga-powershell-framework/pull/343) Fixes freeze within Icinga Management Console, in case commands which previously existed were removed/renamed or the user applied an invalid configuration with unknown commands as install file or install command
|
||||||
* [#345](https://github.com/Icinga/icinga-powershell-framework/pull/345) Fixes Framework environment variables like `$IcingaEnums` not working with v1.6.0
|
* [#345](https://github.com/Icinga/icinga-powershell-framework/pull/345) Fixes Framework environment variables like `$IcingaEnums` not working with v1.6.0
|
||||||
* [#351](https://github.com/Icinga/icinga-powershell-framework/pull/351) Fixes file writer which could cause corruption on parallel read/write events on the same file
|
* [#351](https://github.com/Icinga/icinga-powershell-framework/pull/351) Fixes file writer which could cause corruption on parallel read/write events on the same file
|
||||||
|
* [#359](https://github.com/Icinga/icinga-powershell-framework/issues/359) Fixes Plain Plugin Cmdlet execution on shell
|
||||||
|
|
||||||
### Enhancements
|
### Enhancements
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,12 @@ function New-IcingaCheckResult()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Ensure we reset our internal cache once the plugin was executed
|
# Ensure we reset our internal cache once the plugin was executed
|
||||||
$Global:Icinga.ThresholdCache[$this.Check.__GetCheckCommand()] = $null;
|
$CheckCommand = $this.Check.__GetCheckCommand();
|
||||||
|
if ([string]::IsNullOrEmpty($CheckCommand) -eq $FALSE -And $Global:Icinga.ThresholdCache.ContainsKey($CheckCommand)) {
|
||||||
|
$Global:Icinga.ThresholdCache[$CheckCommand] = $null;
|
||||||
|
}
|
||||||
# Reset the current execution date
|
# Reset the current execution date
|
||||||
$Global:Icinga.CurrentDate = $null;
|
$Global:Icinga.CurrentDate = $null;
|
||||||
|
|
||||||
$ExitCode = $this.Check.__GetCheckState();
|
$ExitCode = $this.Check.__GetCheckState();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,11 @@ function Write-IcingaPluginPerfData()
|
||||||
$PerformanceData = $PerformanceData.perfdata;
|
$PerformanceData = $PerformanceData.perfdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
$CheckResultCache = $Global:Icinga.ThresholdCache[$CheckCommand];
|
if ([string]::IsNullOrEmpty($CheckCommand) -eq $FALSE -And $Global:Icinga.ThresholdCache.ContainsKey($CheckCommand)) {
|
||||||
|
$CheckResultCache = $Global:Icinga.ThresholdCache[$CheckCommand];
|
||||||
|
} else {
|
||||||
|
$CheckResultCache = New-Object PSCustomObject;
|
||||||
|
}
|
||||||
|
|
||||||
if ($global:IcingaDaemonData.FrameworkRunningAsDaemon -eq $FALSE -And $global:IcingaDaemonData.JEAContext -eq $FALSE) {
|
if ($global:IcingaDaemonData.FrameworkRunningAsDaemon -eq $FALSE -And $global:IcingaDaemonData.JEAContext -eq $FALSE) {
|
||||||
[string]$PerfDataOutput = (Get-IcingaPluginPerfDataContent -PerfData $PerformanceData -CheckResultCache $CheckResultCache -IcingaCheck $IcingaCheck);
|
[string]$PerfDataOutput = (Get-IcingaPluginPerfDataContent -PerfData $PerformanceData -CheckResultCache $CheckResultCache -IcingaCheck $IcingaCheck);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue