alertmanager 无法加载配置文件

alertmanger cannot load configuration file

我在启动 Alertmanager 时收到以下错误消息:

/alertmanager/config.yml err="yaml: unmarshal errors:\n  line 48: cannot unmarshal !!map into []*config.WebhookConfig"

与工作配置文件的唯一区别是在文件末尾添加以下内容:

- name: 'zisalert'
    webhook_configs:
      send_resolved: true
      url: 'https://zisalert:9000/alert'

我正在使用 Alertmanager 0.15.2。

知道是什么原因造成的吗?

您似乎遇到了 yaml 缩进问题。一个正常工作的网络钩子接收块看起来像这样

- name: 'zisalert'
  webhook_configs:
  - send_resolved: true
    url: 'https://zisalert:9000/alert'