I have the following script:-
#!/bin/bash
echo "{"
echo "\"data\":["
grep -hoR server_name.* /etc/nginx/sites-enabled/|sed 's/[^ ]* //'|sed 's/.$//'|awk -F"/" '{ print "{\"{#URL}\":\""$1"\"}," }'| head -c -2
echo "]"
echo "}"
This is set up as a UserParameter on the client
UserParameter=url.discovery[*],/etc/zabbix/scripts/urls.sh
and gives results such as
{
"data":[
{"{#URL}":"example.com"}]
}
I then have a discovery rule configured in zabbix like so:-
Key is url.discovery[*]
Item prototype is web.page.regexp[{#URL},,,test,,]
However,I get the following error
Value should be a JSON object error
I've checked the JSON result on https://jsonlint.com/ and it says its valid.
How can I resolve this?
Thanks Stuart