Hi!
I was use this script, which build JSON with all certificate file:
#!/bin/bash
JSON="{ "data":["
for CERTS_DIR in /home/ubuntu/ops-vpn-keys;do
certs=`ls $CERTS_DIR/keys | grep crt`
if [[ -n ${certs} ]]; then
for CRT in ${certs}; do
JSON=${JSON}"{ "{#CERTIFICATE}":"${CERTS_DIR}/keys/${CRT}"},"
done
fi
done
JSON=${JSON}"]}"
echo ${JSON} | sed '$s/,]}$/]}/'
Unforthunatley Zabbix don't undestand JSON which generated by this script and msg me: "zabbix value should be a json object"
Any suggestion?
I was use this script, which build JSON with all certificate file:
#!/bin/bash
JSON="{ "data":["
for CERTS_DIR in /home/ubuntu/ops-vpn-keys;do
certs=`ls $CERTS_DIR/keys | grep crt`
if [[ -n ${certs} ]]; then
for CRT in ${certs}; do
JSON=${JSON}"{ "{#CERTIFICATE}":"${CERTS_DIR}/keys/${CRT}"},"
done
fi
done
JSON=${JSON}"]}"
echo ${JSON} | sed '$s/,]}$/]}/'
Unforthunatley Zabbix don't undestand JSON which generated by this script and msg me: "zabbix value should be a json object"
Any suggestion?
Comment