sensu-plugins / sensu-plugin

A framework for writing Sensu plugins & handlers with Ruby.
http://sensuapp.org
MIT License
126 stars 117 forks source link

SSL_connect returned=1 errno=0 state=error: certificate verify failed #171

Closed Northwood128 closed 7 years ago

Northwood128 commented 7 years ago

Hi peeps!

I'm having trouble setting up my handlers because of an SSL error from the sensu-handler.rb This is what I get when I try to feed an event to handler-mailer.rb

[root@monitor01 me]# cat event.json | /opt/sensu/embedded/bin/handler-mailer.rb warning: event filtering in sensu-plugin is deprecated, see http://bit.ly/sensu-plugin /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) from /opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:933:inconnect' from /opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:863:in do_start' from /opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:852:instart' from /opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:584:in start' from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.5/lib/sensu-handler.rb:159:inapi_request' from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.5/lib/sensu-handler.rb:197:in stash_exists?' from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.5/lib/sensu-handler.rb:209:inblock (2 levels) in filter_silenced' from /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:91:in block in timeout' from /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:33:inblock in catch' from /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:33:in catch' from /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:33:incatch' from /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:106:in timeout' from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.5/lib/sensu-handler.rb:208:inblock in filter_silenced' from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.5/lib/sensu-handler.rb:206:in each' from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.5/lib/sensu-handler.rb:206:infilter_silenced' from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.5/lib/sensu-handler.rb:36:in filter' from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.5/lib/sensu-handler.rb:98:inblock in '

My sensu-api is behind a load balancer with an self-signed cert. Is there a way I can tell it not to try to validate the cert? For what I can tell, It tries to talk to the stashes API and it fails. So my emails will not flow.

Northwood128 commented 7 years ago

By the way, I am using 1.4.5

Northwood128 commented 7 years ago

As an update, I think my emails are flowing. It looked like it had stopped because of a filter issue, but still, the error gets logged from time to time.

majormoses commented 7 years ago

https://blog.sensuapp.org/deprecating-event-filtering-in-sensu-plugin-b60c7c500be3

majormoses commented 7 years ago

@Northwood128 do you still need help or with the above are you good?

cwjohnston commented 7 years ago

Closing due to inactivity. Please open a new issue if you are still having difficulty?