sensu-plugins / sensu-plugins-slack

Sensu Slack chat handlers
http://sensu-plugins.io
MIT License
30 stars 54 forks source link

Can't get working handler #32

Open ctal80 opened 7 years ago

ctal80 commented 7 years ago

Hi, I integrated the handler into my sensu configuration but can't get messages sent to my slack channel.

Inside the server log all I can see is the following error:

{"timestamp":"2017-01-02T14:22:28.652071+0200","level":"info","message":"handler output","handler":{"type":"pipe","command":"/opt/sensu/embedded/bin/ruby /var/lib/gems/1.9.1/gems/sensu-plugins-slack-0.0.1/bin/handler-slack.rb","severities":["critical","unknown"],"name":"slack"},"output":["/opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:878:in initialize': Connection timed out - connect(2) (Errno::ETIMEDOUT)\n","\tfrom /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:878:inopen'\n","\tfrom /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:878:in block in connect'\n","\tfrom /opt/sensu/embedded/lib/ruby/2.0.0/timeout.rb:52:intimeout'\n","\tfrom /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:877:in connect'\n","\tfrom /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:862:indo_start'\n","\tfrom /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:851:in start'\n","\tfrom /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:1373:inrequest'\n","\tfrom /var/lib/gems/1.9.1/gems/sensu-plugins-slack-0.0.1/bin/handler-slack.rb:74:in post_data'\n","\tfrom /var/lib/gems/1.9.1/gems/sensu-plugins-slack-0.0.1/bin/handler-slack.rb:54:inhandle'\n","\tfrom /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:55:in `block in '\n"]}

Any suggestions?

Thanks

Tal

jothoma1 commented 7 years ago

Hi, i cant get this slack plugin working too... I dont have the same error as you, here is mine:

{"timestamp":"2017-01-30T16:21:54.303246+0100","level":"info","message":"handler output","handler":{"type":"pipe","command":"handler-slack.rb -j slack","severities":["critical","unknown"],"name":"slack"},"output":["/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:933:in connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (OpenSSL::SSL::SSLError)\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:933:inconnect'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:863:in do_start'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:852:instart'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1398:in request'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-slack-1.0.0/bin/handler-slack.rb:140:inpost_data'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-slack-1.0.0/bin/handler-slack.rb:92:in handle'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.2/lib/sensu-handler.rb:81:inblock in '\nwarning: event filtering in sensu-plugin is deprecated, see http://bit.ly/sensu-plugin\nwarning: occurrence filtering in sensu-plugin is deprecated, see http://bit.ly/sensu-plugin\n"]}

I dont know why it's talking about SSL. I can do a curl on the webhook it works, and i m using it for something else. Do you find something ? Someone has an idea ? Thanks in advance

majormoses commented 7 years ago

can you validate which version of openssl is installed? I have a sneaking suspicion that it is caused by out of date dependencies.

majormoses commented 7 years ago

I also suspect that if its possibly self signed cert or an CA who is not in good standing you might be hitting this: https://github.com/sensu-plugins/sensu-plugins-http/issues/40