Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`require': cannot load such file -- mail #64

Open
downright770 opened this issue Jan 5, 2018 · 5 comments
Open

`require': cannot load such file -- mail #64

downright770 opened this issue Jan 5, 2018 · 5 comments

Comments

@downright770
Copy link

here is the server log file

"version":"0.26.5","timestamp":1515181908},"check":{"command":"/etc/sensu/plugins/sensu-plugins-memory-checks-master/bin/check-memory-percent.rb","handler":"mailer","contact":"support","subscribers":["Infrastructure"],"interval":5,"name":"check-memory-percent","issued":1515181910,"executed":1515181910,"duration":0.082,"output":"MEM CRITICAL - system memory usage: 96%\n","status":2,"type":"standard","history":["2","2","2","2","2","2","2","2","2","2","2","2","2","2","2","2","2","2","2","2","2"],"total_state_change":0},"occurrences":259317,"occurrences_watermark":259317,"action":"create","timestamp":1515181910,"id":"9ea995ea-aa4c-44c2-af66-bb43b4f4dac6","last_state_change":1513884914,"last_ok":1513884914,"silenced":false,"silenced_by":[]}} {"timestamp":"2018-01-05T14:51:50.901343-0500","level":"error","message":"handler output","handler":{"type":"pipe","command":"/etc/sensu/plugins/sensu-plugins-mailer-master/bin/handler-mailer.rb","name":"mailer"},"event":{"id":"9ea995ea-aa4c-44c2-af66-bb43b4f4dac6"},"output":["/opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- mail (LoadError)\n\tfrom /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require'\n\tfrom /etc/sensu/plugins/sensu-plugins-mailer-master/bin/handler-mailer.rb:18:in

'\nignoring event -- no handler defined\n"]}`

@downright770
Copy link
Author

Was able to get this going after installing
/opt/sensu/embedded/bin/gem install mail
cp mail.rb into the dir /opt/sensu/embedded/bin/
/opt/sensu/embedded/bin/gem install erubis
/opt/sensu/embedded/bin/gem install ruby-ntlm

still get error
{"timestamp":"2018-01-08T15:16:57.202950-0500","level":"error","message":"unknown handler","handler_name":"default"} {"timestamp":"2018-01-08T15:16:57.444794-0500","level":"info","message":"handler output","handler":{"type":"pipe","command":"/etc/sensu/plugins/sensu-plugins-mailer-master/bin/handler-mailer.rb","name":"mailer"},"event":{"id":"9ea995ea-aa4c-44c2-af66-bb43b4f4dac6"},"output":["mail -- sent alert for prd-confluence-01.mtl.bios.run/check-memory-percent to [email protected]\n"]}

and just keeps sending the email every time it does the check.

@majormoses
Copy link
Member

That is odd, it should have been pulled in as a dependency when it installed as it is part of the runtime dependencies here how did you install the plugin?

@nynhex
Copy link

nynhex commented Feb 23, 2018

We're also experiencing the exact same problem using this plugin with Sensu.

I installed the mail gem as such sudo /opt/sensu/embedded/bin/gem install mail

Restarted all the sensu services, and receive the following stacktrace/error when trying to fire the handler/plugin:

:{"id":"141e08d8-3fac-4f94-8150-396bc5d31bc9"},"output":["/opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- erubis (LoadError)\n\tfrom /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'\n\tfrom /etc/sensu/plugins/mailer.rb:20:in `<main>'\nignoring event -- no handler defined\n"]}

@majormoses
Copy link
Member

@majormoses
Copy link
Member

Can you please show me the output of sudo /opt/sensu/embedded/bin/gem list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants