sensu email handler - not receiving mail for alert

Hi,

I have configured email handler, and when apache service fail at that time it will call this handler for mail, however i am not receiving any mail and getting below errors of sensu-plugin is deprecated.

need suggestion…

i have refered “https://www.udemy.com/sensu-introduction” to configure email handler.

···

{

“handlers”: {

“mailer”: {

“type”: “pipe”,

“command”: “/opt/sensu/embedded/bin/handler-mailer.rb”,

“admin_gui”: “http://localhost:3000/”,

“mail_from”: “sensu@localhost”,

“mail_to”: “root@localhost”,

“smtp_address”: “localhost”,

“smtp_port”: “25”,

“smtp_domain”: “localhost”

}

}

}


{“timestamp”:“2017-02-20T06:10:52.642192-0500”,“level”:“info”,“message”:“processing event”,“event”:{“client”:{“name”:“UbuntuADSK”,“address”:“127.0.0.1”,“environment”:“development”,“subscriptions”:[“ubuntu”,“client:UbuntuADSK”],“version”:“0.27.0”,“timestamp”:1487589043},“check”:{“command”:“metrics-apache-graphite.rb”,“interval”:10,“subscribers”:[“ubuntu”],“handlers”:[“mailer”],“name”:“apache_check”,“issued”:1487589052,“executed”:1487589052,“duration”:0.183,“output”:“Check failed to run: Failed to open TCP connection to localhost:80 (Connection refused - connect(2) for “localhost” port 80), [”/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:882:in rescue in block in connect'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:879:inblock in connect’", “/opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:91:in block in timeout'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:101:intimeout’”, “/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:878:in connect'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:863:indo_start’”, “/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:852:in start'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1398:inrequest’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-apache-0.0.5/bin/metrics-apache-graphite.rb:88:in acquire_mod_status'\", \"/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-apache-0.0.5/bin/metrics-apache-graphite.rb:100:inrun’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.4/lib/sensu-plugin/cli.rb:58:in `block in class:CLI’”]\n",“status”:2,“type”:“standard”,“history”:[“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“2”],“total_state_change”:6},“occurrences”:1,“occurrences_watermark”:1,“action”:“create”,“timestamp”:1487589052,“id”:“9a702cb1-7c2f-4b73-a3dc-8dcca93ddb6c”,“last_ok”:1487589052,“last_state_change”:1487589052,“silenced”:false,“silenced_by”:}}

{“timestamp”:“2017-02-20T06:10:53.126399-0500”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“command”:"/opt/sensu/embedded/bin/handler-mailer.rb",“admin_gui”:“http://localhost:3000/",“mail_from”:“sensu@localhost”,“mail_to”:“root@localhost”,“smtp_address”:“localhost”,“smtp_port”:“25”,“smtp_domain”:“localhost”,“name”:“mailer”},“output”:["/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-1.0.0/bin/handler-mailer.rb:141:in build_body': undefined method’ for nil:NilClass (NoMethodError)\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-1.0.0/bin/handler-mailer.rb:169:in handle'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.4/lib/sensu-handler.rb:81:inblock in class:Handler’\nwarning: event filtering in sensu-plugin is deprecated, see http://bit.ly/sensu-plugin\nwarning: occurrence filtering in sensu-plugin is deprecated, see http://bit.ly/sensu-plugin\n”]}

{“timestamp”:“2017-02-20T06:11:02.455840-0500”,“level”:“info”,“message”:“publishing check request”,“payload”:{“command”:“metrics-apache-graphite.rb”,“handlers”:[“mailer”],“name”:“apache_check”,“issued”:1487589062},“subscribers”:[“ubuntu”]}

Hi Vipul,

See comments inline.

Hi,

I have configured email handler, and when apache service fail at that time it will call this handler for mail, however i am not receiving any mail and getting below errors of sensu-plugin is deprecated.

need suggestion..

i have refered "https://www.udemy.com/sensu-introduction" to configure email handler.

------------------------------------------------
{
  "handlers": {
    "mailer": {
      "type": "pipe",
      "command": "/opt/sensu/embedded/bin/handler-mailer.rb",
      "admin_gui": "http://localhost:3000/",
      "mail_from": "sensu@localhost",
      "mail_to": "root@localhost",
      "smtp_address": "localhost",
      "smtp_port": "25",
      "smtp_domain": "localhost"
      }
  }
}

You seem to have added the mailer configs inside the "handlers” section. In
my setup, my configs are as below:

shanker@mon1:~$ cat /etc/sensu/conf.d/mailer.json
{
  "mailer": {
    "type": "pipe",
    "command": "handler-mailer.rb",
    "admin_gui": "https://XXX/",
    "mail_from": “alerts@XXXX",
    "mail_to": [
      “alerts@XXX" ],
    "subscriptions": {
      “group:XXXX_oncall": {
        "mail_to": “sde@XXX"
      },
      "admins": {
        "mail_to": “shanker.balan@XXXX"
      }
    },
    "smtp_address": "localhost",
    "smtp_port": "25",
    "smtp_domain": “XXX"
  }
}

And then the handler as below:

shanker@mon1:~$ cat /etc/sensu/conf.d/handlers.json
{
  "handlers": {
    "default": {
      "type": "set",
      "handlers": [
        "logstash",
        "debug"
      ]
    },
    "mailer": {
      "type": "pipe",
      "command": "handler-mailer.rb",
      "filters": [
        "filter_warn_hourly"
      ],
      "severities": [
        "ok",
        "warning",
        "critical",
        "unknown"
      ]
    },
    "sms": {
      "type": "pipe",
      "command": "handler-sms.rb",
      "severities": [
        "critical"
      ]
    },
    "logstash": {
      "type": "pipe",
      "command": "handler-logstash.rb",
      "severities": [
        "ok",
        "warning",
        "unknown",
        "critical"
      ]
    }
  }
}

···

On 20-Feb-2017, at 4:57 PM, Vipul Vadoliya <vipulvadoliya@gmail.com> wrote:


Regards.
@shankerbalan

i have tried that, but no luck, getting below error.

there might be issue with plugin.

i have also tired “enable_deprecated_filtering”: “false” in check.

{“timestamp”:“2017-02-21T01:08:32.626327-0500”,“level”:“info”,“message”:“processing event”,“event”:{“client”:{“name”:“UbuntuADSK”,“address”:“127.0.0.1”,“environment”:“development”,“subscriptions”:[“ubuntu”,“client:UbuntuADSK”],“version”:“0.27.0”,“timestamp”:1487657308},“check”:{“command”:“metrics-apache-graphite.rb”,“enable_deprecated_filtering”:“false”,“interval”:10,“subscribers”:[“ubuntu”],“handlers”:[“mailer”],“name”:“apache_check”,“issued”:1487657312,“executed”:1487657312,“duration”:0.187,“output”:“Check failed to run: Failed to open TCP connection to localhost:80 (Connection refused - connect(2) for “localhost” port 80), [”/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:882:in rescue in block in connect'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:879:inblock in connect’", “/opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:91:in block in timeout'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:101:intimeout’”, “/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:878:in connect'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:863:indo_start’”, “/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:852:in start'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1398:inrequest’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-apache-0.0.5/bin/metrics-apache-graphite.rb:88:in acquire_mod_status'\", \"/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-apache-0.0.5/bin/metrics-apache-graphite.rb:100:inrun’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.4/lib/sensu-plugin/cli.rb:58:in `block in class:CLI’”]\n",“status”:2,“type”:“standard”,“history”:[“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“0”,“0”,“0”,“0”,“0”,“2”],“total_state_change”:11},“occurrences”:1,“occurrences_watermark”:1,“action”:“create”,“timestamp”:1487657312,“id”:“47f9c4c5-995a-442a-8576-fe333c2f5d74”,“last_ok”:1487657312,“last_state_change”:1487657312,“silenced”:false,“silenced_by”:}}

{“timestamp”:“2017-02-21T01:08:33.081969-0500”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“command”:"/opt/sensu/embedded/bin/handler-mailer.rb",“severities”:[“ok”,“warning”,“critical”,“unknown”],“admin_gui”:“http://localhost:3000/",“mail_from”:“sensu@localhost”,“mail_to”:“root@localhost”,“smtp_address”:“localhost”,“smtp_port”:“25”,“smtp_domain”:“localhost”,“name”:“mailer”},“output”:["/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-1.0.0/bin/handler-mailer.rb:141:in build_body': undefined method’ for nil:NilClass (NoMethodError)\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-1.0.0/bin/handler-mailer.rb:169:in handle'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.4/lib/sensu-handler.rb:81:inblock in class:Handler’\n”]}

Comments inline.

···

On 21-Feb-2017, at 11:53 AM, Vipul Vadoliya vipulvadoliya@gmail.com wrote:

i have tried that, but no luck, getting below error.

there might be issue with plugin.

i have also tired “enable_deprecated_filtering”: “false” in check.

{“timestamp”:“2017-02-21T01:08:32.626327-0500”,“level”:“info”,“message”:“processing event”,“event”:{“client”:{“name”:“UbuntuADSK”,“address”:“127.0.0.1”,“environment”:“development”,“subscriptions”:[“ubuntu”,“client:UbuntuADSK”],“version”:“0.27.0”,“timestamp”:1487657308},“check”:{“command”:“metrics-apache-graphite.rb”,“enable_deprecated_filtering”:“false”,“interval”:10,“subscribers”:[“ubuntu”],“handlers”:[“mailer”],“name”:“apache_check”,“issued”:1487657312,“executed”:1487657312,“duration”:0.187,“output”:“Check failed to run: Failed to open TCP connection to localhost:80 (Connection refused - connect(2) for "localhost" port 80), ["/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:882:in `rescue in block in connect’", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:879:in `block in connect’", "/opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout’", "/opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:101:in `timeout’", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:878:in `connect’", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:863:in `do_start’", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:852:in `start’", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1398:in `request’", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-apache-0.0.5/bin/metrics-apache-graphite.rb:88:in `acquire_mod_status’", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-apache-0.0.5/bin/metrics-apache-graphite.rb:100:in `run’", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.4/lib/sensu-plugin/cli.rb:58:in `block in class:CLI’"]\n”,“status”:2,“type”:“standard”,“history”:[“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“0”,“0”,“0”,“0”,“0”,“2”],“total_state_change”:11},“occurrences”:1,“occurrences_watermark”:1,“action”:“create”,“timestamp”:1487657312,“id”:“47f9c4c5-995a-442a-8576-fe333c2f5d74”,“last_ok”:1487657312,“last_state_change”:1487657312,“silenced”:false,“silenced_by”:}}

{“timestamp”:“2017-02-21T01:08:33.081969-0500”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“command”:“/opt/sensu/embedded/bin/handler-mailer.rb”,“severities”:[“ok”,“warning”,“critical”,“unknown”],“admin_gui”:“http://localhost:3000/”,“mail_from”:“sensu@localhost”,“mail_to”:“root@localhost”,“smtp_address”:“localhost”,“smtp_port”:“25”,“smtp_domain”:“localhost”,“name”:“mailer”},“output”:[“/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-1.0.0/bin/handler-mailer.rb:141:in build_body': undefined method ’ for nil:NilClass (NoMethodError)\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-1.0.0/bin/handler-mailer.rb:169:in handle'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.4/lib/sensu-handler.rb:81:in block in class:Handler’\n”]}

I have uploaded my exact configs and steps for testing here:

https://shankerbalan.net/blog/sensu-and-mailer-alert-handler/

Give it a go.

Regards.

@shankerbalan

Thanks Shanker,

i have did the same thing, configure the same as yours, but still getting that error.

{“timestamp”:“2017-02-21T06:37:52.691966-0500”,“level”:“info”,“message”:“processing event”,“event”:{“client”:{“name”:“UbuntuADSK”,“address”:“127.0.0.1”,“environment”:“development”,“subscriptions”:[“ubuntu”,“client:UbuntuADSK”],“version”:“0.27.0”,“timestamp”:1487677064},“check”:{“command”:“metrics-apache-graphite.rb”,“enable_deprecated_filtering”:“false”,“interval”:10,“subscribers”:[“ubuntu”],“handlers”:[“email-me”],“name”:“apache_check”,“issued”:1487677072,“executed”:1487677072,“duration”:0.213,“output”:“Check failed to run: Failed to open TCP connection to localhost:80 (Connection refused - connect(2) for “localhost” port 80), [”/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:882:in rescue in block in connect'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:879:inblock in connect’", “/opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:91:in block in timeout'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:101:intimeout’”, “/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:878:in connect'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:863:indo_start’”, “/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:852:in start'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1398:inrequest’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-apache-0.0.5/bin/metrics-apache-graphite.rb:88:in acquire_mod_status'\", \"/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-apache-0.0.5/bin/metrics-apache-graphite.rb:100:inrun’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.4/lib/sensu-plugin/cli.rb:58:in `block in class:CLI’”]\n",“status”:2,“type”:“standard”,“history”:[“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“2”],“total_state_change”:6},“occurrences”:1,“occurrences_watermark”:1,“action”:“create”,“timestamp”:1487677072,“id”:“ee3ecd9a-9f6f-4443-bc18-f825d324c7e4”,“last_ok”:1487677072,“last_state_change”:1487677072,“silenced”:false,“silenced_by”:}}

{“timestamp”:“2017-02-21T06:37:53.749373-0500”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“command”:“handler-mailer.rb -j mailer”,“name”:“email-me”},“output”:["/opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in initialize': getaddrinfo: Name or service not known (SocketError)\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:542:inopen’\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in tcp_socket'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:552:inblock in do_start’\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:91:in block in timeout'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:101:intimeout’\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:551:in do_start'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:521:instart’\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112:in deliver!'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/message.rb:2141:indo_delivery’\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/message.rb:238:in deliver'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/mail.rb:140:indeliver’\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-1.0.0/bin/handler-mailer.rb:227:in block in handle'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:91:inblock in timeout’\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:33:in block in catch'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:33:incatch’\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:33:in catch'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:106:intimeout’\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-1.0.0/bin/handler-mailer.rb:226:in handle'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.4/lib/sensu-handler.rb:81:inblock in class:Handler’\n"]}

Comments inline.

{"timestamp":"2017-02-21T06:37:52.691966-0500","level":"info","message":"processing event","event":{"client":{"name":"UbuntuADSK","address":"127.0.0.1","environment":"development","subscriptions":["ubuntu","client:UbuntuADSK"],"version":"0.27.0","timestamp":1487677064},"check":{"command":"metrics-apache-graphite.rb","enable_deprecated_filtering":"false","interval":10,"subscribers":["ubuntu"],"handlers":["email-me"],"name":"apache_check","issued":1487677072,"executed":1487677072,"duration":0.213,"output":"Check failed to run: Failed to open TCP connection to localhost:80 (Connection refused - connect(2) for \"localhost\" port 80), [\"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:882:in `rescue in block in connect'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:879:in `block in connect'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:101:in `timeout'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:878:in `connect'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:863:in `do_start'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:852:in `start'\", \"/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1398:in `request'\", \"/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-apache-0.0.5/bin/metrics-apache-graphite.rb:88:in `acquire_mod_status'\", \"/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-apache-0.0.5/bin/metrics-apache-graphite.rb:100:in `run'\", \"/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.4/lib/sensu-plugin/cli.rb:58:in `block in <class:CLI>'\"]\n","status":2,"type":"standard","history":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","2"],"total_state_change":6},"occurrences":1,"occurrences_watermark":1,"action":"create","timestamp":1487677072,"id":"ee3ecd9a-9f6f-4443-bc18-f825d324c7e4","last_ok":1487677072,"last_state_change":1487677072,"silenced":false,"silenced_by":}}

{"timestamp":"2017-02-21T06:37:53.749373-0500","level":"info","message":"handler output”,
"handler":{"type":"pipe","command":"handler-mailer.rb -j mailer","name":"email-me"},

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Looks like your config is *different* from mine.

"output":["/opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in `initialize': getaddrinfo: Name or service not known (SocketError)\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in `open'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in `tcp_socket'\n\tfrom

So you are getting a socket error here. What are your SMTP settings? Please manually check if the port is reachable
as from the logs, it looks like it cant reach it.

/opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:552:in `block in do_start'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:101:in `timeout'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:551:in `do_start'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/net/smtp.rb:521:in `start'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/message.rb:2141:in `do_delivery'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/message.rb:238:in `deliver'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/mail.rb:140:in `deliver'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-1.0.0/bin/handler-mailer.rb:227:in `block in handle'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:33:in `block in catch'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:33:in `catch'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:33:in `catch'\n\tfrom /opt/sensu/embedded/lib/ruby/2.3.0/timeout.rb:106:in `timeout'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-mailer-1.0.0/bin/handler-mailer.rb:226:in `handle'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.4/lib/sensu-handler.rb:81:in `block in <class:Handler>'\n”]}

I suggest you do the "cat event | jq .event | handler-sms.rb" step and share the output. At this time, it looks
like a timeout issue.

···

On 21-Feb-2017, at 5:26 PM, Vipul Vadoliya <vipulvadoliya@gmail.com> wrote:


@shankerbalan