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: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”: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:in
block 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”]}