StackStorm-Exchange / stackstorm-sensu

st2 content pack containing sensu integrations
https://exchange.stackstorm.org/
Apache License 2.0
5 stars 6 forks source link

[Proposal] Isolating Sensu Event Handler's files as an Sensu Plugin. #8

Closed userlocalhost closed 7 years ago

userlocalhost commented 7 years ago

Background

This pack has files for Sensu Event Handler under the etc directory. The procedure to setup that file is written in the README, but this style has a restriction that Sensu Server and Sensu Client have to be in a StackStorm node which installed sensu-pack.

Problem

I guess, this makes distress user on a case that another Sensu server is already existed or an case of making redundant StackStorm nodes.

Proposal

To resolve this restriction, I think it's reasonable to port the Sensu Event Handler's files as a Sensu-Plugin. This makes user be able to get these files by the sensu-install command on a Sensu Server which is independent with StackStorm.

LindsayHill commented 7 years ago

You can copy the Sensu handler script to a separate Sensu server - it does not have to be the same server as the StackStorm server. The documentation should make this clearer.

But it does seem like a good idea to turn those handler files into a Sensu plugin. This should make it easier for all users.

userlocalhost commented 7 years ago

Thank you for your reply!

I've created a Sensu Plugin for StackStorm and ported the st2_handler.py to it. https://github.com/userlocalhost/sensu-plugins-stackstorm

In addition, I created a RubyGem for it. At the moment, people can install this plugin by sensu-install command like this.

vagrant@ubuntu2:~$ sensu-install -p stackstorm
[SENSU-INSTALL] installing Sensu plugins ...
[SENSU-INSTALL] determining if Sensu gem 'sensu-plugins-stackstorm' is already installed ...
false
[SENSU-INSTALL] Sensu plugin gems to be installed: ["sensu-plugins-stackstorm"]
[SENSU-INSTALL] installing Sensu gem 'sensu-plugins-stackstorm'
Fetching: sensu-plugins-stackstorm-0.1.1.gem (100%)
Successfully installed sensu-plugins-stackstorm-0.1.1
1 gem installed
[SENSU-INSTALL] successfully installed Sensu plugins: ["sensu-plugins-stackstorm"]
vagrant@ubuntu2:~$

If you've never mind, I'd like to transfer the ownership of this plugin to the sensu-plugins organization. This make it listed in the SENSU PLUGINS page.

LindsayHill commented 7 years ago

That looks great!

Transferring ownership seems like a very good idea. Thank you for your work here

Mierdin commented 7 years ago

YESSSSSSS - this is a great idea.

arm4b commented 7 years ago

Indeed nice idea and great job @userlocalhost! 💯 Would be good to update the stackstorm-sensu README about using new plugin once the transfer ownership is done (please sync-up about this with anyone from StackStorm in #community Slack you'll find online).

userlocalhost commented 7 years ago

Thank you for your support!

I got it, @armab. I'll send a request to make that pack transfer the ownership of that pack, and then report it to #community channel in the Slack.

LindsayHill commented 7 years ago

Addressed by #9 (and the work done on the Sensu side)