AcalephStorage / consul-alerts

A simple daemon to send notifications based on Consul health checks
GNU General Public License v2.0
825 stars 191 forks source link

Specifying different notifiers for different nodes #83

Open mar-io opened 9 years ago

mar-io commented 9 years ago

Thought it would be useful to have the ability to disable/enable certain notifications for particular nodes and not others.

For example, lets say you have a production and dev environment. I might still want emails from nodes in dev environments but not pagerduty alerts. However I do want both email notifier and pager duty notifier for prod alerts. Being able to wildcard the nodes by name to use for a certain notifier would be a plus.

darkcrux commented 8 years ago

Could be a useful feature, though requires a big change with the current state of the code.

fusiondog commented 8 years ago

I've implemented code that does this. I have not added a wildcard by node name, instead opting to group nodes by service or check name. This keeps the code smaller and more efficient while still providing a mechanism to group hosts into prod or dev profiles. This patch also breaks up custom notifiers so that they can be individually named and added to profiles.

https://github.com/AcalephStorage/consul-alerts/pull/89

fusiondog commented 8 years ago

Here is an example of a profile definition (the false is in for demonstration, you do not need to specify disabled notifiers, you can leave them in for documentation): { "Interval": 10, "NotifList": { "log":false, "email":true } }