[SNMP4J] Plea for help from an SNMP beginner

PHIL BERGSTRESSER phil.bergstresser at adtran.com
Wed Jul 16 18:14:07 CEST 2008


Mark,
    You are not addressing the table entries correctly. The row-status
column at ...7.2.1.10 is the table row, so the OIDs for the other
columns will be 7.2.1.y.x where y is the column variable desired, and x
is the row index. You will not end with a zero as that is superfluous
and imples a scalar, so just drop that.
    Does this help?
Phil


> -----Original Message-----
> From: snmp4j-bounces at agentpp.org 
> [mailto:snmp4j-bounces at agentpp.org] On Behalf Of Mark Brand
> Sent: Wednesday, July 16, 2008 10:50 AM
> To: snmp4j at agentpp.org
> Subject: [SNMP4J] Plea for help from an SNMP beginner
> 
> 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
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
> 



More information about the SNMP4J mailing list