novice questions
Frank Fock
Frank.Fock____t-online.de
Wed May 21 23:43:45 CEST 2003
Hi Samuel,
Please find my comments inline:
Samuel Lokshin wrote:
> Hi,
>
> I am new to agent++, and agentGen, I have read mail archive and PDF documentation for Agent++, and look at the examples.
> I would like to use this product.
> I have several questions:
>
> 1. In the mail archive I found the reply on the question about message flow on a SET request, but could not found the reply for the question about GET, GET_NEXT , and BULK requests. Could you please provide the message flow for them.
>
For GET and GETNEXT messages it is as follows:
1. RequestList::receive
2. Mib::process_request
2.1 Mib::process_get[_next]_request
2.2 for all subrequests do
2.2.1 Mib::get_context
2.2.2 Mib::find_managing_object
2.2.3 MibEntry::get[_next]_request
2.3 Mib::finalize
2.3.1 RequestList::answer
2.4 STOP
For GETBULK it is as follows:
1. RequestList::receive
2. Mib::process_request
2.1 Mib::process_get_bulk_request
2.2 for all non-repetition subrequests do
2.2.1 Mib::get_context
2.2.2 Mib::find_managing_object
2.2.3 MibEntry::get_bulk_request
2.3 for all repetition subrequests do until max-repetitions
or max PDU size or end-of-MIB-view is reached
2.3.1 Mib::get_context
2.3.2 Mib::find_managing_object
2.3.3 MibEntry::get_bulk_request
2.3.5 Request::add_rep_row
2.4 Mib::finalize
2.4.1 RequestList::answer
2.5 STOP
> 2. In the documentation several virtual functioned are mentioned for objects in a MibTable:
> MibLeaf::clone and MibLeaf::max_key and it says how important is to override them.
> As I understand AgentGen takes care about clone function, but I could not find any example for max_key,
> could you please provide short example, and when do I need to overwrite this function.
>
MibLeaf::max_key must not be overwritten.
You should overwrite it only if you directly derive
your class from MibEntry or if you implement a
special MibComplexEntry subclass.
The MibLeaf::clone() method must be overwritten
whenever you use that leaf object in a MibTable.
> 3. Is this code enough to update row in a table or I need to call get_rows_cloned() function?
> ( I am updating MIB using the values I am monitoring.)
> mib->lock_mib();
> start_synch();
> row = find_index(...);
> set_row(row,..); //using my new values.
> end_synch()
> mib->unlock_mib();
>
Is OK. get_rows_cloned() will not be useful
when updating the table, because it clones (copies)
the table content and modifying the returned values,
you will not alter the table at all.
> 4. In the documentation it states that Agent++ "transparently provides SNMPv1/v2c/v3 functionality". My question is
> How agent knows what message structure it has to create (snmp message version field is for sure different)?
>
It knows it from the request that is answered.
If you send a notification of inform request, the
SNMP version and other parameters of the target(s)
are fetched from the SNMP-TARGET-MIB.
Best regards,
Frank
More information about the AGENTPP
mailing list