Powershell checks using high CPU on the server

When run with the following command, Powershell.exe -ExecutionPolicy Bypass -NoLogo -File C:\\ProgramData\\Sensu\\config\\get-module.ps1 where the script contains the command get-module, all i get from the agent is

Check did not write to STDOUT.

which is consistent with when i run it manually.

When i run the check with command get-module i get the following output

'get-module' is not recognized as an internal or external command, operable program or batch file.

This is because the agent would run this on command line rather than on a powershell terminal.

Finally i tried to run the powershell script on the instance directly and i got the following output on executing the file C:\\ProgramData\\Sensu\\config\\get-module.ps1

 > C:\ProgramData\Sensu\config\get-module.ps1

ModuleType Version    Name                                ExportedCommands                                                                                               
---------- -------    ----                                ----------------                                                                                               
Script     1.0.0.0    ISE                                 {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}                                                            
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...} 

I have asked my Windows engineer to help me out here as well

Hey all, did you found a way to run powershell service check without consuming high cpu ?
I am running the cpu\mem\disk checks with the Golang plugin and it works perfect, any chance there is plugin for service check for windows ?

hello @jspaleta i had configured check-memory-usage and check-disk-usage plugin to our servers
while getting the output for memory i am getting in bytes format . i need the data in human readble format and for disk usage i need only root volume storage not other storage. please share me any commands or documentation


Did you happen to take a gander at this plugin: nagiosfoundation versions. That collection does contain a service check.

Hey, actually i didn’t know this, will check and update thanks !