sensu-plugins/sensu-plugins-mailer

Errors when run again Sensu 0.24.1

Closed this issue · 4 comments

TJC commented

I'm getting a lot of errors logged that look like this:

/bin/handler-mailer.rb:141:in `build_body': undefined method `[]' for nil:NilClass (NoMethodError)
    from sensu-plugins-mailer-0.3.1/bin/handler-mailer.rb:169:in `handle'
    from sensu-handler.rb:55:in `block in <class:Handler>'

and also

sensu-handler.rb:134:in `block in filter_silenced': Object#timeout is deprecated, use Timeout.timeout instead.
Evesy commented

@TJC Would you mind posting the json for your mail handler & the json for your mail handlers configuration (With any sensitive stuff redacted of course), along with the full directory path they reside in?

The second issue you mentioned has recently been fixed so you may need to update the relevant ruby gems on your server.

TJC commented

Sorry to have to ask, but how do I get sensu to update the plugin?
sensu-install -p mailer just reports "plugin is already installed".

Evesy commented

No worries, if you run the below to see what version you have installed (v1.0.0 is was the release with the timeout fix):

gem list sensu-plugins-mailer
Or if you're using the embedded ruby:
/opt/sensu/embedded/bin/gem list sensu-plugins-mailer

If you're not on the right version then this should update it for you:
gem update sensu-plugins-mailer
/opt/sensu/embedded/bin/gem update sensu-plugins-mailer

Hope that helps

TJC commented

Cheers - we were on 0.3.1 before, now 1.0.0. Looks like that'll fix the Timeout warnings.

I don't think I've seen any of the non-timeout-related errors for a while -- I changed the config around to achieve it. But source control doesn't have that original version so I can't tell you what changed.
I'm sorry this bug report is useless.