Dynamic Table
Mauro Restante
restante____cefriel.it
Thu Apr 12 20:29:18 CEST 2001
Hi frank, and hi to all mailing list,
I should ask your help once again.
Following the dynamic table example I try to implement the
Disman-Schedule-Mib table.
I don't understand how the index of table must process.
I used Agentgen to generate disman-Schedule-Mib code.
this is the init module of static example.
>>> void init(Mib& mib)
>>> {
>>> mib.add(new sysGroup("AGENT++v3.4 Static Table Sample Agent - Use
'MD5' as SNMPv3 user and 'MD5UserAuthPassword' as authentication",
"1.3.6.1.4.1.4976", 10));
>>> mib.add(new snmpGroup());
>>> mib.add(new snmp_target_mib());
>>> mib.add(new snmp_notification_mib());
>>> MibStaticTable* st = new MibStaticTable("1.3.6.1.4.1.4976.6.1.1");
>>> st->add(MibStaticEntry("1.3.6.1.4.1.4976.6.1.1.2.224",
SnmpInt32(1)));
>>> st->add(MibStaticEntry("1.3.6.1.4.1.4976.6.1.1.3.224",
OctetStr("Mauro")));
>>> st->add(MibStaticEntry("1.3.6.1.4.1.4976.6.1.1.2.71",
SnmpInt32(2)));
>>> st->add(MibStaticEntry("1.3.6.1.4.1.4976.6.1.1.3.71",
OctetStr("another text")));
>>> mib.add(st);
>>> //§§ MR
>>> //mib.add(new disman_schedule_mib());
>>> schedEntry* schedTable=new schedEntry(); // I instantiate a new class of
scheEntry.
>>> MibTableRow * p_mibTableRow;
>>> p_mibTableRow = schedTable->add_row(schedTable->get_next_avail_index());
/* I try to create a single row but I don't know how to process the
const index_info indSchedEntry[2] = {
{ sNMP_SYNTAX_OCTETS, FALSE, 0, 255 },
{ sNMP_SYNTAX_OCTETS, FALSE, 0, 255 } };
that, I think, represent the index of the entry table.*/
>>> schedTable->set_row (p_mibTableRow,"Mauro",99999, "pluto", "77777","
restante", "vimodrone", "milano", "ceriel", "pippo", 66666, 55555, 44444,
33333, 22222, 11111, "cazzo", 00000, 121212);
>>> mib.add(schedTable);// I add the element to the agent.
>>> mib.add(new schedLocalTime());
In this way the Manager doesn't know the index element and I'm not be able
to create a new row.
I think that set_row must be done in the Disman-Schedule-Mib code in order
to create dynamically a new instance of the table. In this case I don't
understand how instance the table. The agent reply to a get or set request
of the manager with no such name error.
I hope to have been clear in explaning my doubt.
I'm very sorry for length of this mail, and I thank to all mailing list for
their help.
Mauro Restante
------------------------------
CEFRIEL/Politecnico di Milano
Network Systems Area
via Fucini 2
20133 Milano - Italy
Tel. +39 02 23954248
Fax. +39 02 23954529
More information about the AGENTPP
mailing list