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

Just upgraded to latest version of mailer and am now getting an error while running #24

Open jbehrends opened 8 years ago

jbehrends commented 8 years ago

Running on CentOS 7.1 Sensu v0.22.1

I was use a previous version of mailer on my sensu server without issue. I just upgraded to the latest version on Github and am now running into an issue which has something to do with the erubis gem.

I see the following error anytime sensu tries to send an email using the latest mailer handler:

"/usr/local/share/gems/gems/mixlib-cli-1.5.0/lib/mixlib/cli.rb:191:in `parse_options': invalid option: --json_config (OptionParser::InvalidOption)
from /usr/local/share/gems/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:16:in `initialize'
from /usr/local/share/gems/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:52:in `new'
from /usr/local/share/gems/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:52:in `block in <class:Handler>'
/usr/share/gems/gems/abrt-0.0.6/lib/abrt/handler.rb:63:in `initialize': No such file or directory - \"/var/run/abrt/abrt.socket\" (Errno::ENOENT)
from /usr/share/gems/gems/abrt-0.0.6/lib/abrt/handler.rb:63:in `new'\n\tfrom /usr/share/gems/gems/abrt-0.0.6/lib/abrt/handler.rb:63:in `abrt_socket'
from /usr/share/gems/gems/abrt-0.0.6/lib/abrt/handler.rb:22:in `report'\n\tfrom /usr/share/gems/gems/abrt-0.0.6/lib/abrt/handler.rb:41:in `write_dump'
from /usr/share/gems/gems/abrt-0.0.6/lib/abrt/handler.rb:13:in `handle_exception'
from /usr/share/gems/gems/abrt-0.0.6/lib/abrt.rb:7:in `block in <top (required)>'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- erubis (LoadError)
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
from /etc/sensu/handlers/mailer.rb:20:in `<main>'"

Like I said, this was working fine on a previous version. But for the curious, this is how the handler is getting called:

"command": "/usr/local/bin/handler-mailer.rb --json_config jbehrends",

So to try and track down what was causing the issue, I tried commenting out all references to the "erubis" gem, and once I did that the handler actually ran. Although it no longer did anything, it at least ran.

These are the gems I have installed on my system:

$ gem list

*** LOCAL GEMS ***

abrt (0.1.1, 0.0.6)
activesupport (4.2.3)
aws (2.10.2)
bigdecimal (1.2.0)
chronic (0.10.2)
domain_name (0.5.20160310)
erubis (2.7.0)
hipchat (0.13.0)
http-cookie (1.0.2)
http_connection (1.4.4)
httparty (0.11.0)
i18n (0.7.0)
io-console (0.4.2)
jira-ruby (0.1.16)
json (1.8.3, 1.7.7)
mail (2.6.3)
mailgun-ruby (1.0.3)
mime-types (2.6.1)
minitest (5.8.2)
mixlib-cli (1.5.0)
multi_json (1.11.2)
multi_xml (0.5.5)
netrc (0.11.0)
oauth (0.4.7)
psych (2.0.0)
rdoc (4.0.0)
redis (3.2.1)
redphone (0.0.63)
rest-client (1.8.0)
ruby-puppetdb (1.5.0)
sensu-plugin (1.2.0)
sensu-plugins-mailer (0.2.0)
thread_safe (0.3.5)
tzinfo (1.2.2)
unf (0.1.4)
unf_ext (0.0.7.2)
uuidtools (2.1.5)
xml-simple (1.1.5)

So at this point I'm stumped and looking for any help.