Skip to content

missing agentid #1218

Closed
Closed

Description

@tom20180101

System information:

Linux ha-1 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon Dec 4 23:52:40 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Alertmanager version:latest

Prometheus version:2.0
WeChat:latest
Alertmanager configuration file:

apiVersion: v1
kind: ConfigMap
metadata:
  name: alertmanager
  namespace: default
data:
  config.yml: |-
    global:
      smtp_smarthost: 'smtp.qq.com:25'
      smtp_from: '***********@qq.com'
      smtp_auth_username: '1027155512@qq.com'
      smtp_auth_password: '*************'
      wechat_api_secret: '********************************'
      wechat_api_corp_id: '**************************'
    templates:
      - '/etc/alert/default.tmpl'
    route:
      receiver: 'default-receiver'
      group_by: ['alertname', 'cluster', 'service']
      group_wait: 30s
      group_interval: 5m
      repeat_interval: 15m
    receivers:
    - name: 'email_alert'
      email_configs:
      - to: '***********@139.com'
    - name: 'default-receiver'
      email_configs:
      - to: '***********@139.com'
      wechat_configs:
      - agent_id: '1000002'
        to_user: '*******'
        to_party: '2'
        corp_id: '**********'

my alertmanager on k8s 1.8.1 . when i use wechat alarm, i can`t receive any message, then, I found the following error through the dashboard

level=debug ts=2018-01-30T09:20:46.481211313Z caller=impl.go:910 msg="response: {\"errcode\":41011,\"errmsg\":\"missing agentid, hint: [1517304046_5_3f158368fdce3d37301495e4190372f1], more info at https://open.work.weixin.qq.com/devtool/query?e=41011\"}" incident="{}:{alertname=\"node_memory_low\"}"

but if i change this place ,all every look likes ok

notify/impl.go

before

        default:
                msg = &weChatCreateMessage{
                        Text: weChatMessage{
                                Content: tmpl(n.conf.Message),
                        },
                        ToUser:  tmpl(n.conf.ToUser),
                        ToParty: tmpl(n.conf.ToParty),
                        Totag:   tmpl(n.conf.ToTag),
                        AgentID: tmpl(n.conf.AgentID),
                        Type:    "text",
                        Safe:    "0",

after

      default:
                msg = &weChatCreateMessage{
                        Text: weChatMessage{
                                Content: tmpl(n.conf.Message),
                        },
                        ToUser:  tmpl(n.conf.ToUser),
                        ToParty: n.conf.ToParty,
                        Totag:   tmpl(n.conf.ToTag),
                        AgentID: n.conf.AgentID,
                        Type:    "text",
                        Safe:    "0",

so i think it maybe a bug,please fix it,thanks

Activity

  1. stuartnelson3 commented on Jan 30, 2018

    @stuartnelson3
    Contributor
  2. stuartnelson3 commented on Feb 6, 2018

    @stuartnelson3
    Contributor

    Feel free to open a PR

  3. songjiayang commented on Feb 7, 2018

    @songjiayang
    Contributor

    cool, I want to have a check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions