Finally, I have used NET-SNMP-EXTEND-MIB and also I wrote a ping script which takes IP as its argument.
snmpset -v2c -c public -m +NET-SNMP-EXTEND-MIB localhost 'nsExtendStatus."remotePing"' = createAndGo 'nsExtendCommand."remotePing"' = /etc/snmp/scripts/pingScript.sh 'nsExtendArgs."remotePing"' = 'google.com'
Don't forget to place pingScript.sh file under /etc/snmp/scripts.
Here I entered google.com as default then from my program I change this literal with appropriate IP address at runtime.
By getting nsExtendOutput1Table.nsExtendOutputFull it is possible to read the ping time or whatever your scripts returns.