Skip to content
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

Alertmanager fix 2 #9860

merged 3 commits into from Mar 2, 2019


None yet
3 participants
Copy link

commented Feb 22, 2019

This is once again a small fix for Alertmanager transport. We found ourselves in a situation where we need to pass two label/value pairs from LibreNMS to Alertmanager, so rewrote the Transport to offer multiple labels to be specified. This has also been documented.
Also due to latest release Alertmanager V1 HTTP API endpoint has been deprecated, so it had to be changed as well.


Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.


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.

@@ -46,6 +46,7 @@ The one and only possible parameter to be passed is `source` - this is required
| ------ | ------- |
| Alertmanager URL | |
| Alertmanager Options: | source=librenms |

This comment has been minimized.

Copy link

TheGreatDoc Feb 22, 2019


As you removed source in Alertmanager.php, do you still need to set it up?

This comment has been minimized.

Copy link

angryp Feb 22, 2019

Author Contributor

Depends on the setup a user has, really. Initially it appeared logical to me (!) that one would like to specify source as one of the labels. Then I stumbled upon a requirement to add two labels which would not be usable for majority of users (mine will be source and escalation number), so ended up offering user to specify whatever he wants. Code block at line 68 does it.
So in end, if it is "source" user wants - he can use "source". If it is something else - it can be something else.


This comment has been minimized.

Copy link
Contributor Author

commented Mar 1, 2019

Just FYI: we had launched this script in our production this week and it works successfully so far.


murrant approved these changes Mar 2, 2019

@murrant murrant merged commit 15aee15 into librenms:master Mar 2, 2019

6 checks passed

Inspection Summary
Node: analysis
Travis CI - Pull Request Build Passed
WIP Ready for review
codeclimate All good!
license/cla Contributor License Agreement is signed.

funzoneq added a commit to funzoneq/librenms that referenced this pull request Apr 30, 2019

Alertmanager fix 2 (librenms#9860)
* Improved Alertmanager transport

* Typo fix

* Fix according to Travis fail

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.