【问题标题】:Prometheus alertmanager.yml file gives unmarshal errorPrometheus alertmanager.yml 文件给出解组错误
【发布时间】:2021-08-18 08:01:26
【问题描述】:
msg="Loading configuration file failed" 
file=alertmanager.yml 
err="yaml: unmarshal errors:\n  line 3: cannot unmarshal !!str 
`basic_auth` into config.plain\n  line 4: field username not found in 
type config.plain\n  line 5: field password not found in type 
config.plain\n  line 20: cannot unmarshal !!map into 
[]*config.WebhookConfig"

下面是yml文件,怎么解决?

global: 
  http_config: basic_auth
  username: 1234
  password: 1234
inhibit_rules: 
  - 
    equal: 
      - alertname
      - dev
      - instance
    source_match: 
      severity: critical
    target_match: 
      severity: warning
receivers: 
  - 
    name: web.hook
    webhook_configs: 
      http_config: global.http_config
      url: "http://localhost:8080"
route: 
  group_by: 
    - alertname
  group_interval: 5m
  group_wait: 30s
  receiver: web.hook
  repeat_interval: 1h

【问题讨论】:

    标签: unmarshalling prometheus-alertmanager


    【解决方案1】:

    试试这个:

    global: 
      http_config:
        basic_auth:
          username: 1234
          password: 1234
    

    【讨论】:

      猜你喜欢
      • 2021-11-03
      • 1970-01-01
      • 1970-01-01
      • 2011-09-15
      • 1970-01-01
      • 2012-01-22
      • 1970-01-01
      • 2012-05-19
      • 1970-01-01
      相关资源
      最近更新 更多