sensu-plugins / sensu-plugins-cpu-checks

This plugin provides native CPU instrumentation for monitoring and metrics collection, including: CPU usage and metrics for user, nice, system, idle, iowait, irq, softirq, steal, and guest.
http://sensu-plugins.io
MIT License
13 stars 34 forks source link

sh: check-cpu.rb: not found #76

Open rforberger opened 4 years ago

rforberger commented 4 years ago

Hi,

in the Sensu Backend I am getting sh: check-cpu.rb: not found.

I have installed the sensu-plugins-cpu-checks asset with the following manifest:

---
type: Asset
api_version: core/v2
metadata:
  name: sensu-plugins-cpu-checks
spec:
  builds:
  - url: https://s1artproxy:PASSWORD@artifactory:8088/artifactory/remote-sensu-assets/24e5a5d7ff0a5e63b0a6902f1224b7d4592cbdc9/sensu-plugins-cpu-checks_4.1.0_centos7_linux_amd64.tar.gz
    sha512: 8a018622018220323588a0d69ce0ee1e8c3ae72ad708108eb105006e1453a507289445eefb222da838b132106abf86910e2226d2148cc90ae64def9e7d887584
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform_family == 'rhel'
    - entity.system.platform_version.split('.')[0] == '7'

But I don't find the check-cpu.rb script on my sensu-agent container. Other plugins install without problems.

How can I check why my installation of sensu-plugins-cpu-checks is failing?

Best regards, rforberger

rforberger commented 4 years ago

In the log of the sensu-backed I get:

{"component":"rbac","level":"debug","msg":"request authorized by the binding cluster-admin","time":"2020-03-19T10:03:12Z","zz_request":{"apiGroup":"core","apiVersion":"v2","namespace":"sensu-poc","resource":"assets","resourceName":"sensu-plugins-cpu-checks","username":"admin","verb":"update"}}
{"component":"apid","duration":"1.040ms","level":"info","method":"PUT","msg":"request completed","path":"/api/core/v2/namespaces/sensu-poc/assets/sensu-plugins-cpu-checks","size":0,"status":201,"time":"2020-03-19T10:03:12Z"}
sensu-discourse commented 4 years ago

This issue has been mentioned on Sensu Community. There might be relevant details there:

https://discourse.sensu.io/t/sh-check-cpu-rb-not-found/1676/1

derekgroh commented 4 years ago

What version of the backend are you using?

Can you provide your check definition? It should include both runtime assets sensu-plugins-cpu-check, sensu-ruby-runtime

Here is my check definition for reference:

$ sensuctl check info linux_cpu === linux_cpu Name: linux_cpu Interval: 60 Command: check-cpu.rb -w 75 -c 90 Cron: Timeout: 30 TTL: 0 Subscriptions: linux Handlers: default Runtime Assets: sensu-plugins-cpu-checks, sensu-ruby-runtime Hooks: Publish?: true Stdin?: false Proxy Entity Name: Namespace: default Metric Format: Metric Handlers:

rforberger commented 4 years ago

HI @derekgroh ,

I am using the backend docker container sensu/sensu-rhel:latest (5.18.1).

My check definition looks like that:

---
type: CheckConfig
metadata:
  name: check-cpu
spec:
  command: "check-cpu.rb"
  handlers: []
  high_flap_threshold: 0
  interval: 10
  low_flap_threshold: 0
  publish: true
  runtime_assets:
  - sensu-plugins/sensu-plugins-cpu-checks
  - sensu/sensu-ruby-runtime
  subscriptions:
  - linux kubernetes

sensuctl --namespace sensu-poc check info check-cpu

=== check-cpu
Name:              check-cpu
Interval:          10
Command:           check-cpu.rb
Cron:              
Timeout:           0
TTL:               0
Subscriptions:     linux kubernetes
Handlers:          
Runtime Assets:    sensu-plugins/sensu-plugins-cpu-checks, sensu/sensu-ruby-runtime
Hooks:             
Publish?:          true
Stdin?:            false
Proxy Entity Name: 
Namespace:         sensu-poc
Metric Format:     
Metric Handlers:   
derekgroh commented 4 years ago

I don't have much experience running sensugo in kubernetes, take a look at https://github.com/sensu/sensu-k8s-quick-start if you haven't already, maybe it provides some direction