Re: [net-snmp] - adding rows from different remote subagent - SNMP

This is a discussion on Re: [net-snmp] - adding rows from different remote subagent - SNMP ; OK, i found the *solution*: the problem is that I cannot register, from 2 different subagent, the same table oid (or, in general, the same oid of any variable). Infact, the agent log prints: agentx/master: in register_agentx_list agentx/master: duplicate registration ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Re: [net-snmp] - adding rows from different remote subagent

  1. Re: [net-snmp] - adding rows from different remote subagent

    OK, i found the *solution*:
    the problem is that I cannot register, from 2 different subagent, the same
    table oid (or, in general, the same oid of any variable).
    Infact, the agent log prints:

    agentx/master: in register_agentx_list
    agentx/master: duplicate registration

    So, now, the problem is : how to register the same variable oid from two
    differents subagents?
    Roberto


    "Roberto" ha scritto nel messaggio
    news:sruRa.83168$qa5.1674824@news2.tin.it...
    > Hi,
    >
    > I'm implementing two remote subagents that manage the same OID table: I

    want
    > to add more rows using different index (entry istance).
    > I'm using the register_int_index (that use the register_index API) to get
    > the right index from the agent.
    > So, for example, if Subagent_A wants to add 3 rows, the agent gives him

    the
    > index #1,#2 and #3. Then it use this index to add tree rows. Perfect: I

    see
    > the rows by my manager.
    > The second Subagent_B wants to add 2 rows (in the same oid table): the

    agent
    > gives him the index #4 and #5. That's right. Then the subagent use this
    > indexes to add two rows.
    > But (this is the problem) I didn't see this new rows in my manager! =>
    > Subagent_B didn't add the two rows
    > Why?
    > I tryed to disable the "register_int_index" API (and add rows using my
    > "personal" indexes), but it didn't works yet.
    >
    >
    > To add the rows, I use the following functions:
    >
    > // To add the row index (entry instance)
    > netsnmp_table_row_add_index(row, ASN_INTEGER, &indexNumber,
    > sizeof(indexNumber));
    >
    > // To add a generic value to the column #n
    > netsnmp_set_row_column(row, n, ASN_OCTET_STR, myValue,

    myValue.length());
    >
    > // To make writable the column
    > netsnmp_mark_row_column_writable(row, n, 1);
    >
    > // To add the row into the table
    > netsnmp_table_dataset_add_row(table, row);
    >
    > // To register the new data table (?)
    > netsnmp_register_auto_data_table(table, NULL);
    >
    >
    > What's my error?
    >
    > Please, help me... ;(
    > Roberto
    >
    >




  2. Re: [net-snmp] - adding rows from different remote subagent

    Hi Roberto,

    You cannot register the same OID from to different subagents
    with the same priority. Choosing a different region priority would
    not help, because that one with the higher priority will hide that
    with the lower one.

    AgentX shared tables work because each subagent that want to
    add rows to the shared table, allocates them at the master agent
    via the AgentX protocol. So, each subagent uses its own (unique)
    index(es). Each subagent then registers each row (not the whole
    table) it owns an index for.

    I do not know if the latest release of the NET-SNMP agent
    supports shared tables (may be Dave Shield can add some info
    here?), however, if you are implementing a non-commercial
    agent you could also use AgentX++ for free which does support
    shared tables and, of course, index allocation.
    See http://www.agentpp.com for the download.

    Regards,
    Frank Fock


    Roberto wrote:

    >OK, i found the *solution*:
    >the problem is that I cannot register, from 2 different subagent, the same
    >table oid (or, in general, the same oid of any variable).
    >Infact, the agent log prints:
    >
    >agentx/master: in register_agentx_list
    >agentx/master: duplicate registration
    >
    >So, now, the problem is : how to register the same variable oid from two
    >differents subagents?
    >Roberto
    >
    >
    >



  3. Re: [net-snmp] - adding rows from different remote subagent

    Frank Fock wrote:

    > I do not know if the latest release of the NET-SNMP agent
    > supports shared tables (may be Dave Shield can add some info
    > here?)


    Ummm....
    I was trying to ignore this question :-)

    My best guess would be as follows:

    - the Net-SNMP AgentX module does include index allocation
    and row registration support. But these have probably not
    received a significant amount of use, so won't have been tested
    particularly heavily. So it wouldn't surprise me if there are
    some bugs still lurking there.

    - the various table handlers are designed for implementing
    the *whole* of a table, so are not geared up for handling
    individual row registrations. So if you want to work in this
    way, you're probably going to have to register "raw" handlers,
    rather than leaving much of the work to agent toolkit helpers.


    But it's a while since I looked at this side of things, so I'm
    open to correction.

    Dave

+ Reply to Thread