Thank you, this is exactly what I was looking for. I agree that getting the kernel to report the interfaces correctly is the ideal approach. That will be my prefered approach, but not being familiar with that part of the system, I like having alternative approaches. Another issue is that some ifTypes are not being identified correctly. I have identifed the part of the code (the MFD version) where that is an issue and hope to put together a patch in the next week or so.
Thanks, Jeff On Tuesday, February 15, 2005 12:16 PM, Robert Story wrote: > Ok, since the two of your seem gung-ho on mixing in extra > interfaces, here's the scoop. > > The problem with mixing interfaces is the ifIndex. By > definition, the index to a table for a particular row must > remain constant for the lifetime of the agent process. [Note > that this is not true for the existing mibII/interfaces.c > implementation for some platforms. Bringing interfaces up and > down can re-order the table, which is bad new for someone > trying to monitor a particular interface.] > > So the trend is to try and use the ifIndex from the kernel, > wherever possible. The new IF-MIB implementation (in > if-mib/*) does this. So, if you want to mix in proprietary > interfaces that the kernel doesn't know about, how do we > ensure that the ifIndex values don't clash? The easiest way > is probably to define an offset for ifIndexes for the > proprietary interface types. For an embedded system, this is > probably pretty easy, as the interfaces will likely remain > constant. But it isn't too hard to imagine a scenario where a > conflict could occur. So, if you've evaluated the risk and > found it acceptable, select an offset you are comfortable with. > > Now, how to integrate with the existing code? I recommend > using the new IF-MIB implementation, because I think that is > the direction that the code base is moving. The old > implementation will probably be phased out (off by default) > over the next few releases. If you platform is Linux, then > the bulk of the work is already done. [If it is some other > platform, then the old style code needs to be ported to the > new style.] You will have to patch the agent, but it should > be a one line patch to call your code to add the additional > interfaces. > > There are two places where you could put the call. The key > function is netsnmp_arch_interface_container_load(). This > function is called from > netsnmp_access_interface_container_load() in > if-mib/data_access/interface_common.c. It's purpose is to > populate a container with interface entries. The Linux > implementation is in if-mib/data_access/interface_linux.c, > which should serve as your example of how to create and add > entries. You can add a call to your function before, after or > inside the *_arch_* call. > > You will need to configure with --enable-mfd-rewrites > (recommended) or explicitly exclude the mibII/interfaces > module and include the if-mib modules. > > -- > Robert Story; NET-SNMP Junkie > Support: <http://www.net-snmp.org/> > <irc://irc.freenode.net/#net-snmp> > Archive: > <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users> > > You are lost in a twisty maze of little standards, all different. > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from > real users. Discover which products truly live up to the > hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > 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 > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ 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
