Hi all,
I am not able to send out using mailer.rb (https://github.com/sensu/sensu-community-plugins/blob/master/handlers/notification/mailer.rb).
I use this command to test:
cat /tmp/test.txt |/opt/sensu/embedded/bin/ruby -d /etc/sensu/handlers/notification/mailer.rb
I got this error message:
Exception LoadError' at /opt/sensu/embedded/lib/ruby/2.0.0/rubygems.rb:1087 - cannot load such file -- rubygems/defaults/operating_system Exception
LoadError’ at /opt/sensu/embedded/lib/ruby/2.0.0/rubygems.rb:1096 - cannot load such file – rubygems/defaults/ruby
Exception LoadError' at /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53 - cannot load such file -- sensu-handler Exception
NoMethodError’ at /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/specification.rb:1896 - undefined method `to_ary’ for #Gem::Specification:0x00000000bdbf00
…
Exception NoMethodError' at /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/specification.rb:1896 - undefined method
to_ary’ for #Gem::Specification:0x00000000a85688
Using Ext extension for JSON.
Exception LoadError' at /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53 - cannot load such file -- mail Exception
NameError’ at /opt/sensu/embedded/lib/ruby/2.0.0/psych/core_ext.rb:16 - method to_yaml' not defined in Object Exception
NameError’ at /opt/sensu/embedded/lib/ruby/2.0.0/psych/core_ext.rb:29 - method yaml_as' not defined in Module Exception
NameError’ at /opt/sensu/embedded/lib/ruby/2.0.0/psych/deprecated.rb:80 - undefined method to_yaml_properties' for class
Object’
/etc/sensu/handlers/notification/mailer.rb:26: warning: method redefined; discarding old call
/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/exim.rb:44: warning: previous definition of call was here
/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mixlib-cli-1.5.0/lib/mixlib/cli.rb:50: warning: instance variable @separate_default_options not initialized
Exception NoMethodError' at /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/message.rb:1408 - undefined method
main_type’ for nil:NilClass
Exception NoMethodError' at /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/message.rb:1408 - undefined method
main_type’ for nil:NilClass
Exception Errno::EAGAIN' at /opt/sensu/embedded/lib/ruby/2.0.0/net/protocol.rb:153 - Resource temporarily unavailable - read would block Exception
Errno::EAGAIN’ at /opt/sensu/embedded/lib/ruby/2.0.0/net/protocol.rb:153 - Resource temporarily unavailable - read would block
Exception Errno::EAGAIN' at /opt/sensu/embedded/lib/ruby/2.0.0/net/protocol.rb:153 - Resource temporarily unavailable - read would block Exception
Net::SMTPServerBusy’ at /opt/sensu/embedded/lib/ruby/2.0.0/net/smtp.rb:950 - 454 4.7.0 TLS not available due to local problem
Exception `Net::SMTPServerBusy’ at /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/message.rb:2144 - 454 4.7.0 TLS not available due to local problem
/opt/sensu/embedded/lib/ruby/2.0.0/net/smtp.rb:950:in check_response': 454 4.7.0 TLS not available due to local problem (Net::SMTPServerBusy) from /opt/sensu/embedded/lib/ruby/2.0.0/net/smtp.rb:919:in
getok’
from /opt/sensu/embedded/lib/ruby/2.0.0/net/smtp.rb:819:in starttls' from /opt/sensu/embedded/lib/ruby/2.0.0/net/smtp.rb:561:in
do_start’
from /opt/sensu/embedded/lib/ruby/2.0.0/net/smtp.rb:519:in start' from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112:in
deliver!’
from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/message.rb:2141:in do_delivery' from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/message.rb:238:in
deliver’
from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/mail.rb:140:in deliver' from /etc/sensu/handlers/notification/mailer.rb:138:in
block in handle’
from /opt/sensu/embedded/lib/ruby/2.0.0/timeout.rb:66:in timeout' from /opt/sensu/embedded/lib/ruby/2.0.0/timeout.rb:97:in
timeout’
from /etc/sensu/handlers/notification/mailer.rb:137:in handle' from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:55:in
block in class:Handler’
I have double checked the /etc/default/sensu file and it contains
EMBEDDED_RUBY=true
LOG_DIR=/var/log/sensu
LOG_LEVEL=info
SERVICE_MAX_WAIT=10
My questions are:
-
How can I fix 454 4.7.0 TLS not available due to local problem (Net::SMTPServerBusy)?
-
Is it a proper way to test a handler? Do I still need to set a GEM_PATH?
Thanks, Tony