tianshiyeben / wgcloud

Linux运维监控工具,支持系统硬件信息,内存,cpu,温度,磁盘空间及IO,硬盘smart,系统负载,网络流量等监控,服务接口,大屏展示,拓扑图,进程监控,端口监控,docker监控,文件防篡改,日志监控,数据可视化,web ssh,堡垒机,指令下发批量执行,Linux面板(探针),SNMP,故障告警,计划任务,账号管理,资产管理
http://www.wgstart.com
Apache License 2.0
4.6k stars 836 forks source link

日志监控支持企业微信、钉钉报警吗? #51

Open nd230 opened 2 years ago

nd230 commented 2 years ago

日志监控支持企业微信、钉钉报警吗?是不是只有主机监控才支持报警。

tianshiyeben commented 2 years ago

日志监控也支持企业微信、钉钉报警

Good Luck

WGCLOUD

 

------------------ 原始邮件 ------------------ 发件人: "tianshiyeben/wgcloud" @.>; 发送时间: 2022年8月3日(星期三) 上午8:57 @.>; @.***>; 主题: [tianshiyeben/wgcloud] 日志监控支持企业微信、钉钉报警吗? (Issue #51)

日志监控支持企业微信、钉钉报警吗?是不是只有主机监控才支持报警。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

nd230 commented 2 years ago

你好,我用企业微信机器人用类似钉钉机器人的bat脚本写了个bat,调整了application.yml,业重启了服务端,日志更新后没有报警 @echo off echo warn content is : %1 set timeHour=%time:~0,2% set timeMin=%time:~3,2% set timeSec=%time:~6,2% set content="WARNING: %timeHour%:%timeMin%:%timeSec%, %1" set content=%content:"=% set weixin_url="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" curl -H "Content-Type: application/json" -d "{\"content\":\"%content%\"}" -s %weixin_url%

tianshiyeben commented 2 years ago

您手动执行这个bat能发送成功吗

Good Luck

WGCLOUD

 

------------------ 原始邮件 ------------------ 发件人: "tianshiyeben/wgcloud" @.>; 发送时间: 2022年8月3日(星期三) 上午9:44 @.>; @.**@.>; 主题: Re: [tianshiyeben/wgcloud] 日志监控支持企业微信、钉钉报警吗? (Issue #51)

你好,我用企业微信机器人用类似钉钉机器人的bat脚本写了个bat,调整了application.yml,业重启了服务端,日志更新后没有报警 @echo off echo warn content is : %1 set timeHour=%time:~0,2% set timeMin=%time:~3,2% set timeSec=%time:~6,2% set content="WARNING: %timeHour%:%timeMin%:%timeSec%, %1" set content=%content:"=% set weixin_url="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" curl -H "Content-Type: application/json" -d "{"content":"%content%"}" -s %weixin_url%

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

nd230 commented 2 years ago

手动执行可以发测试消息,不过部署到application.yml就没反应了

tianshiyeben commented 2 years ago

server日志文件里有什么错误信息吗

---原始邮件--- 发件人: @.> 发送时间: 2022年8月3日(周三) 上午10:10 收件人: @.>; 抄送: @.**@.>; 主题: Re: [tianshiyeben/wgcloud] 日志监控支持企业微信、钉钉报警吗? (Issue #51)

手动执行可以发测试消息,不过部署到application.yml就没反应了

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

nd230 commented 2 years ago

2022-08-03 10:26:17.474 [pool-1-thread-4] ERROR com.wgcloud.util.ExecUtil - ????????? java.io.IOException: Cannot run program "E:\Downloads\wgcloud-v3.3.9\server\weixinbot.bat": CreateProcess error=206, ?????????? at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at com.wgcloud.util.ExecUtil.runScript(ExecUtil.java:41) at com.wgcloud.util.msg.WarnMailUtil.sendUtil(WarnMailUtil.java:1008) at com.wgcloud.util.msg.WarnMailUtil.sendFileWarnDown(WarnMailUtil.java:935) at com.wgcloud.controller.AgentLogGoController.lambda$minTask$0(AgentLogGoController.java:109) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: CreateProcess error=206, ?????????? at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 11 common frames omitted

tianshiyeben commented 2 years ago

你看日志文件里,那几个????????是什么 日志文件里不是乱码

Good Luck

WGCLOUD

 

------------------ 原始邮件 ------------------ 发件人: "tianshiyeben/wgcloud" @.>; 发送时间: 2022年8月3日(星期三) 上午10:35 @.>; @.**@.>; 主题: Re: [tianshiyeben/wgcloud] 日志监控支持企业微信、钉钉报警吗? (Issue #51)

2022-08-03 10:26:17.474 [pool-1-thread-4] ERROR com.wgcloud.util.ExecUtil - ????????? java.io.IOException: Cannot run program "E:\Downloads\wgcloud-v3.3.9\server\weixinbot.bat": CreateProcess error=206, ?????????? at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at com.wgcloud.util.ExecUtil.runScript(ExecUtil.java:41) at com.wgcloud.util.msg.WarnMailUtil.sendUtil(WarnMailUtil.java:1008) at com.wgcloud.util.msg.WarnMailUtil.sendFileWarnDown(WarnMailUtil.java:935) at com.wgcloud.controller.AgentLogGoController.lambda$minTask$0(AgentLogGoController.java:109) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: CreateProcess error=206, ?????????? at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 11 common frames omitted

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

nd230 commented 2 years ago

好像就是?号 图片

tianshiyeben commented 2 years ago

你试试把weixinbot.bat放到e:/根目录下 你的windows是什么版本

Good Luck

WGCLOUD

 

------------------ 原始邮件 ------------------ 发件人: "tianshiyeben/wgcloud" @.>; 发送时间: 2022年8月3日(星期三) 上午10:42 @.>; @.**@.>; 主题: Re: [tianshiyeben/wgcloud] 日志监控支持企业微信、钉钉报警吗? (Issue #51)

好像就是?号

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

nd230 commented 2 years ago

如果监控周期内日志监控数据或日志条数太多了,是不是会报错,推不出来

nd230 commented 2 years ago

如果监控周期内日志监控数据或日志条数太多了,是不是会报错,推不出来

nd230 commented 2 years ago

版本是server 2016

nd230 commented 2 years ago

测试了下用curl发送长度有限制,同时微信机器人也有长度限制,超过了就报错了,建议日志可以按行拆分下,或者发送报警时控制下发送内容长度,超过了可以拆分成几个告警发送。

tianshiyeben commented 2 years ago

感谢反馈

Good Luck

WGCLOUD

 

------------------ 原始邮件 ------------------ 发件人: "tianshiyeben/wgcloud" @.>; 发送时间: 2022年8月5日(星期五) 下午2:26 @.>; @.**@.>; 主题: Re: [tianshiyeben/wgcloud] 日志监控支持企业微信、钉钉报警吗? (Issue #51)

测试了下用curl发送长度有限制,同时微信机器人也有长度限制,超过了就报错了,建议日志可以按行拆分下,或者发送报警时控制下发送内容长度,超过了可以拆分成几个告警发送。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

nd230 commented 2 years ago

curl超过1024字节可能就有问题,微信机器人直接限制5120字节 图片

tianshiyeben commented 2 years ago

你这个是shell脚本吗 你在shell中就可以处理下告警内容长度

Good Luck

WGCLOUD

 

------------------ 原始邮件 ------------------ 发件人: "tianshiyeben/wgcloud" @.>; 发送时间: 2022年8月5日(星期五) 下午2:36 @.>; @.**@.>; 主题: Re: [tianshiyeben/wgcloud] 日志监控支持企业微信、钉钉报警吗? (Issue #51)

curl超过1024字节可能就有问题,微信机器人直接限制5120字节

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

nd230 commented 2 years ago

bat脚本,我部署在win2016上。

tianshiyeben commented 1 year ago

是不是除了日志监控告警,其他的告警信息微信可以收到

---原始邮件--- 发件人: @.> 发送时间: 2022年8月3日(周三) 中午11:35 收件人: @.>; 抄送: @.**@.>; 主题: Re: [tianshiyeben/wgcloud] 日志监控支持企业微信、钉钉报警吗? (Issue #51)

如果监控周期内日志监控数据或日志条数太多了,是不是会报错,推不出来

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

nd230 commented 1 year ago

频率不高的可以


---- 回复的原邮件 ----
发件人
日期 2022年10月11日 16:31
收件人
抄送至
主题 Re: [tianshiyeben/wgcloud] 日志监控支持企业微信、钉钉报警吗? (Issue #51)

是不是除了日志监控告警,其他的告警信息微信可以收到



---原始邮件---
发件人: ***@***.***>
发送时间: 2022年8月3日(周三) 中午11:35
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [tianshiyeben/wgcloud] 日志监控支持企业微信、钉钉报警吗? (Issue #51)





如果监控周期内日志监控数据或日志条数太多了,是不是会报错,推不出来


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: <tianshiyeben/wgcloud/issues/51/1274305721@github.com>