Comments (10)
from zabbix-alert-wechat.
手动调用是OK的,微信上可以接收到消息。
[root@zabbix alertscripts]# python wechat.py 44 44 44 44
{u'access_token': u'oRDRbuoskoa0Z1stm7SNQhA0n7ieILobGEec2H4aBGO3aQATnSSjpmhY6ZaAt1s-Np2Skg3ExzP4J6v-hOj4qZgyY9kWeDiSV57x3U-cogptfmLe3p-b6RCZkifnomcNfRSVGWsy09b9EKnN0cI6IytRKf_gVo1oCPwMs9661T50CWbn8mveGwHhfa_jLGzi5FF9RIbJO1efGg', u'expires_in': 7200, u'errcode': 0, u'errmsg': u'ok'}
{u'invaliduser': u'44', u'errcode': 0, u'errmsg': u'ok'}
{u'invaliduser': u'44', u'errcode': 0, u'errmsg': u'ok'}
from zabbix-alert-wechat.
from zabbix-alert-wechat.
兄弟 问题解决了吗
from zabbix-alert-wechat.
已修复,请更新代码
from zabbix-alert-wechat.
碰到了同样的问题,单独命令测试正常,zabbix触发就报下面的错误。
File "/usr/lib/zabbix/alertscripts/wechat.py", line 73, in
Status = SendMessage(User,Agentid,Subject,Content)
File "/usr/lib/zabbix/alertscripts/wechat.py", line 53, in SendMessage
Token = GetTokenFromServer(Corpid, Secret)
File "/usr/lib/zabbix/alertscripts/wechat.py", line 24, in GetTokenFromServer
file = open('/tmp/zabbix_wechat_config.json', 'w')
IOError: [Errno 13] Permission denied: '/tmp/zabbix_wechat_config.json'
主要还是权限问题,先前只加了zabbix权限,后来加了apache的权限上面的报警就正常了。建议把这个放在FAQ里面,这样好找些。
chown zabbix.zabbix wechat.py
chown apache.apache wechat.py
from zabbix-alert-wechat.
@Alpha-liu 收到 近期会更新 谢谢
from zabbix-alert-wechat.
Traceback (most recent call last):
File "/usr/lib/zabbix/alertscripts/wechat.py", line 73, in
Status = SendMessage(User,Agentid,Subject,Content)
File "/usr/lib/zabbix/alertscripts/wechat.py", line 53, in SendMessage
Token = GetTokenFromServer(Corpid, Secret)
File "/usr/lib/zabbix/alertscripts/wechat.py", line 24, in GetTokenFromServer
file = open('/tmp/zabbix_wechat_config.json', 'w')
IOError: [Errno 13] Permission denied: '/tmp/zabbix_wechat_config.json'
按照以下操作增加权限后刚开始正常,但后面又会出现同样报错,麻烦看看什么问题?
chown zabbix.zabbix wechat.py
chown apache.apache wechat.py
centos7 和 zabbix5.0
from zabbix-alert-wechat.
from zabbix-alert-wechat.
应该是权限的问题发自我的华为手机-------- 原始邮件 --------发件人: Ling_Qin [email protected]日期: 2021年1月4日周一 11:03收件人: X-Mars/Zabbix-Alert-WeChat [email protected]抄送: Subscribed [email protected]主 题: Re: [X-Mars/Zabbix-Alert-WeChat] zabbix4.0 使用脚本报错 Permission denied: 'config.json' (#10) Traceback (most recent call last): File "/usr/lib/zabbix/alertscripts/wechat.py", line 73, in Status = SendMessage(User,Agentid,Subject,Content) File "/usr/lib/zabbix/alertscripts/wechat.py", line 53, in SendMessage Token = GetTokenFromServer(Corpid, Secret) File "/usr/lib/zabbix/alertscripts/wechat.py", line 24, in GetTokenFromServer file = open('/tmp/zabbix_wechat_config.json', 'w') IOError: [Errno 13] Permission denied: '/tmp/zabbix_wechat_config.json' 按照以下操作增加权限后刚开始正常,但后面又会出现同样报错,麻烦看看什么问题? chown zabbix.zabbix wechat.py chown apache.apache wechat.py centos7 和 zabbix5.0 —You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe
是的,已给/tmp/zabbix_wechat_config.json这个文件赋予apache权限,目前使用正常。谢谢~
from zabbix-alert-wechat.
Related Issues (15)
- 主题与信息不能用中文,能修正下吗?谢谢 HOT 4
- webhook HOT 2
- 告警中文乱码 HOT 1
- 钉钉告警可以增加图片相关的内容么? HOT 1
- Content要怎么才能实现换行呢? HOT 1
- python3.9.9企业微信脚本报错 HOT 2
- 微信Token调用,一天只能调用20次。如果发生频繁告警。 HOT 1
- 配置过程中遇到的一点小问题 HOT 1
- 微信出现重复报警,主要是zabbix的problem重复报警,邮件报警无此问题 HOT 3
- 请教个问题,Python脚本命令行执行ok,zabbix类似wechat调用失败 HOT 3
- 新版本执行报错 HOT 2
- 错误 HOT 5
- 建议加缓存 HOT 2
- python 就是这么塞雷的吗!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zabbix-alert-wechat.