Giter Club home page Giter Club logo

Comments (10)

X-Mars avatar X-Mars commented on September 12, 2024

from zabbix-alert-wechat.

xfengfeng avatar xfengfeng commented on September 12, 2024

手动调用是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.

X-Mars avatar X-Mars commented on September 12, 2024

from zabbix-alert-wechat.

X-Mars avatar X-Mars commented on September 12, 2024

兄弟 问题解决了吗

from zabbix-alert-wechat.

X-Mars avatar X-Mars commented on September 12, 2024

已修复,请更新代码

from zabbix-alert-wechat.

Alpha-liu avatar Alpha-liu commented on September 12, 2024

碰到了同样的问题,单独命令测试正常,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.

X-Mars avatar X-Mars commented on September 12, 2024

@Alpha-liu 收到 近期会更新 谢谢

from zabbix-alert-wechat.

qlintel avatar qlintel commented on September 12, 2024

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.

charnet1019 avatar charnet1019 commented on September 12, 2024

from zabbix-alert-wechat.

qlintel avatar qlintel commented on September 12, 2024

应该是权限的问题发自我的华为手机-------- 原始邮件 --------发件人: 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.