Very often we want to extend the net-snmp agent with our private data, net-snmp provides a very simple method to pass certain OID ranges to an external script.
snmpd.conf example
rocommunity public
# send all Emind Enterprise ID requests to the subagent
pass .1.3.6.1.4.1.39731 /usr/local/emind/snmp-subagent/snmp_subagent.sh
# send all Emind Enterprise ID requests to the subagent
pass .1.3.6.1.4.1.39731 /usr/local/emind/snmp-subagent/snmp_subagent.sh
When a request will arrive to any OID behind .1.3.6.1.4.1.39731 the snmp_subagent.sh will be called
GET Request:
/usr/local/emind/snmp-subagent/snmp_subagent.sh -g [requesed oid]
SET Request:
/usr/local/emind/snmp-subagent/snmp_subagent.sh -s [requesed oid]
NEXT Request: (for walk)
/usr/local/emind/snmp-subagent/snmp_subagent.sh -n [requesed oid]
As always, Enjoy !