The error message indicates that mailer.rb:19 is failing:
It looks like the "mail" gem is not installed.
···
On Tue, Mar 24, 2015 at 1:37 AM, Adithya Khamithkar <nkadithya31@gmail.com> wrote:
I have using mailer.rb for my sensu to send out emails but it failed and I
keep getting this error in logs.{"timestamp":"2015-03-24T13:53:07.779780+0530","level":"info","message":"handler
output","handler":{"type":"pipe","command":"/opt/sensu/embedded/bin/ruby
/etc/sensu/handlers/mailer.rb -j
'/etc/sensu/conf.d/mailer.json'","name":"default"},"output":["/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mixlib-cli-1.5.0/lib/mixlib/cli.rb:191:in
`parse_options': invalid option: -j (OptionParser::InvalidOption)\n","\tfrom
/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:16:in
`initialize'\n","\tfrom
/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:52:in
`new'\n","\tfrom
/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:52:in
`block in
<class:Handler>'\n","/opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in
`require': cannot load such file -- mail (LoadError)\n","\tfrom
/opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in
`require'\n","\tfrom /etc/sensu/handlers/mailer.rb:19:in `<main>'\n"]}
{"timestamp":"2015-03-24T13:53:07.783175+0530","level":"info","message":"handler
output","handler":{"type":"pipe","command":"/opt/sensu/embedded/bin/ruby
/etc/sensu/handlers/mailer.rb -j
'/etc/sensu/conf.d/mailer.json'","name":"default"},"output":["/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mixlib-cli-1.5.0/lib/mixlib/cli.rb:191:in
`parse_options': invalid option: -j (OptionParser::InvalidOption)\n","\tfrom
/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:16:in
`initialize'\n","\tfrom
/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:52:in
`new'\n","\tfrom
/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:52:in
`block in
<class:Handler>'\n","/opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in
`require': cannot load such file -- mail (LoadError)\n","\tfrom
/opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in
`require'\n","\tfrom /etc/sensu/handlers/mailer.rb:19:in `<main>'\n"]}Can some one help me fix this?
Thanks,