sensu-plugins-windows icon indicating copy to clipboard operation
sensu-plugins-windows copied to clipboard

Odd behavior of cpu-load check

Open asachs01 opened this issue 5 years ago • 5 comments

Greetings Windows folks! I'm trying to wrap my mind around and issue that I'm seeing with the cpu-load ps script.

I'm testing the scripts out using @samroy92 's asset version of the plugin (https://github.com/samroy92/sensu-plugins-windows) and seeing some odd behavior.

When using this check from the readme:

---
type: CheckConfig
api_version: core/v2
metadata:
  namespace: default
  name: win-cpu-check
spec:
  command: powershell.exe -ExecutionPolicy ByPass -C check-windows-cpu-load.ps1 90
    95
  subscriptions:
  - windows
  handlers:
  - slack
  - email
  runtime_assets:
  - samroy92/sensu-plugins-windows
  interval: 10
  publish: true

Sensu only ever shows a warning, even if the load is over the threshold:

Screen Shot 2019-10-29 at 10 04 54 AM

However, if the full path to the check executable is provided, the check will return a critical status as expected.

Since my knowledge of Windows arcana isn't great, I was wondering if anyone else had seen this sort of behavior. I'm not quite sure if this is pathing (seems like it's not), or something in the way that the script itself is handling things.

asachs01 avatar Oct 29 '19 14:10 asachs01