-
Notifications
You must be signed in to change notification settings - Fork 31
Description
as mentioned in https://community.icinga.com/t/own-checks-downt-work-since-i-installed-new-agent-on-windows/7845/8
own checks fail if the name does not start with invoke-icinga.
Expected Behavior
check should execute
Current Behavior
own checks fail if name differs from invoke-icinga*
manual checks failed with newer powershell framework (this worked before)
Possible Solution
| if ($CheckCommand.ToLower() -Like 'invoke-icingacheck*') { |
use a more generic way
or
| return; |
replace return with $this.__CheckCommand = "Generic_Icinga_Check";
Steps to Reproduce (for bugs)
- write own check Invoke-MyIcingaCheckXYZ
- use-icinga
- Invoke-MyIcingaCheckXYZ
or: - $check= New-IcingaCheck -Name "Check" -Value 1
- $check.CritIfLowerThan(2)
- New-IcingaCheckresult -Check $check-Compile
fails because there is no checkcommand
Error:
Ausnahme beim Aufrufen von "Compile" mit 0 Argument(en): "Es ist nicht möglich, einen Index auf ein NULL-Array anzuwenden."
In C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:20871 Zeichen:16
return $IcingaCheckResult.Compile();
CategoryInfo : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : ScriptMethodRuntimeException
Context
It should be possible to execute a check manually without inside a psm1 file
It should be possible to execute a checkcommand with a different name
Your Environment
Windows 10
Powershell 5
framework 1.5.2 -1.6
Best regard
Nicolas