Sign inSign up

rcovarru/pingdom2slack

By rcovarru

•Updated almost 7 years ago

Hook pingdom app monitoring to slack, adding error message when one of your site is down.

Image
0

2.1K

rcovarru/pingdom2slack repository overview

⁠pingdom2slack

Small app to hook pingdom app monitoring to slack. The goal is to add the error message when one of your site is down.

⁠Usage

The environment variables used are:

Environment variableDescriptionTypeDefault
SLACK_WEBHOOKSlack webhook.Required
PINGDOM_TOKENPingdom token for v3.1 APIRequired
TITLE_EMOJI_DOWNEmoji to use in the title, when the notification is by DOWNOptional:warning:
TITLE_EMOJI_UPEmoji to use in the title, when the notification is by UPOptional:ok:
⁠With Docker
sudo docker run -d -e SLACK_WEBHOOK=https://***** -e PINGDOM_TOKEN=***** -p 5000:5000 rcovarru/pingdom2slack
⁠Standalone app
virtualenv -p python3.8 venv
source venv/bin/activate
pip install -r requirements.txt
export SLACK_WEBHOOK=https://*****
export PINGDOM_TOKEN=*****
⁠Development server
export FLASK_APP=pingdom2slack.py
flask run --host=0.0.0.0
⁠Production server
gunicorn --bind=0.0.0.0:5000 pingdom2slack:app

⁠Debug

You can run the app with a specific env variables FLASK_DEBUG=1 to enable debug logging.

⁠Compile requirements

pip install pip-tools
pip-compile --output-file requirements.txt requirements.in

⁠Build & Run

docker build -t pingdom2slack:local .

docker run -e SLACK_WEBHOOK=https://***** -e PINGDOM_TOKEN=***** -p 5000:5000 pingdom2slack:local

⁠Basic testing

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

Tag summary

Content type

Image

Digest

Size

41 MB

Last updated

almost 7 years ago

docker pull rcovarru/pingdom2slack