I'm trying to start a Curl script from Administration - Scripts but it keeps giving me an error.
For now the script calls a simple Curl that reads a JSON file and receives a JSON response.
I can execute this script correctly from the command line.
In Zabbix, I use the following line to start the script:

When I try to start it from the trigger menu at the Dashboard, it gives me the error below.

I'm not sure, but the issue seems to be related to file permissions. I changed files ownership to Zabbix user but the error repeats itself.
This is a newly installed Zabbix 5.4.3.
Any help is apreciated.
Thanks.
For now the script calls a simple Curl that reads a JSON file and receives a JSON response.
Code:
IN_JSON="rde_post.json"
OUT_JSON="rde_return.json"
curl \
--netrc-file /usr/lib/zabbix/externalscripts/rde/teste/.netrc/ \
--request POST \
--header "Content-Type: application/json" \
--data "@${IN_JSON}" \
--output ${OUT_JSON} \
http://URI...
In Zabbix, I use the following line to start the script:
Code:
/usr/lib/zabbix/externalscripts/rde/test/curl_test.sh
When I try to start it from the trigger menu at the Dashboard, it gives me the error below.
Code:
Cannot execute script. Warning: Couldn't read data from file "rde_post.json", this makes an empty Warning: POST. % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file rde_return.json: Permission denied 100 111 100 111 0 0 12333 0 --:--:-- --:--:-- --:--:-- 12333 curl: (23) Failed writing body (0 != 111)
I'm not sure, but the issue seems to be related to file permissions. I changed files ownership to Zabbix user but the error repeats itself.
Code:
rwxr-xr-x 1 zabbix zabbix 369 Aug 24 11:40 curl_test.sh rw-r--r-- 1 zabbix zabbix 61 Aug 24 10:36 .netrc rw-r--r-- 1 zabbix zabbix 1.1K Aug 23 12:45 rde_post.json rw-r--r-- 1 zabbix zabbix 849 Aug 24 10:40 rde_return.json
This is a newly installed Zabbix 5.4.3.
Any help is apreciated.
Thanks.
Comment