yanjunhui / chat Goto Github PK
View Code? Open in Web Editor NEW微信企业号发送监控 for OpenFalcon
License: The Unlicense
微信企业号发送监控 for OpenFalcon
License: The Unlicense
能增加 get method么
按官网操作,运行./control.sh start,出现如标题所示的错误
在虚拟机上测试,中间电脑休眠了一段时间后再打开,发现发送微信企业消息返回:“发送消息失败: access_token expired, hint: [1549248037_1_ea3ed0d606a24db653d533bc931d2588]”,请问可以实现token失效后自动续期的功能?
r := regexp.MustCompile((\[(.*?)\])
)
您好,我们7月份按照您文档的介绍克隆了代码,运行了3个月后,突然出现了index out of range的错误。
{"time":"2019-10-12T10:25:08.140025494+08:00","level":"-","prefix":"-","file":"main.go","line":"212","message":"微信 Token 更新成功: DAjr-pZNvNb281TQTMc7gbIWdmML_UViTwgo0ii1HVLiasZuKl6KKbQOp70XIB93v0T_4m1NSlKhXiKQMsX-TlTLkXwob2GG7S-4R13DAYn0Iv57BRDj5VMmYnKQ2hmwiPFHPhV20lbu8rPhwmK0RrHXuYj2EsDIVQw6Nv2AvByYXZFFojObLhLvcQKZLV-heK5GEM1_R1w0ihCh6uB5-A,有效时间: 7200"}
echo: http: panic serving 10.58.165.137:28625: runtime error: index out of range
goroutine 2335 [running]:
net/http.(*conn).serve.func1(0xc42039bcc0)
/usr/local/go/src/net/http/server.go:1721 +0xd0
panic(0x6fc820, 0x8d0180)
/usr/local/go/src/runtime/panic.go:489 +0x2cf
main.SendMsg(0x8b3fc0, 0xc42005e150, 0xc4201b3b68, 0x4c3a62)
/Users/yanjunhui/go/src/github.com/yanjunhui/chat/main.go:78 +0x76c
github.com/labstack/echo.(*Echo).add.func1(0x8b3fc0, 0xc42005e150, 0x8da920, 0x4)
/Users/yanjunhui/go/src/github.com/labstack/echo/echo.go:467 +0x90
github.com/labstack/echo/middleware.LoggerWithConfig.func2.1(0x8b3fc0, 0xc42005e150, 0x0, 0x0)
/Users/yanjunhui/go/src/github.com/labstack/echo/middleware/logger.go:111 +0x12b
github.com/labstack/echo.(*Echo).ServeHTTP.func1(0x8b3fc0, 0xc42005e150, 0xc42011c398, 0x756a80)
/Users/yanjunhui/go/src/github.com/labstack/echo/echo.go:558 +0x10e
github.com/labstack/echo.(*Echo).ServeHTTP(0xc42011c340, 0x8ad800, 0xc4203cc460, 0xc420298000)
/Users/yanjunhui/go/src/github.com/labstack/echo/echo.go:567 +0x24c
net/http.serverHandler.ServeHTTP(0xc4200a8580, 0x8ad800, 0xc4203cc460, 0xc420298000)
/usr/local/go/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc42039bcc0, 0x8add00, 0xc420320280)
/usr/local/go/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2668 +0x2ce
{"time":"2019-10-12T11:24:57.347413235+08:00","level":"-","prefix":"-","file":"main.go","line":"116","message":"发送信息给JiaoHongYun, 信息内容: 仓网还未配置特殊供应商信息当前环境: [dev]\r\n, 微信返
回结果: {"errcode":0,"errmsg":"ok","invaliduser":""}"}
跟Issue #8 相比,我们并没有修改任何源代码,但是我们没有开启回调模式获取key。
您能帮我们看一下原因吗?是不是使用您的网关必须要开启回调模式获取key ?
谢谢!
日志:
{"time":"2017-11-15T17:41:30.755375937+08:00","level":"ERROR","prefix":"echo","file":"echo.go","line":"283","message":"code=404, message=Not Found"}
{"time":"2017-11-15T17:41:30.755447609+08:00","id":"","remote_ip":"127.0.0.1","host":"127.0.0.1:4567","method":"GET","uri":"/auth/?msg_signature=4219a3a430010ed0ab4b1b863d20d7608b312ca2×tamp=1510738890&nonce=824695764&echostr=Cw1WzELKeUI7IxjeJ5EkrBVBlKX0fXkMRzD45KsEGbntixvliJgJ3RjxZ%2BeIXL4MQnyCSGImhiG%2B0radX51h8A%3D%3D","status":404, "latency":156425,"latency_human":"156.425µs","bytes_in":0,"bytes_out":23}
测试配置文件 config.conf里面,只有port参数,如何指定监听ip地址呢?
企业微信消息接受设置那一步可以不配置么?
{"time":"2017-05-19T15:42:21.050895418+08:00","level":"ERROR","prefix":"echo","file":"echo.go","line":"260","message":"code=405, message=Method Not Allowed"}
echo: http: panic serving 127.0.0.1:36538: runtime error: index out of range
goroutine 157 [running]:
net/http.(*conn).serve.func1(0xc420180640)
/usr/lib/golang/src/net/http/server.go:1721 +0xd0
panic(0x7023e0, 0x8da480)
/usr/lib/golang/src/runtime/panic.go:489 +0x2cf
main.SendMsg(0x8be260, 0xc420176150, 0xc420034b58, 0x4c5212)
/home/work/open-falcon/chat/main.go:101 +0xdec
github.com/labstack/echo.(*Echo).Add.func1(0x8be260, 0xc420176150, 0x8e4c20, 0x7fec42475000)
/usr/lib/golang/src/github.com/labstack/echo/echo.go:479 +0x90
github.com/labstack/echo/middleware.LoggerWithConfig.func2.1(0x8be260, 0xc420176150, 0x0, 0x0)
/usr/lib/golang/src/github.com/labstack/echo/middleware/logger.go:116 +0x12b
github.com/labstack/echo.(*Echo).ServeHTTP.func1(0x8be260, 0xc420176150, 0xc42007b238, 0x75cea0)
/usr/lib/golang/src/github.com/labstack/echo/echo.go:576 +0x10e
github.com/labstack/echo.(*Echo).ServeHTTP(0xc42007b1e0, 0x8b7960, 0xc4201aa540, 0xc42015e100)
/usr/lib/golang/src/github.com/labstack/echo/echo.go:585 +0x2a9
net/http.serverHandler.ServeHTTP(0xc4200a4420, 0x8b7960, 0xc4201aa540, 0xc42015e100)
/usr/lib/golang/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc420180640, 0x8b7fa0, 0xc420326240)
/usr/lib/golang/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
/usr/lib/golang/src/net/http/server.go:2668 +0x2ce
上面是报错,请问这是什么原因呢?
https://work.weixin.qq.com/api/doc#90000/90135/91039
注意事项:
开发者需要缓存access_token,用于后续接口的调用(注意:不能频繁调用gettoken接口,否则会受到频率拦截)。当access_token失效或过期时,需要重新获取。
access_token的有效期通过返回的expires_in来传达,正常情况下为7200秒(2小时),有效期内重复获取返回相同结果,过期后获取会返回新的access_token。
由于企业微信每个应用的access_token是彼此独立的,所以进行缓存时需要区分应用来进行存储。
access_token至少保留512字节的存储空间。
企业微信可能会出于运营需要,提前使access_token失效,开发者应实现access_token失效时重新获取的逻辑。
https://github.com/open-falcon/falcon-plus/blob/master/modules/alarm/cfg.example.json#L25
falcon-plus版本中,把sender功能合并到alarm里面了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.