sensu-plugins / sensu-plugins-sensu

This plugin provides monitoring and metrics for Sensu.
http://sensu-plugins.io
MIT License
12 stars 35 forks source link

use sensu 0.26+ internal client names. #42

Closed majormoses closed 7 years ago

majormoses commented 7 years ago

In sensu version 0.26 clients create and subscribes to a unique client subscription named after it. It should look like "client:#{client_name}", this changes the fallback from "#{client_name}" to "client:#{client_name}" when the check does not have an attribute of trigger_on.

Credit: https://github.com/Ssawa/sensu-plugins-sensu/commit/764ca7b5164689c1f0cc1d534d5bb7008125f5c1

Signed-off-by: Ben Abrams me@benabrams.it

Pull Request Checklist

closes #31

General

Purpose

Leverage new built in auto created client (that it auto subscribes to).

Known Compatibility Issues

This is a breaking change, for all clients that are < 0.26 you must set trigger_on as the default has changed from the client name to an internal client name that it auto subscribes to.

portertech commented 7 years ago

@majormoses you could have a setting that uses the legacy (custom) client subscription convention.

majormoses commented 7 years ago

True, but they also could use trigger_on which would accomplish the same thing right? This simply changes the default to match versions 0.26+ and are still backwards compatible with a configuration change.

eheydrick commented 7 years ago

They can add a custom client subscription in the new "client:client_name" format or keep running the previous version. Or better yet, upgrade.

eheydrick commented 7 years ago

Actually to be backwards compatible you could have both old and new format in the subscribers array. The client will only run one instance of a check at a time so this should be safe in the case where someone upgrades and still has the legacy subscription.

majormoses commented 7 years ago

@eheydrick updated per your suggestion and have updated the changelog to reflect.

eheydrick commented 7 years ago

Released in https://rubygems.org/gems/sensu-plugins-sensu/versions/2.2.2.