Robert Story wrote: > On Fri, 05 May 2006 14:20:47 +0100 John wrote: > JR> I needed a way to report the RedHat style ethernet port alias names > JR> (/etc/sysconfig/network-scripts/ifcfg-*) as ifDescr for a series of > JR> products. > JR> > JR> The, rather basic, patch tucks into the ifTable code and rewrites the > JR> tmp_descr field if it can find an appropriate alias, else it leaves the > JR> field well alone. > > First of all, thanks for submitting your code. I know a lot of people > customize net-snmp, but not many contribute back to the project. That's OK - Didn't seem like too much work to ping out a reasonably formatted email, and if it ever did go in it'd mean I didn't have to patch future versions...
> This code would actually belong in interface_linux.c, in the function > netsnmp_arch_interface_container_load(). Ah - Now that might have been good to find - I went for the slightly quick and dirty, at least partially as proof of concept, but it seemed to work quite well and be somewhat safe against missing files (proper use of snprintf to guard against overflows not withstanding). > Also, the patch assumes the first config file it finds using the device name > is the correct alias. This isn't always the case. I have multiple config files > for various wireless locations I frequent, and all of them use the same base > device. Ah - I hadn't thought of that. There are one to one interface/alias mappings in all of the machines I'm dealing with. Presumably a check on the IP/Netmask and/or gateway for the interface could be of help making that determination? > It's an interesting idea, and I'm sure it works well in your controlled > environment. But I don't think it's appropriate, as-is, for integration into > net-snmp. If you can find a more reliable way to determine the alias, I will > re-consider it. When I get some more time to look at this I will certainly have a go. As it stands there is a basic copy available if anyone wants to use it (or wants to continue the work), and for my purposes it does the job so it's not top of my todo list atm... Thanks, John ------------------------------------------------------- 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-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
