sensu-plugins / sensu-plugins-mailer

This plugin is an email handler for Sensu.
http://sensu-plugins.io
MIT License
17 stars 37 forks source link

Object#timeout is deprecated, use Timeout.timeout #21

Closed Salamek closed 8 years ago

Salamek commented 8 years ago

{"timestamp":"2016-04-14T08:41:34.612166+0200","level":"info","message":"handler output","handler":{"type":"pipe","command":"handler-mailer.rb","json_config":"mailer.json","name":"mailer"},"output":["/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:134:in block in filter_silenced': Object#timeout is deprecated, use Timeout.timeout instead.\n/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:134:inblock in filter_silenced': Object#timeout is deprecated, use Timeout.timeout instead.\n/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:134:in block in filter_silenced': Object#timeout is deprecated, use Timeout.timeout instead.\n/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-0.2.0/bin/handler-mailer.rb:215:inhandle': Object#timeout is deprecated, use Timeout.timeout instead.\nmail -- timed out while attempting to create an incident -- nemec.eu/mem-percent\n"]}

eheydrick commented 8 years ago

Would be great to fix this. Care to create a PR?

asciifaceman commented 8 years ago

Same here:

{"timestamp":"2016-06-08T17:23:30.243635-0700","level":"info","message":"handler output","handler":{"type":"pipe","command":"/opt/sensu/embedded/bin/handler-mailer.rb","name":"mailer"},"output":["/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:134:in `block in filter_silenced': Object#timeout is deprecated, use Timeout.timeout instead.\n/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:134:in `block in filter_silenced': Object#timeout is deprecated, use Timeout.timeout instead.\n/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:134:in `block in filter_silenced': Object#timeout is deprecated, use Timeout.timeout instead.\n/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-0.2.0/bin/handler-mailer.rb:215:in `handle': Object#timeout is deprecated, use Timeout.timeout instead.\nmail -- sent alert for server_hostname/keepalive to redacted@company.com\n"]}
sstarcher commented 8 years ago

@asciifaceman it's a deprecation from ruby 2.3.0 feel free to downgrade your ruby

sstarcher commented 8 years ago

fixed via adding Timeout.

ddavison commented 8 years ago

does this have to be released in the next version? we are at 0.3.1, i assume this fix will be put into 0.3.2?

or is there another way i can get this update

EDIT: I guess this isn't a "blocker".. no rush on releasing it. it won't actually cause errors.

eheydrick commented 8 years ago

hi @ddavison, new release with the timeout fixes will be out soon.

eheydrick commented 8 years ago

1.0.0 has been released to rubygems.