sensu-plugins / sensu-plugins-mailer

This plugin is an email handler for Sensu.
http://sensu-plugins.io
MIT License
17 stars 37 forks source link

Building mailing list from client subscriptions #18

Closed alexgervais closed 8 years ago

alexgervais commented 8 years ago

Send alerts on client subscriptions.

Given the two "webserver" clients:

{
  "client": {
    "name": "i-424242",
    "address": "8.8.8.8",
    "subscriptions": [
      "production",
      "webserver"
    ]
  }
}

{
  "client": {
    "name": "i-424242",
    "address": "8.8.8.8",
    "subscriptions": [
      "development",
      "webserver"
    ]
  }
}

And this webserver check:

{
  "checks": {
    "chef_client": {
      "command": "/etc/sensu/plugins/check-chef-client.rb",
      "subscribers": [
        "webserver"
      ],
      "interval": 60
    }
  }
}

I can register the following mailer configuration and dispatch the alerts to the appropriate mailing list.

{
  "mailer": {
    "mail_from": "sensu@example.com",
    "subscriptions": {
      "production": {
        "mail_to": "production-team@example.com"
      },
      "development": {
        "mail_to": "dev-team@example.com"
      }
    }
  }
}
eheydrick commented 8 years ago

Released in 0.3.0.