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

Invoke-IcingaCheckProcess Error processing performance data #617

Closed
drapiti opened this issue Apr 29, 2023 · 10 comments · Fixed by #618 or Icinga/icinga-powershell-plugins#346
Closed
Assignees
Labels
Bug There is an issue present
Milestone

Comments

@drapiti
Copy link

drapiti commented Apr 29, 2023

The following error is presented with the Invoke-IcingaCheckProcess using the latest framerwork:
Icinga Exception: Unable to process transformation of arguments in parameter 'NoPerfData'. Cannot convert value 'System.String' to type 'System.Management.Automation.SwitchParameter'. Boolean parameters accept only Boolean values ​​and numbers, such as $True, $False, 1, or 0. CheckCommand: Invoke-IcingaCheckProcess Arguments: System.Collections.Hashtable StackTrace: in Exit-IcingaExecutePlugin, C:\Program Files\WindowsPowerShell\Modules\ icinga-powershell-framework\cache\framework_cache.psm1: line 26525 in , : line 1

Comand inspect:
'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' '-NoProfile' '-NoLogo' '-ExecutionPolicy' 'ByPass' '-C' 'try { Use-Icinga -Minimal; } catch { Write-Output '\''The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check https://icinga.com/docs/windows for further details'\''; Write-Output '\''Error:'\'' $($_.Exception.Message)Components:rn$( Get-Module -ListAvailable '\''icinga-powershell-*'\'' )rn'\''Module-Path:'\''rn$($Env:PSModulePath); exit 3; }; Exit-IcingaExecutePlugin -Command '\''Invoke-IcingaCheckProcess'\'' ' '-MemoryWarning' '60%' '-MemoryCritical' '70%' '-CPUWarning' '50%' '-CPUCritical' '60%' '-Process' '@('\''powershell'\'')' '-NoPerfData' '-ThresholdInterval' ''\''5m'\'''

@LordHepipud LordHepipud self-assigned this May 5, 2023
@LordHepipud
Copy link
Collaborator

Thank you for the issue. Which version of the Framework are you using? This shouldn't be a problem and will try to replicate the issue.

@LordHepipud LordHepipud added the Bug There is an issue present label May 5, 2023
@LordHepipud LordHepipud added this to the v1.11.0 milestone May 5, 2023
@LordHepipud LordHepipud transferred this issue from Icinga/icinga-powershell-plugins May 5, 2023
@LordHepipud
Copy link
Collaborator

The linked PR should resolve the issue, atleast in my test environment. Can you please verify this?

@drapiti
Copy link
Author

drapiti commented May 5, 2023

The linked PR should resolve the issue, atleast in my test environment. Can you please verify this?

Will do, post back soon.

@drapiti
Copy link
Author

drapiti commented May 5, 2023

I can confirm the issue is fixed. I think there are some other cosmetic issues with the output. For example in the below output the page file usage is showing in % rather than in bytes or KiB. This occurs when I use a % as a threshold.
image
Also if I set for example a threshold of 30% for a process over the total cpu usage of the server then this output is a little confusing. As it is telling me 97% cpu usage of the total cpu usage of the server but this is not the percentage in use relative to the specific process. Here I want to know when the powerhell process is using more than 30% of the total cpu usage for example. The powershell process itself is not at 97%.
image

@drapiti
Copy link
Author

drapiti commented May 5, 2023

Occassionally throwing this error also, so maybe the % is not being correctly interpreted. This message comes and goes.
image
Working with same settings:
image

Variables used in this example are as follows:
image

@LordHepipud LordHepipud reopened this May 6, 2023
@LordHepipud
Copy link
Collaborator

Thanks for testing.

For the CPU usage: The 97% value seems fine to me, as this indicates that one thread of your CPU is used by 97%. The value can go beyond 100%, as it will tell the user on how many cores are consumed by a single application or a pool of applications.

I need to have a look on that page file behavior. You are correct, this doesn't seem to be right.

@LordHepipud
Copy link
Collaborator

Can you please test the linked PR for the plugins? This should resolve the issue with the pagefile

@drapiti
Copy link
Author

drapiti commented May 10, 2023

Can you please test the linked PR for the plugins? This should resolve the issue with the pagefile
@LordHepipud, I am not sure if it is working as I am still getting a very large value followed by the percentage unit.
image

@LordHepipud
Copy link
Collaborator

Have you rebuild the plugin cache? You can do so by using

Copy-IcingaFrameworkCacheTemplate

Afterwards you can execute the plugin again with a new shell and the changes should apply.

@drapiti
Copy link
Author

drapiti commented May 10, 2023

Have you rebuild the plugin cache? You can do so by using

Copy-IcingaFrameworkCacheTemplate

Afterwards you can execute the plugin again with a new shell and the changes should apply.

Great yes looks better now re-published.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment