0

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?

gsr
  • 169
  • 2
  • 19

1 Answers1

0

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

gsr
  • 169
  • 2
  • 19