Small app to hook pingdom app monitoring to slack. The goal is to add the error message when one of your site is down.
The environment variables used are:
| Environment variable | Description | Type | Default |
|---|---|---|---|
SLACK_WEBHOOK | Slack webhook. | Required | |
PINGDOM_TOKEN | Pingdom token for v3.1 API | Required | |
TITLE_EMOJI_DOWN | Emoji to use in the title, when the notification is by DOWN | Optional | :warning: |
TITLE_EMOJI_UP | Emoji to use in the title, when the notification is by UP | Optional | :ok: |
sudo docker run -d -e SLACK_WEBHOOK=https://***** -e PINGDOM_TOKEN=***** -p 5000:5000 rcovarru/pingdom2slack virtualenv -p python3.8 venv source venv/bin/activate pip install -r requirements.txt export SLACK_WEBHOOK=https://***** export PINGDOM_TOKEN=***** export FLASK_APP=pingdom2slack.py flask run --host=0.0.0.0 gunicorn --bind=0.0.0.0:5000 pingdom2slack:app You can run the app with a specific env variables FLASK_DEBUG=1 to enable debug logging.
pip install pip-tools pip-compile --output-file requirements.txt requirements.in docker build -t pingdom2slack:local . docker run -e SLACK_WEBHOOK=https://***** -e PINGDOM_TOKEN=***** -p 5000:5000 pingdom2slack:local Pingdom webhooks are available in official documentation.
And local testing example is:
curl -v -H "Content-Type: application/json" -d @payload/http.json localhost:5000/test_channel