Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing agentid #1218

Closed
tom20180101 opened this issue Jan 30, 2018 · 3 comments
Closed

missing agentid #1218

tom20180101 opened this issue Jan 30, 2018 · 3 comments

Comments

@tom20180101
Copy link

tom20180101 commented Jan 30, 2018

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: '[email protected]'
      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

@stuartnelson3
Copy link
Contributor

@berlinsaint

@stuartnelson3
Copy link
Contributor

Feel free to open a PR

@songjiayang
Copy link
Contributor

songjiayang commented Feb 7, 2018

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants