I'm working through the NET-SNMP-TUTORIAL-MIB example using 
nstAgentSubagentObject.c and example-demon.c running as a subagent. I'm using 
Net-SNMP 5.7.1.

I have success on reads, but writes give a "wrongLength" error:

$ snmpget -v 2c -c private dut NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 

NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 = INTEGER: 2

$ snmpset -v 2c -c private dut NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 
i 
5
Error in packet.
Reason: wrongLength (The set value has an illegal length from what the agent 
expects)
Failed object: NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0


This is on an x86_64 environment where sizeof(int) = 4 and sizeof(long) = 8.
What I'm noticing is that netsnmp_register_int_instance() calls 
netsnmp_create_watcher_info() with sizeof(int). But I also see 
snmp_set_var_typed_integer() call snmp_set_var_value() with sizeof(long), which 
seems possibly inconsistent.

The snmp_set_var_value() appears to have conditionals for differences between 
size of int and long. So I'm not sure why this doesn't Just Work. I think I 
will 
attempt to change netsnmp_register_int_instance() and see what happens.

If anyone has insight on this, I'm all ears.

Many thanks,
        -Joe

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to