[SNMP4J] Plea for help from an SNMP beginner

Mark Brand markcbrand at googlemail.com
Wed Jul 16 17:50:03 CEST 2008


Hello,

Basically my situation is that I am writing an API in java for communication
with a piece of software, which is effectively a black-box (to me). The only
way in which I can communicate with aforementioned black box is by snmp, and
since snmp4j looked well written, I decided to use it.

Fast forward a couple of days, and I have achieved a lot of what I need to
achieve in terms of communicating with the software - I can happily read out
entries, write entries and walk around inside.

PROBLEM: Creating rows in a table - I need to create a row in a table,
according to the documentation for the blackbox i should do this in what
seems to be the standard way, using the status row.

Quick Sanity check: if the OID for the table is 1.3.6.1.4.1.9944.1.1.1.7.2.1
and the OID for the status column is 1.3.6.1.4.1.9944.1.1.1.7.2.1.10
then I want to be editing the entries 1.3.6.1.4.1.9944.1.1.1.7.2.1.10.x.0 ?

My code at the moment looks roughly like this:

String reg = new String( "1.3.6.1.4.1.9944.1.1.1.7.2.1.10."+nodeIndex+".0");
Variable var = new Integer32( 5 );
OID oid = new OID( reg );
VariableBinding vb = new VariableBinding();
vb.setOid( oid );
vb.setVariable( var );
PDU setPdu = new PDU();
setPdu.add( vb );
setPdu.setType( PDU.SET );

ResponseEvent event = snmp.send( setPdu, target );

and the problem I have is that event always has the error set as General
Variable Binding Error. Has anyone got any idea why this might happen?
It would seem that something is actually happening when I call it, because
if I then make a get request to another entry in the table (which I need to
then
set) I receive a null ref instead of getting any error message.

Thanks in advance for any help you can offer

Mark



More information about the SNMP4J mailing list