promethuds监控平台短信报警提示webhook

TwoKe945 2d6fda8dea chore: 添加文档 1 ano atrás
src 2d6fda8dea chore: 添加文档 1 ano atrás
.gitignore 10efe4790f feat: 自定义Prometheus短信报警提醒webhook 1 ano atrás
README.md 2d6fda8dea chore: 添加文档 1 ano atrás
api.yaml 2d6fda8dea chore: 添加文档 1 ano atrás
pom.xml 10efe4790f feat: 自定义Prometheus短信报警提醒webhook 1 ano atrás

README.md

Prometheus Sms Alert webhook

简介

基于SpringBoot的Prometheus短信报警提醒webhook,接入AlertManager的报警系统。

短信提醒发送接口

/sms/webhook/send

短信提醒版本

/sms/webhook/version

短信提醒测试联通

/sms/webhook/test-send/{service}

service是短信测试服务的名称,如cqxfSms、testSms

短信提醒配置

server:
  port: 8060

prometheus-alert:
  # cqxfSms testSms
  # 重庆消防短信提醒服务 cqxfSms
  # 测试短信服务,不会发送短信,会打印短信内容日志 testSms
  active-sms-service: cqxfSms
  managers:
#    - [管理者手机号码]
    - 185xxxxxxxx
    - 150xxxxxxxx
  cqxfSms:
    # 短信发送地址
    url:  http://xxxx.xxx/job/sendMsg

自定义短信服务

实现MessageService接口,实现其中的发送短信接口

@Component("customSms")
@Slf4j
public class CustomMessageService implements MessageService {
    
    public void send(String to, String content) {
        // TODO implements send(String to, String content)
    }

    public send(String[] tos, String content) {
        // TODO implements send(String[] tos, String content)
    }

}

实现接口之后,启动项目时配置启用CustomMessageService

prometheus-alert:
  active-sms-service: customSms # 启用的自定义短信测试服务