-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: allow notifying multiple Slack channels #41
Conversation
BREAKING CHANGE: vars.slack_notifications_channel has been renamed to vars.slack_notifications_channels and accepts a list instead of a string. Sending notifications to multiple channels is done by calling the webhook multiple times. Slack does not allow notifying multiple channels with a single webhook call as far as I know.
Hi there, thanks for contributing... I'm really not sure about introducing a breaking change. Maybe we keep both? |
Hi Nune, thanks for the feedback. This is a change I had to make for the company I work for. We have an internal ticket open regarding various improvements to our monitoring setup. Syncing our fork of icinga2-slack-notifications and upstreaming this pull request is one of them. It could take some time before we get around to this. We'll try to accommodate your wish to remain backwards-compatible, and also make some documentation changes that I forgot in my initial commit. You can just leave this PR open for now. Regarding the issue you linked to: I will realistically only work on that if my company experiences the same problem and considers it something to prioritise, otherwise I just can't make time available. Sorry. |
Thanks, I understand... Cheers, |
Hi, @imre-uncinc can you please provide some docs for your improvement? But your code did only expand a list for slack channels using the same webhook right?
This would be nice if we can work with slack like working with builtin "check_disk" command to keep the same syntax. Thanks a lot! :) |
Hi @Darkentik, it is unlikely that I will complete this MR, it didn't have any priority over the last year and I'm leaving the company next month. Maybe one of my coworkers will pick it up, maybe not. Regarding your question: our use case was to support sending notifications to multiple Slack channels using the same webhook. I have not tested this with multiple webhooks and probably never will. Feel free to expand on my MR to build in support for multiple Slack webhooks! |
Hey, not so good to hear that you leave the focus. I wish you a good time with the new job. :) So for all others i think, that no one need any change at this plugin. The var host.vars.slack_notifications == "enabled" is declared via linux host template in our setup.
I have tested at weekend with my testserver to have 2 slack notifications each with different custom var for the webhook_url and the notifications now come to 2 slack channels each with a unique webhook. Here is the setup:
My custom slack notification apply rule with assign where:
|
BREAKING CHANGE: vars.slack_notifications_channel has been renamed to vars.slack_notifications_channels and accepts a list instead of a string.
Sending notifications to multiple channels is done by calling the webhook multiple times. Slack does not allow notifying multiple channels with a single webhook call as far as I know.