[SNMP4J] update table via snmpset command
Eagle
yunjoy at gmail.com
Fri Jun 10 05:54:36 CEST 2011
Hi
I have following table. It has been successfully created and can be query
using command
*#snmpget -v 2c -c public
192.168.0.2:166041.3.6.1.4.1.28458.1.26.2.1.1.1.1.6.110.109.115.49
SNMPv2-SMI::enterprises.28458.1.26.2.1.1.1.1.7.110.109.115.49 = STRING: "2"*
But when I want to set one of the colomn value e.g. the column marked
in REDusing command
*#snmpset -v 2c -c private
192.168.0.2:166041.3.6.1.4.1.28458.1.26.2.1.1.1.1.6.110.109.115.49 x
0x3136
*
It complains:
*Error in packet.
Reason: noCreation (That table does not support row creation or that object
can not ever be created)*
Are there somebody know the reason? Could you please help me to solve this
problem?
--------------------------------table---------------------------------------
MOTableSubIndex[] subIndexes_nbi =
new MOTableSubIndex[] { new
MOTableSubIndex(SMIConstants.SYNTAX_OCTET_STRING, 1, 255) };
MOTableIndex nbiNmsRegistrationTableIndex = new
MOTableIndex(subIndexes_nbi, false);
MOMutableColumn[] columns_nbi = new MOMutableColumn[MAX_COLOMNS];
int c=0
columns_nbi[c++] =
new MOMutableColumn(c, SMIConstants.SYNTAX_OCTET_STRING,
//nbiNmsRegistrationIndex
MOAccessImpl.ACCESS_FOR_NOTIFY);
columns_nbi[c++] =
new MOMutableColumn(c, SMIConstants.SYNTAX_OCTET_STRING, //
nbiNmsIpAddress
MOAccessImpl.ACCESS_READ_ONLY);
columns_nbi[c++] =
new MOMutableColumn(c, SMIConstants.SYNTAX_OCTET_STRING,
MOAccessImpl.ACCESS_READ_ONLY); // nbiTrapPortNumber
columns_nbi[c++] =
new MOMutableColumn(c, SMIConstants.SYNTAX_BITS,
MOAccessImpl.ACCESS_READ_CREATE);// nbiEventTypeFilter
columns_nbi[c++] =
new MOMutableColumn(c, SMIConstants.SYNTAX_OCTET_STRING,
MOAccessImpl.ACCESS_READ_CREATE);//
nbiObjectInstanceFilter
columns_nbi[c++] =
new MOMutableColumn(c, SMIConstants.SYNTAX_BITS,
MOAccessImpl.ACCESS_READ_CREATE);// nbiSeverityFilter
((MOMutableColumn)columns_nbi[c]).addMOValueValidationListener(getNbiSeverityValidator());
nbiNmsRegistrationTable =
new DefaultMOTable(new OID(new
OctetString("1.3.6.1.4.1.28458.1.26.2.1.1.1.1")),
nbiNmsRegistrationTableIndex, columns_nbi);
nbiNmsRegistrationTableModel = new DefaultMOMutableTableModel();
nbiNmsRegistrationTableModel.setRowFactory(new
DefaultMOMutableRow2PCFactory());
nbiNmsRegistrationTable.setModel(nbiNmsRegistrationTableModel);
Variable[] rowValues_nbi1 = new Variable[] {
new OctetString("nms1"), //nbiNmsRegistrationIndex
new OctetString("192.168.0.1"), // nbiNmsIpAddress
new OctetString("80"), // nbiTrapPortNumber
new OctetString("1"), // nbiActiveInterfaceVersion
new OctetString("notify'),// nbiEventTypeFilter
new OctetString("0"), //nbiObjectInstanceFilter
new OctetString("2"),// nbiSeverityFilter
};
DefaultMOMutableTableModel model_nbi = (DefaultMOMutableTableModel)
nbiNmsRegistrationTable.getModel();
OID index = new OctetString("nms1").toSubIndex(true);
model_nbi.addRow(new DefaultMOMutableRow2PC(index, rowValues_nbi1));
--------------------------------table---------------------------------------
--
----------------------------
Best Regards!
Eagle 刘莹
********************************************
QQ:121565415
MSN:yunjoy at hotmail.com
More information about the SNMP4J
mailing list