Skip to content

[dingdingSign] 配置文件已开启钉钉加签,钉钉机器人地址解析加签参数 secret 为空,将使用不加签的地址! #363

@MagicStarTrace

Description

@MagicStarTrace

在alertmanager 配置了 告警分组[不同主机分组 @不同的联系人]
webhook_configs":
- url: "http://prometheus-alert:8080/prometheusalert?type=dd&tpl=prometheus-dd&ddurl=https://oapi.dingtalk.com/robot/send?access_token=acaafxxxx&secret=SEC04dxxxx&at=150xxxx"

prometheus-alert配置:
#---------------------↓webhook-----------------------
#是否开启钉钉告警通道,可同时开始多个通道0为关闭,1为开启
open-dingding=1
open-dingding-secret=1
#默认钉钉机器人地址
ddurl=https://oapi.dingtalk.com/robot/send?access_token=xxxxx

现在 prometheus-alert 控制台报错:

2023/12/25 10:11:17.590 [I] [prometheusalert.go:456]  [1703470277467171652] [dingding] {"errcode":310000,"errmsg":"description:机器人发送签名不匹配;solution:请确认签名和生成签名的时间戳必须都放在调用的网址中,请确认机器人的密钥加密和填写正确;link:请参考本接口对应文档获得具体要求,或者在https://open.dingtalk.com/document/  搜索相关文档;"}
2023/12/25 10:11:17.590 [D] [server.go:2936]  |     10.0.0.139| 200 | 123.289154ms|   match| POST     /prometheusalert   r:/prometheusalert
2023/12/25 10:16:17.468 [D] [value.go:586]  [1703470577468584110] {"receiver":"IT","status":"firing","alerts":[{"status":"firing","labels":{"alertgroup":"Node rules","alertname":"服务器内存利用率超过90%","app_name":"ks-alert","host":"192.168.110.236","instance":"192.168.110.236","severity":"critical"},"annotations":{"description":"Memory usage is more than 90%\n  VALUE = 85.8005143174\n  LABELS = map[host:192.168.110.236]","message":"服务器:192.168.110.236 内存使用率 \u003e 90% ,当前值:85.80% 。"},"startsAt":"2023-12-22T10:14:28.088890684Z","endsAt":"0001-01-01T00:00:00Z","generatorURL":"http://vmalert-vmalert-10-58c64b78cc-7ffg5:8080/vmalert/api/v1/alert?group_id=16095307156649292636\u0026alert_id=12075814400321301066","fingerprint":"bf5ff2faf81b564c"}],"groupLabels":{"instance":"192.168.110.236"},"commonLabels":{"alertgroup":"Node rules","alertname":"服务器内存利用率超过90%","app_name":"ks-alert","host":"192.168.110.236","instance":"192.168.110.236","severity":"critical"},"commonAnnotations":{"description":"Memory usage is more than 90%\n  VALUE = 85.8005143174\n  LABELS = map[host:192.168.110.236]","message":"服务器:192.168.110.236 内存使用率 \u003e 90% ,当前值:85.80% 。"},"externalURL":"http://vmalertmanager-alertmanager-0:9093","version":"4","groupKey":"{}/{instance=~\"^(?:192.168.*.*)$\"}:{instance=\"192.168.110.236\"}","truncatedAlerts":0}
2023/12/25 10:16:17.469 [I] [dingding.go:42]  [dingdingSign] 配置文件已开启钉钉加签,钉钉机器人地址解析加签参数 secret 为空,将使用不加签的地址!

不使用加签是可以正常发出的,现在报这个怎么办?谢谢~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions