mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Fix wrong plugin not installed unknown checkresult
This commit is contained in:
parent
ed43260bec
commit
e7c341e30a
3 changed files with 10 additions and 4 deletions
|
|
@ -34,6 +34,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
|||
* [#208](https://github.com/Icinga/icinga-powershell-framework/pull/208) Fixes `Convert-IcingaPluginThresholds` which sometimes did not return proper numeric usable values for our internal functions, causing issues on plugin calls. In addition the function now also supports the handling for % units.
|
||||
* [#213](https://github.com/Icinga/icinga-powershell-framework/pull/213) Fixed possible crash on `Get-IcingaAgentFeatures` if PowerShell is not running as administrator and therefor the command `icinga2 feature list` can not be processed
|
||||
* [#213](https://github.com/Icinga/icinga-powershell-framework/pull/213) Fixed `ConvertTo-IcingaSecureString` to return `$null` for empty strings instead of throwing an exception
|
||||
* [#214](https://github.com/Icinga/icinga-powershell-framework/pull/214) Fixes wrong `[Unknown] PluginNotInstalled` exception because of new plugin configuration and wrong checking against APi result in case feature is enabled
|
||||
|
||||
### Experimental
|
||||
|
||||
|
|
|
|||
|
|
@ -101,12 +101,17 @@ function Invoke-IcingaInternalServiceCall()
|
|||
$IcingaCR = '';
|
||||
|
||||
# In case we didn't receive a check result, fallback to local execution
|
||||
if ($null -eq $IcingaResult.$Command.checkresult) {
|
||||
if ([string]::IsNullOrEmpty($IcingaResult.$Command.checkresult)) {
|
||||
Write-IcingaEventMessage -Namespace 'Framework' -EventId 1553 -Objects 'The check result for the executed command was empty', $Command, $DebugArguments;
|
||||
return;
|
||||
}
|
||||
|
||||
$IcingaCR = ($IcingaResult.$Command.checkresult.Replace("`r`n", "`n"));
|
||||
if ([string]::IsNullOrEmpty($IcingaResult.$Command.exitcode)) {
|
||||
Write-IcingaEventMessage -Namespace 'Framework' -EventId 1553 -Objects 'The check result for the executed command was empty', $Command, $DebugArguments;
|
||||
return;
|
||||
}
|
||||
|
||||
$IcingaCR = ($IcingaResult.$Command.checkresult.Replace("`r`n", "`n"));
|
||||
|
||||
if ($IcingaResult.$Command.perfdata.Count -ne 0) {
|
||||
$IcingaCR += ' | ';
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ function Exit-IcingaExecutePlugin()
|
|||
[string]$Command = ''
|
||||
);
|
||||
|
||||
Exit-IcingaPluginNotInstalled -Command $Command;
|
||||
|
||||
Invoke-IcingaInternalServiceCall -Command $Command -Arguments $args;
|
||||
|
||||
try {
|
||||
|
|
@ -14,6 +12,8 @@ function Exit-IcingaExecutePlugin()
|
|||
Use-Icinga;
|
||||
}
|
||||
|
||||
Exit-IcingaPluginNotInstalled -Command $Command;
|
||||
|
||||
exit (& $Command @args);
|
||||
} catch {
|
||||
$ExMsg = $_.Exception.Message;
|
||||
|
|
|
|||
Loading…
Reference in a new issue