Coder Social home page Coder Social logo

zhaobingchun / prometheusalert Goto Github PK

View Code? Open in Web Editor NEW

This project forked from feiyu563/prometheusalert

0.0 2.0 0.0 619.56 MB

Prometheus Alert是开源的运维告警中心消息转发系统,支持主流的监控系统Prometheus,Zabbix,日志系统Graylog和数据可视化系统Grafana发出的预警消息,支持钉钉,微信,华为云短信,腾讯云短信,腾讯云电话,阿里云短信,阿里云电话等

Home Page: https://feiyu563.github.io

License: MIT License

Shell 0.03% JavaScript 90.43% Go 2.89% CSS 4.73% Makefile 0.03% HTML 1.83% Batchfile 0.01% Dockerfile 0.03% Mustache 0.03%

prometheusalert's Introduction

PrometheusAlert全家桶

author license last commit issues stars forks docker

GitHub Release

Travis Travis Travis


PrometheusAlert是开源的运维告警中心消息转发系统,支持主流的监控系统Prometheus、Zabbix,日志系统Graylog2,Graylog3、数据可视化系统Grafana、SonarQube。阿里云-云监控,以及所有支持WebHook接口的系统发出的预警消息,支持将收到的这些消息发送到钉钉,微信,email,飞书,腾讯短信,腾讯电话,阿里云短信,阿里云电话,华为短信,百度云短信,容联云电话,七陌短信,七陌语音,TeleGram,百度Hi(如流)等。

it


  • 如果这个项目能为您带来帮助,我将感到非常荣幸!同时非常欢迎您加入PrometheusAlert全家桶的微信群一起探讨关于PrometheusAlert新一期的开发计划。

  • PrometheusAlert的成长离不开所有爱好运维和开发的朋友们的支持!如果您也对这个项目感兴趣,请点击一下 Star 以示鼓励,谢谢



构建

应用信息和构建相关的命令都写入了Makefile,请确保安装make, git, go命令。如有特定需要,请自行修改Makefile。

# 默认
make

# 只运行构建
make build

# 运行 go fmt
make format

# 运行 go vet
make vet

# 运行 go test
make test

# 构建镜像
make docker

# 推送镜像
make docker-push

# 运行镜像测试
make docker-test


# 运行
copy conf/app-example.conf conf/app.conf
./PrometheusAlert
# 测试应用健康
curl http://localhost:8080/health


启动

#打开PrometheusAlert releases页面,根据需要选择需要的版本下载到本地解压并进入解压后的目录
如linux版本(https://github.com/feiyu563/PrometheusAlert/releases/download/v4.7/linux.zip)

# wget https://github.com/feiyu563/PrometheusAlert/releases/download/v4.7/linux.zip && unzip linux.zip &&cd linux/

#运行PrometheusAlert
# ./PrometheusAlert (#后台运行请执行 nohup ./PrometheusAlert &)

#启动后可使用浏览器打开以下地址查看:http://127.0.0.1:8080
#默认登录帐号和密码在app.conf中有配置

Docker 启动

配置文件 app.conf 的内容可以使用环境变量的方式初始化。

所设置的变量前缀必须以 PA_ 开始,后面使用配置文件的配置项名称,但是需要将配置项中所有的 - 替换为 _

特别注意的是使用环境变量对配置项中的大小写并不敏感。

示例

docker run -d \
-e PA_LOGIN_USER=prometheusalert \
-e PA_LOGIN_PASSWORD=prometheusalert \
-e PA_TITLE=PrometheusAlert \
-e PA_OPEN_FEISHU=1 \
feiyu563/prometheus-alert

所有的配置文件内容请点击此处查看




dashboard dashboard-test


PrometheusAlert具备如下特性

  • 支持任意包含WebHook接口系统的消息作为消息来源,常见的如Prometheus,Zabbix,Graylog2,Graylog3,Grafana,SonarQube和其他WebHook接口的系统。
  • 支持多种类型的发送目标,支持钉钉,企业微信,email,飞书,腾讯短信,腾讯语音,阿里云短信,阿里云语音,华为短信,百度云短信,容联云电话,七陌短信,七陌语音,TeleGram,百度Hi(如流)。
  • 针对Prometheus增加了告警级别,并且支持按照不同级别发送消息到不同目标对象。
  • 简化Prometheus分组配置,支持按照具体消息发送到单个或多个接收方。
  • 增加手机号码配置项和号码自动轮询配置,可固定发送给单一个人告警信息,也可以通过自动轮询的方式发送到多个人员且支持按照不同日期发送到不同人员。
  • 增加Dashboard,提供配置测试,告警消息模版自定义,告警模版测试等功能
  • 增加自定义告警消息模版支持,可以通过自定义模版对任意服务WebHook进行支持
  • 增加代理支持
  • 增加支持mysql、sqlite3(默认)、postgres作为模版存储,便于集群化部署
  • 增加支持钉钉,企业微信的@某人功能
  • 增加支持阿里云-云监控告警
  • 增加随机轮询,目前仅针对ddurl,fsurl,wxurl有效,默认情况下如果上述Url配置的是多个地址,则多个地址全部发送,如开启该选项,则从多个地址中随机取一个地址发送,主要是为了避免消息发送频率过高导致触发部分机器人拦截消息
  • 增加支持将Prometheus告警记录写入到Elasticsearch7.x,可通过Kibana进行界面查看告警记录和配置表格导出。
  • 增加支持将Gitlab webhook event推送到企微和钉钉。
  • 增加告警路由和告警记录功能,可通过页面查看告警历史和操作告警消息路由。

致谢以下伙伴对PrometheusAlert的贡献


PrometheusAlert全家桶新手入门

系统接入PrometheusAlert流程

PrometheusAlert的原理就是通过自定义模版接口/prometheusalert接收各种告警系统或者任何带有WebHook功能的系统发来的消息,然后将收到的消息经过自定义模板渲染成消息文本,最终转发给不同的接收目标。

一般情况下如果使用的是钉钉,企业微信、飞书等机器人作为接收目标的,可以不去配置PrometheusAlert的配置文件app.conf;但是如果需要使用如短信,电话,邮箱等功能,则需要先配置好app.conf中的相关配置项方可使用。

目录


项目源码



加入PrometheusAlert微信交流群


me


Email: [email protected]


prometheusalert's People

Contributors

feiyu563 avatar zhang21 avatar ysicing avatar lusson-luo avatar jadexia avatar zhangsean avatar minibear2333 avatar 0x0034 avatar zhuzhengyang avatar bigdimple avatar birkh8792 avatar cfxks1989 avatar guvmao avatar haodongz avatar cyancow avatar

Watchers

James Cloos avatar  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.