Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/orsinium-labs/opsgenie-reminder

Send Slack reminders about Opsgenie alerts open for too long
https://github.com/orsinium-labs/opsgenie-reminder

atlassian bot cli cron cronjob go golang observability opsgenie reminder slack slack-bot

Last synced: 3 days ago
JSON representation

Send Slack reminders about Opsgenie alerts open for too long

Awesome Lists containing this project

README

        

# opsgenie-reminder

A CLI tool that fetches from Opsgenie alerts that are open for too long and sends Slack notifications.

## Installation

Pick one of the options below.

### Download binary

1. Download a binary release from [Github Releases](https://github.com/orsinium-labs/opsgenie-reminder/releases) page.
1. Place it somewhere in your `$PATH`: `mv opsgenie-reminder ~/.local/bin/`.

### Install using Go

Install the latest version using Go:

```bash
go install github.com/orsinium-labs/opsgenie-reminder@latest
opsgenie-reminder --help
```

### Build from source

```bash
git clone --depth 1 [email protected]:orsinium-labs/opsgenie-reminder.git
cd opsgenie-reminder
go build .
./opsgenie-reminder --help
```

### Build Docker image

```bash
git clone --depth 1 [email protected]:orsinium-labs/opsgenie-reminder.git
cd opsgenie-reminder
sudo docker build --tag opsgenie-reminder .
sudo docker run opsgenie-reminder
```

## Usage

```bash
opsgenie-reminder \
--opsgenie-token ${OPSGENIE_TOKEN} \
--opsgenie-api-url https://api.eu.opsgenie.com \
--opsgenie-url https://${MY_ORG_NAME}.app.eu.opsgenie.com/ \
--slack-token ${SLACK_TOKEN} \
--slack-channel opsgenie-reminders
```

Run `opsgenie-reminder --help` to see the full list of options.

The tool stores the state between runs in a local file (`.opsgenie-reminder-state.json` by default). Make sure to preserve this file between runs, or you can get notified about the same alert.

You can also create a `config.yaml` file in the current directory which may contain any of the CLI options and also mapping of opsgenie team IDs to SLack groups and channels. For example:

```yaml
teams:
183c81ae-8828-1904-41f0-61278c80bb25:
# use this group handle in the reminder message
group: team-backend
2fcf93e8-b32c-aede-42ea-7c53ef6b16e8:
group: team-processing
# send reminders to this slack channel
channel: processing-bugs
bd270922-b32c-cc87-42ea-7c53ef6b16e8:
channel: processing-bugs
bd270922-77c6-89e5-47a2-bcd6c3a50812:
# do not send reminders
ignore: true
```