saltstack-formulas / sensu-formula

Salt Stack formula to manage Sensu.
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
23 stars 78 forks source link

api: allow to configure the API endpoint, without running the API service #14

Closed multani closed 8 years ago

multani commented 8 years ago

Some handlers (like the HipChat handler) require access to the API server to discover if the event is part of a stash or not (see https://github.com/sensu-plugins/sensu-plugin/blob/master/lib/sensu-handler.rb#L96 for more information).

This commit splits the configuration part from the service part, which allows the configuration file to be reused across states.

powellchristoph commented 8 years ago

Just so I understand, this is in the event that you have the api and sensu-server installed on separate servers. And certain handlers, which are on the sensu-server, require the api settings?

multani commented 8 years ago

Yes, it's only if the API server and the server itself are on different machines. When running an handler using the Sensu::Handler class (from https://github.com/sensu-plugins/sensu-plugin/blob/master/lib/sensu-handler.rb), the default handle method does something like this:

This happens for the HipChat handler for example, but might be for others as well (we are not using many others, but at least this one.)

powellchristoph commented 8 years ago

Thanks for the PR.