Adding rows to a mib

Frank Fock Frank.Fock____t-online.de
Wed Apr 25 19:03:55 CEST 2001


Hi Eoin,

Eoin O'Sullivan wrote:

> The oidEntSensorThresholdEntry has an oidEntSensorThresholdIndex at
> "1.3.6.1.4.1.9.9.91.1.2.1.1.1", and has 5 columns added to it.
>

It is important to know what type the index object has? Thus,
how many subidentifiers has the whole index? I asume that it is an
integer...

>
> I am trying to add a row and populate these columns, and then retrieve
> and set their values. The examples haven't been much help. The functions
> available to me are:

Attention! These functions should be IMPLEMENTED by you
NOT called. They will be called by AGENT++. For the methods
that can be called, please see:
http://www.agentpp.com/doc3.x/class_MibTable.html

>
>
> ready_for_service(Vbx*, int);
> row_added(MibTableRow*, const Oidx&, MibTable*);
> row_delete(MibTableRow*, const Oidx&, MibTable*);
> row_init(MibTableRow*, const Oidx&, MibTable*);
> row_activated(MibTableRow*, const Oidx&, MibTable*);
> row_deactivated(MibTableRow*, const Oidx&, MibTable*);
> set_row(MibTableRow* r, long p0, long p1, long p2, long p3, long p4);
>
> I understand I have to add this row and set it in the main agent code,
> but have been unable to do it, partially as I am unsure of what to add
> for the Index.The code I have been attempting is:
>
> Oidx TestOid = "I don't know what to put here";

Oidx TestOid = "2"; // one subidentifier for an integer index column
// with value 2

>
> entSensorThresholdEntry *test = new entSensorThresholdEntry();
> MibTableRow* row = test->instance->add_row(TestOid);
>

OK.

>
> (Is add_row a usable function here? I only saw row_added())
>

It's ok.

>
> test->set_row(row,1,5,0,1,1);
> mib.add(new entSensorThresholdEntry(test));
>

1,5,0,1,1 is NOT the INDEX of your row, rather than
they are the values for your columnar objects.

>
> I have unsuccessfully tried to get this to work. Is the Index
> 5.1.5.0.1.1 , for the number of entries and what they are, or
> am I completely off the mark? If you can help me with this, or
> give me an example of adding rows like this I would greatly
> appreciate.

Hope this helps ;-)

Regards,
Frank




More information about the AGENTPP mailing list