apt-get install jq
For CentOS with EPEL repository out of the box:
yum install jq
Without EPEL repo:
curl -sL https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 -o /usr/bin/jq
chmod +x /usr/bin/jq
Look for zabbix_server.conf file:
conf=$(find / -name "zabbix_server.conf")
echo $conf
Check if ExternalScripts is enabled:
path=$(grep -v "^$\|^#" $conf | grep "^ExternalScripts" | sed "s/^.*=//")
echo $path
Go to external scripts path:
cd $path
Script:
At the Zabbix server side add template:
Test directly from command line (works on linux and windows):
curl -s "https://rest.db.ripe.net/search.json?query-string=46.109.42.228&flags=no-filtering&source=RIPE" | jq -r ".objects.object[2].attributes.attribute[1].value"
curl -s "https://rest.db.ripe.net/search.json?query-string=80.89.73.98&flags=no-filtering&source=RIPE" | jq -r ".objects.object[2].attributes.attribute[1].value"
Binaries for Windows:
Related:
https://stedolan.github.io/jq/download/