emails not going out by sensu-only handling every 5 occurrences

#1

Hi All,

I am using sensu-plugins-mailer to send emails out and configured .But the mails are not going out .Below the error log from Sensu-Server :

[root@sesnu-server conf.d]# tail -f /var/log/sensu/sensu-server.log | grep “handler output”

{“timestamp”:“2016-03-29T10:21:01.526454+0100”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“command”:"/opt/sensu/embedded/bin/handler-mailer.rb",“name”:“mailer”},“output”:[“only handling every 5 occurrences: internal._inf1.sensuclient.graphite/sensuclientgraphite\n”]}

{“timestamp”:“2016-03-29T10:21:03.490819+0100”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“command”:"/opt/sensu/embedded/bin/handler-mailer.rb",“name”:“mailer”},“output”:["/opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugins-mailer-0.2.0/bin/handler-mailer.rb:132:in build_body': undefined method’ for nil:NilClass (NoMethodError)\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugins-mailer-0.2.0/bin/handler-mailer.rb:160:in handle'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:55:inblock in class:Handler’\n"]}

{“timestamp”:“2016-03-29T10:21:05.473421+0100”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“command”:"/opt/sensu/embedded/bin/handler-mailer.rb",“name”:“mailer”},“output”:[“only handling every 5 occurrences: internal._inf1.sensuclient.graphite/sensuclientgraphite\n”]}

{“timestamp”:“2016-03-29T10:21:07.479930+0100”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“command”:"/opt/sensu/embedded/bin/handler-mailer.rb",“name”:“mailer”},“output”:["only handling every 5 occurrences: internal._inf1.sensuclient.

Please suggest where I am getting wrong.

Thanks in advance

#2

This looks to me as if you are missing a part of the required configuration. Does your configuration look similar to the sample configuration (copy-pasta from github)?

{
“mailer”: {
“admin_gui”: “http://admin.example.com:8080/”,
“mail_from”: "sensu@example.com",
“mail_to”: "monitor@example.com",
“smtp_address”: “smtp.example.org”,
“smtp_port”: “25”,
“smtp_domain”: “example.org
}
}

``

In case you require more assistance, posting a redacted version of your settings might be helpful.

···

On Tuesday, March 29, 2016 at 11:43:58 AM UTC+2, kumar kittu wrote:

{“timestamp”:“2016-03-29T10:21:03.490819+0100”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“command”:"/opt/sensu/embedded/bin/handler-mailer.rb",“name”:“mailer”},“output”:["/opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugins-mailer-0.2.0/bin/handler-mailer.rb:132:in build_body': undefined method’ for nil:NilClass (NoMethodError)\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugins-mailer-0.2.0/bin/handler-mailer.rb:160:in handle'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:55:inblock in class:Handler’\n"]}

#3

Thanks Alexander !!

mismatch in mailer.json created that issue and corrected.But after adding smtp_username,smtp_password in mailer.json ,then only able to send mail.

Please confirm if is it right way or not ,as credentials can be seen in json file.

I am using external smtp of SES(AWS)

Thanks in advance

···

On Wednesday, March 30, 2016 at 3:12:29 PM UTC+5:30, Alexander Skiba wrote:

On Tuesday, March 29, 2016 at 11:43:58 AM UTC+2, kumar kittu wrote:

{“timestamp”:“2016-03-29T10:21:03.490819+0100”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“command”:"/opt/sensu/embedded/bin/handler-mailer.rb",“name”:“mailer”},“output”:["/opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugins-mailer-0.2.0/bin/handler-mailer.rb:132:in build_body': undefined method’ for nil:NilClass (NoMethodError)\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugins-mailer-0.2.0/bin/handler-mailer.rb:160:in handle'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:55:inblock in class:Handler’\n"]}

This looks to me as if you are missing a part of the required configuration. Does your configuration look similar to the sample configuration (copy-pasta from github)?

{
“mailer”: {
“admin_gui”: “http://admin.example.com:8080/”,
“mail_from”: "se...@example.com",
“mail_to”: "mon...@example.com",
“smtp_address”: “smtp.example.org”,
“smtp_port”: “25”,
“smtp_domain”: “example.org
}
}

``

In case you require more assistance, posting a redacted version of your settings might be helpful.