Re: multiple Sub-agents managing the same table

"Arnaud BODENAN" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi,

After having spent a while on debugging my subagent, I finally find a way to 
resolve it.
I've done a hack in the source code of the function table_helper_handler in 
the file agent/helpers/table.c.

Indeed, this handler is written to handle tables registered from the rootOid 
corresponding to the Oid of the Table. The problem is that with registration 
of a region of MIB, the rootOid corresponds to the index of the table.

Here is my workaround (hardcoded for the moment):

int
table_helper_handler(netsnmp_mib_handler *handler,
                     netsnmp_handler_registration *reginfo,
                     netsnmp_agent_request_info *reqinfo,
                     netsnmp_request_info *requests)
{

    netsnmp_request_info *request;
    netsnmp_table_registration_info *tbl_info;
    int             oid_index_pos;
    unsigned int    oid_column_pos;
    unsigned int    tmp_idx;
    size_t	    tmp_len;
    int             incomplete, out_of_range, cleaned_up = 0;
    int             status = SNMP_ERR_NOERROR, need_processing = 0;
    oid            *tmp_name;
    netsnmp_table_request_info *tbl_req_info;
    netsnmp_variable_list *vb;

    if (!reginfo || !handler)
        return SNMPERR_GENERR;

    // If we the table has been registered with a range_subid
    // the rootOid of the table corresponds to the total Len - 3 (Entry, 
Column and index)
    // To decrement only once the rootoid_len, I hardcode the value 13 for 
my test
    if ( reginfo->range_subid != 0 && reginfo->rootoid_len == 13 )
   {
	reginfo->rootoid_len -= 3;
   }

Now, I want to know how this bug can be corrected in a safe and clean 
manner...

=> at the end of the registration of the table (if a subid is set), set the 
rootoid_len to the correct value ?

What do you think?

Arnaud.

>From: "Arnaud BODENAN" <[email protected]>
>To: [email protected]
>Subject: Re: multiple Sub-agents managing the same table
>Date: Wed, 06 Sep 2006 17:35:52 +0200
>
>OK dave and thanks a lot for all the time you spend for me.
>
>I have a closer look to the function netsnmp_table_data_set_helper_handler
>and try to debug it as it seems that my creation/resgistration now works
>fine.
>
>If somebody has a brilliant idea about this problem, he's welcome!
>
>Arnaud.
>
> >From: "Dave Shield" <[email protected]>
> >To: "Arnaud BODENAN" <[email protected]>
> >CC: [email protected]
> >Subject: Re: multiple Sub-agents managing the same table
> >Date: Wed, 6 Sep 2006 16:00:51 +0100
> >
> >On 06/09/06, Arnaud BODENAN <[email protected]> wrote:
> > > I follow your advice and do a walk on nsModuletable. So, With net-snmp
> > > v5.3.1, I launch twice the same application, and I get the following
> >result
> > > with an snmpwalk on nsModuleTable:
> >
> >      [snip]
> >
> >I haven't the time to follow your travails in detail at the moment,
> >but that certainly looks as if the two rows are at least being
> >registered correctly.   So if the walk doesn't deliver the right
> >results, it's probably due to problems within the dataset helper
> >handler (i.e. when processing a request), rather than anything in the
> >registration stage.
> >
> >Not that this knowledge gets you any further forward, but it's always
> >useful to know where you should be looking!
> >
> >Dave
> >
> >-------------------------------------------------------------------------
> >Using Tomcat but need to do more? Need to support web services, security?
> >Get stuff done quickly with pre-integrated technology to make your job
> >easier
> >Download IBM WebSphere Application Server v.1.0.1 based on Apache 
>Geronimo
> >http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >_______________________________________________
> >Net-snmp-users mailing list
> >[email protected]
> >Please see the following page to unsubscribe or change other options:
> >https://lists.sourceforge.net/lists/listinfo/net-snmp-users
> >
>
>_________________________________________________________________
>FREE pop-up blocking with the new MSN Toolbar - get it now!
>http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>
>
>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job 
>easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>Net-snmp-users mailing list
>[email protected]
>Please see the following page to unsubscribe or change other options:
>https://lists.sourceforge.net/lists/listinfo/net-snmp-users

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.com/


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.