Skip to content

Add extra dynamic values alerttransport alertmanager#13828

Merged
laf merged 5 commits intolibrenms:masterfrom
geg347:add-extra-dynamic-values-alerttransport-alertmanager
Mar 14, 2022
Merged

Add extra dynamic values alerttransport alertmanager#13828
laf merged 5 commits intolibrenms:masterfrom
geg347:add-extra-dynamic-values-alerttransport-alertmanager

Conversation

@geg347
Copy link
Copy Markdown
Contributor

@geg347 geg347 commented Mar 4, 2022

Hello dear LibreNMS Community,

So here you are some changes to be able to add extra dynamic values to the Alert Transport for Alertmanager.
I just added a check in Alertmanager Options that allows to display any variables present in the Alert details (you can view these variables in the WebUI in Alert Notifications and details of a pending alert) if it exists.

You just have to name your Alertmanager Option to start with extra_ and then the name you want it to appears in Alertmanager. The value must be the correct variable name of the variable that you want to get.

For example for a port down you can do :
extra_int = ifName
in Alertmanager Option field in Alertmanaager Transport creation and in Alertmanager you will have :
extra_int = et-0/0/0 (or whatever)

Please tell me if there is something else to improve or to document.

Have a nice week-end!
geg347

DO NOT DELETE THE UNDERLYING TEXT

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
  • If my Pull Request makes discovery/polling/yaml changes, I have added/updated test data.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

@librenms-bot
Copy link
Copy Markdown

This pull request has been mentioned on LibreNMS Community. There might be relevant details there:

https://community.librenms.org/t/add-custom-dynamic-variable-to-alertmanager-transport/18292/2

@geg347
Copy link
Copy Markdown
Contributor Author

geg347 commented Mar 4, 2022

I don't know how to fix this MariaDB pipeline error...

@laf
Copy link
Copy Markdown
Member

laf commented Mar 6, 2022

Can you update the AlertManager transport docs to show an example of how people can use this please?

@laf laf added the User-Pending Currently waiting for user response label Mar 6, 2022
@geg347
Copy link
Copy Markdown
Contributor Author

geg347 commented Mar 7, 2022

Hello,
Sure, here you are the updated documentation.
Is there something else to do, please?

Copy link
Copy Markdown
Member

@laf laf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@laf laf removed the User-Pending Currently waiting for user response label Mar 14, 2022
@laf laf merged commit 9036fd5 into librenms:master Mar 14, 2022
@librenms-bot
Copy link
Copy Markdown

This pull request has been mentioned on LibreNMS Community. There might be relevant details there:

https://community.librenms.org/t/22-3-0-changelog/18403/1

jerji pushed a commit to Beanfield/librenms that referenced this pull request Apr 14, 2022
* Add extra dynamic values to Alert transport for Alertmanager

* Add description to explain how extra dynamic values for Alertmanager works in the WebUI

* Add _ in dynamic label name + fix continuous-itegration error

* Fix continuous-itegration error part 2

* Updating AlertManager docs with explanation of how dynamic variables works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants