I am understanding of to extend snmp agent by custom MIBS and following this tutorial:
http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent
I was able to compile the net-snmp package with custom MIB file alongwith the C file and the Header file. I am also able to run the snmpd agent using below command:
sudo snmpd -f -V -L -d -c /etc/snmp/snmpd.conf
Also, snmpget is working as expected by the tutorial:
$ snmpget -v 2c 192.168.1.105 -c public NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0
Output: NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 = INTEGER: 2
However snmpset is failing with error: "No community name specified"
snmpset -v 2c 192.168.1.105 -c public NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 = 5
I also tried with private for community string:
snmpset -v 2c 192.168.1.105 -c private NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 = 5
Still same error. Why is snmpset not working ?
Here is my snmpd.conf file: (relevant sections) ######################################################################################
agentAddress udp:192.168.1.105:161
## ACCESS CONTROL
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
#rocommunity public localhost
rocommunity public
rwcommunity private
rouser authOnlyUser
com2sec readonly default public
com2sec readwrite default private