Zabbix Discovery discoverions of Server拒绝

发布于 2025-02-08 19:48:34 字数 668 浏览 1 评论 0原文

我正在使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁吢 2025-02-15 19:48:34

通过添加内部脚本“ sudo script.py”并将zabbix添加到sudoers来解决它

Solved it by adding the inner script "sudo script.py" and adding zabbix to sudoers

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文