GithubHelp home page GithubHelp logo

26cm / promalert-feishu-webhook Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ayunwsky/promalert-feishu-webhook

0.0 0.0 0.0 39 KB

基于Python3+flask编写的一个webhook,实现prometheus的alertmanager告警接入到飞书

Shell 6.00% Python 87.81% Dockerfile 6.19%

promalert-feishu-webhook's Introduction

promalert-feishu-webhook

python3.11 + flask 编写了一个对接飞书 API 实现告警的 webhook

飞书机器人概述

https://www.feishu.cn/hc/zh-CN/articles/244506653275#tabs0|lineguid-AHuiGI

飞书开发文档

https://open.feishu.cn/document/ukTMukTMukTM/uADOwUjLwgDM14CM4ATN

安全设置

签名校验

https://www.feishu.cn/hc/zh-CN/articles/244506653275

构建镜像

DATE=$(date +'%Y%m%d')
TIMESTAMP=$(date +%s)
docker build -t promalert-feishu-webhook:${DATE}-v${TIMESTAMP} .
cat docker-compose.yml | egrep [0-9]{8}\-v[0-9]{10} -o | xargs -i sed -i s#{}#${DATE}-v${TIMESTAMP}#g docker-compose.yml

启动服务

  1. 更改 docker-compose.yml 中的镜像
  2. 设置APP_FS_WEBHOOK环境变量为你自己的飞书的webhook地址
  3. 设置APP_FS_SECRET环境变量为你自己的飞书群机器人的签名校验秘钥
  4. 设置APP_FS_ALERT_TYPE环境变量以选择机器人消息类型。有两个选项: post(富文本)、interactive(消息卡片)
  5. 启动服务
docker-compose up -d

promalert-feishu-webhook's People

Contributors

26cm avatar ayunwsky avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.