diff --git a/mdmcertcheck/mdmcertcheck.sh b/mdmcertcheck/mdmcertcheck.sh index 595eaed..4d17713 100644 --- a/mdmcertcheck/mdmcertcheck.sh +++ b/mdmcertcheck/mdmcertcheck.sh @@ -4,7 +4,7 @@ export LC_ALL="" export LANG="en_US.UTF-8" -version="0.0" +VERSION="0.1" CERTLIST="certlist.cfg" @@ -16,10 +16,13 @@ ITEM="$2" case "$METRIC" in discovery) #records from the config file - RECS=`cat ` + RECS=`cat $CERTLIST | awk -F: '/^[^#]/ { print $1 }' | grep -e "^cert=.*" | cut -f 2 -d "="` JSON="{ \"data\":[" # append data + for REC_I in ${RECS}; do + JSON=${JSON}" {\"{#CERT}\":\"${REC_I}\"}," + done # delete last simbol and add the end JSON=${JSON::-1} @@ -28,7 +31,7 @@ discovery) exit 0 ;; -script.verstion) +script.version) echo $VERSION ;;