#sns #telegram-bot #slack #notifications #notification-service #uptime #async

app zuse

由异步Rust驱动,支持Telegram、SNS和Slack通知后端的灵活高性能在线状态监控机器人

16个版本

0.5.0 2022年5月7日
0.4.11 2021年2月19日
0.4.1 2020年5月8日
0.3.6 2020年4月16日
0.1.1 2020年4月8日

#2 in #sns

44 个月下载量

MIT 许可证

62KB
1.5K SLoC

zuse

由异步Rust驱动,支持Telegram、SNS和Slack通知后端的灵活高性能在线状态监控机器人。

$ cargo install zuse
$ zuse -c tests.yml

示例配置(tests.yml)

notifiers:
  - type: telegram
    auth:
      token: xxxx
    channels:
      - name: tg_chan
        # channel or group or user
        id: -1000000000000
  - type: sns
    auth:
      key: AKIXXXXXXXXXXXXXXXXX
      secret: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      region: us-east-1
    channels:
      - name: sns_pavel
        phone: +491701234567
        # or
        target_arn: arn:aws:sns:us-east-1:XXXXXXXXXXXX:XXXXXXXX
        # or
        topic_arn: arn:aws:sns:us-east-1:XXXXXXXXXXXX:XXXXXXXX
  - type: slack
    auth:
      hook_url: https://hooks.slack.com/services/XXXXX/XXXX/XXXXXXXX
    channels:
      - name: slack_alrt
        channel: '#alrt'
        username: 'zuse'
        icon_emoji: ':warning:'

# optional, a group of notify targets
notify_groups:
  - name: infra_team
    notify:
      - sns_pavel
      - tg_chan

# optional, can also be on each test
defaults:
  retries: 3
  recovery: 3
  interval: 10
  timeout: 30

tests:
  - type: http_ok
    name: site-com-alive-cdn
    target: https://site.com/endpoint
    notify:
      - sns_pavel
      - tg_chan
      - slack_alrt
    # or
    notify_groups:
      - infra_team
  - type: tcp_ok
    name: server-smoke-test
    target: 127.0.0.1:3000
    notify_groups:
      - infra_team
  - type: http_match
    name: server-smoke-test
    target: 127.0.0.1:3000
    expect:
      status: 200
      text: 'Google'
    notify_groups:
      - infra_team

备注

cargo 需要 Rust 安装。

许可证

~~ MIT 许可证 ~~

版权所有 (c) 2020 Kenan Sulayman

以下对本软件和相关文档(以下简称“软件”)的副本获取者,免费授予在此软件上不受限制的权利,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或销售软件副本的权利,并允许提供软件副本的个人在此条件下进行上述行为

上述版权声明和本许可声明应包含在所有软件副本或实质性部分中。

软件按“现状”提供,不提供任何明示或暗示的保证,包括但不限于适销性、特定用途适用性和非侵权性保证。在任何情况下,作者或版权所有者不对任何索赔、损害或其他责任承担责任,无论该责任是因合同、侵权或其他方式引起的,无论是由于软件或其使用或与其他软件一起使用引起的。

依赖项

~18–36MB
~575K SLoC