我正在尝试配置 alertmanager 以向我的电报组发送警报。按照我的配置:
global:
resolve_timeout: 5m
route:
group_by:
- job
group_interval: 5m
group_wait: 30s
receiver: "telegram"
repeat_interval: 1d
routes:
- match:
alertname: Watchdog
receiver: "null"
receivers:
- name: "null"
- name: 'telegram'
telegram_configs:
- bot_token: '5_REDACTED'
chat_id: '-1234567'
templates:
- /etc/alertmanager/config/*.tmpl
问题是容器 crashloopback ts=2022-05-01T22:06:11.142Z caller=coordinator.go:118 level=error component=configuration msg="Loading configuration file failed" file=/etc/alertmanager/config/alertmanager.yaml err="yaml: unmarshal errors:\n line 26: could not unmarshal !!str {{ -123...
into int64"
我该如何解决这个问题?我尝试添加单引号和双引号,但仍然出现相同的错误
答案1
chat_id: -1234567
- 没有引号,连字符不是问题
,并添加
parse_mode: 'HTML'
解析 markdown 是默认使用的,但在当前版本 (0.24) 中,许多用户都看到了这个问题