Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$CheckCommand variable not defined in framework_cache.psm1 #675

Open
dr-roshyara opened this issue Dec 15, 2023 · 0 comments
Open

$CheckCommand variable not defined in framework_cache.psm1 #675

dr-roshyara opened this issue Dec 15, 2023 · 0 comments

Comments

@dr-roshyara
Copy link

dr-roshyara commented Dec 15, 2023

I am trying to connect my icinga2 to monitor windows host using powershell framework. the connection is all ok . However I still have problem . So let me describe the issue:

Issue:
The Icinga for Windows service check daemon reported a pending status for the icinga_powershell_memory service. CPU Check is also pending. If I apply the commands locally, its all working. api connection is established. However the rest api does is not getting any informatoin.

The daemon encountered an exception during the execution of a PowerShell plugin,
with an error related to the recognition of the term "". Troubleshooting Steps and Findings:

  1. Endpoint Health Check:
    Ensured that 'windows host machine' is responsive and healthy.
    Checked for any issues on the Windows host that might affect communication with Icinga.

  2. Event Viewer Check:
    Explored 'System' and 'Application' logs on 'windows host machine' in the Event Viewer.
    Checked for any WinRM-related errors or warnings.

  3. Icinga API Connection:

Investigated API connection warnings and disconnections for the 'icinga' identity.
Configuration Update:
Observed the receipt and application of configuration updates from 'icinga'.

  1. API Client Connection:
    Monitored API client connections and disconnections for 'icinga'.
  • WinRM Port and Firewall:
    Identified and resolved an issue with WinRM port (5665) connectivity by adding a firewall rule.
    Confirmed successful connectivity using Test-NetConnection.

  • Icinga PowerShell Script Execution:
    Encountered a specific error related to the recognition of "" during the execution of a PowerShell script.

  • Check PowerShell Script/Command:

Investigated the $CheckCommand variable, which is expected to contain a valid PowerShell command or script path.
However I could not find the solution .

  • Event Log error in windows host machine
    In windows Event log file the error is as follwoing
    Icinga for Windows service check daemon exception on plugin execution Icinga for Windows failed to execute a plugin within the background service check daemon with an exception Icinga for Windows exception report: Exception Message: Die Benennung "\" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang. Invocation Name: & Command Origin: Internal Script Line Number: 25575 Exact Position: In C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:25575 Zeichen:15 + & $CheckCommand @Arguments | Out-Null; + ~~~~~~~~~~~~~ StackTrace: bei System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) bei lambda_method(Closure , Object[] , StrongBox1[] , InterpretedFrame ) Call Stack: Command Arguments ------- --------- Get-IcingaExceptionString {ExceptionObject=Die Benennung "" wurde nicht als Name eines Cmdlet,... Write-IcingaEventMessage {EventId=1451, Namespace=Framework, ExceptionObject=Die Benennung ""... Add-IcingaServiceCheckTask {CheckCommand=, Interval=60, Arguments=System.Collections.Hashtable,... Object details: \ `
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant