[SNMP4J] agent simulation
oumniya zrikem
oumniya.zrikem at gmail.com
Sun May 8 15:02:01 CEST 2011
Hi,
I tested your snmp agent with the snmp4j agent toolbox.
I tried to understand how to modify the agent to fit my needs.
here is my code, i used your snmp test agent.
OID interfacesTable = new OID(".1.3.6.1.2.1.2.2.1");
MOTableBuilder builder = new MOTableBuilder(interfacesTable)
.addColumnType(SMIConstants.SYNTAX_INTEGER,MOAccessImpl.ACCESS_READ_WRITE)
.addColumnType(SMIConstants.SYNTAX_OCTET_STRING,MOAccessImpl.ACCESS_READ_WRITE)
.addColumnType(SMIConstants.SYNTAX_INTEGER,MOAccessImpl.ACCESS_READ_WRITE)
.addColumnType(SMIConstants.SYNTAX_INTEGER,MOAccessImpl.ACCESS_READ_WRITE)
.addColumnType(SMIConstants.SYNTAX_GAUGE32,MOAccessImpl.ACCESS_READ_WRITE)
.addColumnType(SMIConstants.SYNTAX_OCTET_STRING,MOAccessImpl.ACCESS_READ_WRITE)
.addColumnType(SMIConstants.SYNTAX_INTEGER,MOAccessImpl.ACCESS_READ_WRITE)
.addColumnType(SMIConstants.SYNTAX_INTEGER,MOAccessImpl.ACCESS_READ_WRITE)
.addRowValue(new Integer32(3))
.addRowValue(new OctetString("loopback"))
//1.3.6.1.2.1.2.2.1.2.1
.addRowValue(new Integer32(24))
.addRowValue(new Integer32(1200))
.addRowValue(new Gauge32(10000000))
.addRowValue(new OctetString("00:00:00:00:01"))
//1.3.6.1.2.1.2.2.1.6.1
.addRowValue(new Integer32(1300))
.addRowValue(new Integer32(1400))
//next row
.addRowValue(new Integer32(2))
.addRowValue(new OctetString("eth0"))
//1.3.6.1.2.1.2.2.1.2.2
.addRowValue(new Integer32(22))
//1.3.6.1.2.1.2.2.1.3.2
.addRowValue(new Integer32(1100))
.addRowValue(new Gauge32(10000000))
.addRowValue(new OctetString("00:00:00:00:02"))
//1.3.6.1.2.1.2.2.1.6.2
.addRowValue(new Integer32(1500))
.addRowValue(new Integer32(1600));
When i made get requests with a manager i got the answer but when i made set
requests i had problems ("the error is bad access")
i made the set request with:
community: public
and then i put another string for the pdu.
I hope everything is clear.
Thanks a lot
--
Cordialement,
Oumniya ZRIKEM
More information about the SNMP4J
mailing list