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

ubuntu excluded, not using platform_family #65

Open FredrikWendt opened 5 years ago

FredrikWendt commented 5 years ago

tl;dr: Suggest changing platform to platform_family.

After adding this asset to a Sensu Backend, using sensuctl asset add sensu-plugins/sensu-plugins-cpu-checks --rename sensu-plugins-cpu-checks, the current 4.0.0 release shows this Bonsai metadata (sensuctl asset list --format=yaml):

---
type: Asset
api_version: core/v2
metadata:
  annotations:
    io.sensu.bonsai.api_url: https://bonsai.sensu.io/api/v1/assets/sensu-plugins/sensu-plugins-cpu-checks
    io.sensu.bonsai.name: sensu-plugins-cpu-checks
    io.sensu.bonsai.namespace: sensu-plugins
    io.sensu.bonsai.tags: ruby-runtime-2.4.4
    io.sensu.bonsai.tier: Community
    io.sensu.bonsai.url: https://bonsai.sensu.io/assets/sensu-plugins/sensu-plugins-cpu-checks
    io.sensu.bonsai.version: 4.0.0
  name: sensu-plugins-cpu-checks
  namespace: default
spec:
  builds:
  - filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform == 'debian'
    headers: null
    sha512: da5a183ad1a1f76962561eed659c6184b3e5d6a412432e1ccb4297cce123c41f9a8bb4fdb9ab19663aada978ea862ab2bd5f00bc91e4769ddd87543f5662b3af
    url: https://assets.bonsai.sensu.io/68546e739d96fd695655b77b35b5aabfbabeb056/sensu-plugins-cpu-checks_4.0.0_debian_linux_amd64.tar.gz

(I removed rhel and alpine sections.)

This prevents the asset-managers in sensu agents running on Ubuntu from fetching this asset when running checks. I don't think exluding Ubuntu is intentional?

Thus I suggest changing the metadata from platform to platform_family, and quickly release a 4.0.1.

FredrikWendt commented 5 years ago

The only workaround I know of, is to manually skip Bonsai registry (you can still download stuff, but the metadata available is ignored), and just sensuctl asset create the thing instead, but forces you to name your assets differently depending on platform (which forces you to duplicate checks as well ...)

Example:

sensuctl asset create sensu-plugins-cpu-checks \
  --url https://assets.bonsai.sensu.io/68546e739d96fd695655b77b35b5aabfbabeb056/sensu-plugins-cpu-checks_4.0.0_debian_linux_amd64.tar.gz \
  --sha512 da5a183ad1a1f76962561eed659c6184b3e5d6a412432e1ccb4297cce123c41f9a8bb4fdb9ab19663aada978ea862ab2bd5f00bc91e4769ddd87543f5662b3af