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

**URL:** <https://discourse.sensu.io/t/emails-not-going-out-by-sensu-only-handling-every-5-occurrences/567>\
**Category:** Sensu Classic (EOL)\
**Created:** [March 29, 2016, 9:43am UTC](https://discourse.sensu.io/t/emails-not-going-out-by-sensu-only-handling-every-5-occurrences/567 "2016-03-29T09:43:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hari\_krishna\_kumar](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@Hari\_krishna\_kumar](https://discourse.sensu.io/u/Hari_krishna_kumar)\
**Post date:** [March 29, 2016, 9:43am UTC](https://discourse.sensu.io/t/emails-not-going-out-by-sensu-only-handling-every-5-occurrences/567/1 "2016-03-29T09:43:58Z")

</div>

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:in`block 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

---

<div class="post-metadata">

**Author:** ![Alexander\_Skiba](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/alexander_skiba/32/408_2.png) [@Alexander\_Skiba](https://discourse.sensu.io/u/Alexander_Skiba)\
**Post date:** [March 30, 2016, 9:42am UTC](https://discourse.sensu.io/t/emails-not-going-out-by-sensu-only-handling-every-5-occurrences/567/2 "2016-03-30T09:42:29Z")

</div>

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/](http://admin.example.com:8080/)”,  
“mail\_from”: “[sensu@example.com](mailto:sensu@example.com)”,  
“mail\_to”: “[monitor@example.com](mailto:monitor@example.com)”,  
“smtp\_address”: “[smtp.example.org](http://smtp.example.org)”,  
“smtp\_port”: “25”,  
“smtp\_domain”: “[example.org](http://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:in `block in class:Handler’\n”]}

---

<div class="post-metadata">

**Author:** ![Hari\_krishna\_kumar](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@Hari\_krishna\_kumar](https://discourse.sensu.io/u/Hari_krishna_kumar)\
**Post date:** [March 30, 2016, 11:06am UTC](https://discourse.sensu.io/t/emails-not-going-out-by-sensu-only-handling-every-5-occurrences/567/3 "2016-03-30T11:06:05Z")

</div>

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:in `block 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/](http://admin.example.com:8080/)”,  
> > “mail\_from”: “[se...@example.com](mailto:se...@example.com)”,  
> > “mail\_to”: “[mon...@example.com](mailto:mon...@example.com)”,  
> > “smtp\_address”: “[smtp.example.org](http://smtp.example.org)”,  
> > “smtp\_port”: “25”,  
> > “smtp\_domain”: “[example.org](http://example.org)”  
> > }  
> > }
> 
> > ``
> 
> > 
> 
> > In case you require more assistance, posting a **redacted** version of your settings might be helpful.
