@keyser Here are a couple of net-snmp extend scripts as examples. The first is multi line, and the second is single line. Which to use depends upon how you want to parse on the other end. To me, multi line is simpler, but some people strongly prefer single line. To each their own.
Assuming that you name the extend "dpinger", you will find the OID at
NET-SNMP-EXTEND-MIB::nsExtendOutputFull."dpinger"
(.1.3.6.1.4.1.8072.1.3.2.3.1.2.7.100.112.105.110.103.101.114)
Enjoy.
#!/bin/sh
for file in /var/run/dpinger*.sock
do
cat $file | awk '{print "name:"$1",latency:"$2",stddev:"$3",loss:"$4}'
done
#!/bin/sh
for file in /var/run/dpinger*.sock
do
if [ "${result}" ]
then
result="${result},"
fi
new=`cat $file | awk '{print "{name:"$1",latency:"$2",stddev:"$3",loss:"$4"}" }'`
result="${result}${new}"
done
echo "${result}"