Closed multani closed 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?
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.)
Thanks for the PR.
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.