From d1761bbf9c987881da9c2728efec02adee5e22db Mon Sep 17 00:00:00 2001 From: Trick van Staveren Date: Thu, 28 Oct 2021 22:38:43 -0500 Subject: [PATCH] Add OpsGenie example Useful in particular for how to add HTTP headers. --- docs/report-http.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/docs/report-http.md b/docs/report-http.md index 1b6f77ca..46cddaf8 100644 --- a/docs/report-http.md +++ b/docs/report-http.md @@ -138,3 +138,45 @@ reports: ``` Thanks [arpanet-creeper](https://github.com/nttgin/BGPalerter/pull/412) for the help. + +## OpsGenie + +OpsGenie is an alert management tool by Atlassian. It's also a good example of how to use HTTP headers with reportHTTP. + +```yaml +reports: + - file: reportHTTP + channels: + - hijack + - newprefix + - visibility + - path + - misconfiguration + - rpki + params: + templates: + default: ' + { + "message": "BGPalerter ${channel} ${description}", + "description": "${summary}", + "details": + { + "prefix": "${prefix}", + "bgplay": "${bgplay}", + "earliest": "${earliest}", + "latest": "${latest}", + "channel": "${channel}", + "type": "${type}", + "asn": "${asn}", + "paths": "${paths}", + "peers": "${peers}" + } + }' + headers: + 'Content-Type': 'application/json' + 'Authorization': 'GenieKey 00000000-1111-2222-3333-444444444444' + isTemplateJSON: true + showPaths: 5 + hooks: + default: https://api.opsgenie.com/v2/alerts +```