Zabbix Discovery discoverions of Server拒绝
我正在使用zabbix 6.0.4,并创建了一个自定义的python脚本来返回此json:
{"data": [{"{#STATUS}": "UP", "{#NAME}": "server1"}, {"{#STATUS}": "UP", "{#NAME}": "server2"}, {"{#STATUS}": "UP", "{#NAME}": "server3"}]}]
UserParameter=server.discovery[*],/etc/zabbix/custom_scripts/get_status.py $1
现在, 当我在本地主机上运行代理商的命令要测试:
zabbix_agentd -t server.discovery
它没有错误,我可以看到JSON响应,但是当我从服务器运行测试时,我会收到错误,
zabbix_get -s 10.X.X.X -k server.discovery
错误该错误与我正在运行的脚本有关在get_status.py脚本中,我没有对其他脚本日志文件的权限,
我不明白脚本是否可以在主机上运行 + Zabbix代理可以在本地运行它,我缺少什么?
已经对自定义脚本授予了777权限,并且脚本本身也没有成功尝试允许原始。
有帮助吗?
Im using zabbix 6.0.4 And have created a custom python script that return this json:
{"data": [{"{#STATUS}": "UP", "{#NAME}": "server1"}, {"{#STATUS}": "UP", "{#NAME}": "server2"}, {"{#STATUS}": "UP", "{#NAME}": "server3"}]}]
UserParameter=server.discovery[*],/etc/zabbix/custom_scripts/get_status.py $1
Now,
When i run on the local host with the agent the command to test :
zabbix_agentd -t server.discovery
It gives me no error and i can see the json response, however when i run test from server i get an error
zabbix_get -s 10.X.X.X -k server.discovery
The error is related to a script I'm running inside the get_status.py script that i have no permission to the other script log file
I don't understand if a script runs OK on host + Zabbix agent can run it locally what am i missing?
Already gave 777 permission to the custom scripts and the script itself also tried AllowRoot with no success.
any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过添加内部脚本“ sudo script.py”并将zabbix添加到sudoers来解决它
Solved it by adding the inner script "sudo script.py" and adding zabbix to sudoers