[SNMP4J] SNMP Agent isn't Emulating SNMP Device
Frank Fock
fock at agentpp.com
Sat May 14 13:48:11 CEST 2005
Hi,
The problem is easily solved by providing an MOAccess instance for
your columns. Sorry, the TestAgent example has a bug here. Thus,
for example, instead of
columns[c++] =
new MOColumn(c, SMIConstants.SYNTAX_INTEGER, null);
one should have used
columns[c++] =
new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
MOAccessImpl.ACCESS_READ_ONLY);
This should solve problem (1). Nevertheless, the next alpha
release will throw an NullPointerException if MOAccess is null at
construction time.
Regarding question (2):
A walk does a GETNEXT. Returing the lexicographically following
instance seems to me normal behavior or do I miss something here?
Best regards,
Frank
. . wrote:
>
> Now for my virtual UPS, I implemented the following:
>
> private static DefaultMOTable createStaticUpsChargeTable() {
> MOTableSubIndex[] subIndexes =
> new MOTableSubIndex[] { new
> MOTableSubIndex(SMIConstants.SYNTAX_INTEGER) };
> MOTableIndex indexDef = new MOTableIndex(subIndexes, false);
> MOColumn[] columns = new MOColumn[7];
> int c = 0;
> columns[c++] =
> new MOColumn(c, SMIConstants.SYNTAX_INTEGER, null);
> columns[c++] =
> new MOColumn(c, SMIConstants.SYNTAX_INTEGER, null);
> columns[c++] =
> new MOColumn(c, SMIConstants.SYNTAX_INTEGER, null);
> columns[c++] =
> new MOColumn(c, SMIConstants.SYNTAX_INTEGER, null);
> columns[c++] =
> new MOColumn(c, SMIConstants.SYNTAX_INTEGER, null);
> columns[c++] =
> new MOColumn(c, SMIConstants.SYNTAX_INTEGER, null);
> columns[c++] =
> new MOColumn(c, SMIConstants.SYNTAX_INTEGER, null);
>
>
> When I walk my virtual UPS I get:
>
> OID: 1.3.6.1.2.1.33.1.2.1.0 type: snmp.SNMPInteger value: 2
> OID: 1.3.6.1.2.1.33.1.2.2.0 type: snmp.SNMPInteger value: 0
> OID: 1.3.6.1.2.1.33.1.2.3.0 type: snmp.SNMPInteger value: 0
> OID: 1.3.6.1.2.1.33.1.2.4.0 type: snmp.SNMPInteger value: 100
> OID: 1.3.6.1.2.1.33.1.2.5.0 type: snmp.SNMPInteger value: 1118
> OID: 1.3.6.1.2.1.33.1.2.6.0 type: snmp.SNMPInteger value: 0
> OID: 1.3.6.1.2.1.33.1.2.7.0 type: snmp.SNMPInteger value: 25
>
> AND
>
> OID: 1.3.6.1.2.1.33.1.3.3.1.3.1.1 type: snmp.SNMPInteger value: 1
> OID: 1.3.6.1.2.1.33.1.3.3.1.3.2.1 type: snmp.SNMPInteger value: 599
> OID: 1.3.6.1.2.1.33.1.3.3.1.3.3.1 type: snmp.SNMPInteger value: 208
> OID: 1.3.6.1.2.1.33.1.3.3.1.3.4.1 type: snmp.SNMPInteger value: 0
> OID: 1.3.6.1.2.1.33.1.3.3.1.3.5.1 type: snmp.SNMPInteger value: 0
>
> This *looks* correct until I try to get OID's:
>
> Exception during retrieval: snmp.SNMPGetException: OID
> 1.3.6.1.2.1.33.1.2.4.0 not available for retrieval
>
> AND
>
> OID: 1.3.6.1.2.1.33.1.3.3.1.3.1 type: snmp.SNMPNull value: Null
>
> -------------------------------------------------------------------
>
> 1) How can I make my SNMP4J Agent better emulate the actual SNMP device?
>
> -------------------------------------------------------------------
>
> 2) In addition, the walk of the actual UPS yielded
> "1.3.6.1.2.1.33.1.3.3.1.3.1", but I KNOW that the actual OID being
> querried is actually "1.3.6.1.2.1.33.1.3.3.1.3".
>
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
>
More information about the SNMP4J
mailing list