简体   繁体   中英

How to sms with prometheus/alertmanager

I have two problems that I can't solve because I don't know if I'm missing something or not..

Here is my promising configuration, and I would therefore like to receive alerts via sms or via pushover, but it does not work.

global:
  resolve_timeout: 5m

route:
  group_by: ['critical']
  group_wait: 30s
  group_interval: 180s
  repeat_interval: 300s
  receiver: myIT

receivers:
  - name: 'myIT'
    email_configs:
      - to: me@myfirm
        from: me@myfirm
        smarthost:  ssl0.ovh.net:587
        auth_username: 'me@myfirm'
        auth_identity: 'me@myfirm'
        auth_password: 'ZZZZZZZZZZZZZZZZZ'
  - name: Teams
    webhook_configs:
    - url: 'https://teams.microsoft.com/l/channel/19%3xxxxxxxxyyyyuxxxab%40thread.tacv2/Alertes?groupId=xxxxxxxxyyyyuxxx0&t                                                                                enantId=3caa0abd-0122-496f-a6cf-73cb6d3aaadd'
      send_resolved: true
  - name: Sms
    webhook_configs:
    - url: 'https://www.ovh.com/cgi-bin/sms/http2sms.cgi?&account=sms-XXXXXXX-1&login=XXXXX&password=XXXXXXX&from=XXXXXX&to=0123456789&message=Alert                                                                                '
      send_resolved: true
  - name: pushover
    pushover_configs:
    - user_key: xxxxxxxxyyyyuxxx
      token: xxxxxxxxyyyyuxxx

For the pushover part, it works via my grafana (and still not all the time). For the http2sms, it works all the time via a browser.

But for both it doesn't work under alertmanager. AND I would like to be able to differentiate the alerts. The simple warnign in teams or by email for example, and criticize them by sms. Did I forget to install something?

Does anyone have a configuration that could look like this need? Thank you

Well. I found.

route:
  group_by: ['critical']
  group_wait: 30s
  group_interval: 180s
  repeat_interval: 300s
  receiver: myIT

receivers:
  - name: 'myIT'
    email_configs:
      - to: me@myfirm
        from: me@myfirm
        smarthost:  ssl0.ovh.net:587
        auth_username: 'me@myfirm'
        auth_identity: 'me@myfirm'
        auth_password: 'ZZZZZZZZZZZZZZZZZ'
    webhook_configs:
    - url: 'https://teams.microsoft.com/l/channel/19%3xxxxxxxxyyyyuxxxab%40thread.tacv2/Alertes?groupId=xxxxxxxxyyyyuxxx0&t                                                                                enantId=3caa0abd-0122-496f-a6cf-73cb6d3aaadd'
      send_resolved: true
    pushover_configs:
    - user_key: xxxxxxxxyyyyuxxx
      token: xxxxxxxxyyyyuxxx

It works fine like that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM