I need advice for coding an AgentX subagent. GOAL: To suppress/delete/eliminate/override certain interfaces in the ifTable/ifXTable according to name.
WHY: Interfaces which change ifIndex confuse the EMS and its user, and aren't required anyway. One set of interfaces is internal and should not be exposed anyway. CONSTRAINTS: We want to do this in such a way that we can upgrade net-snmp with minimal hassle. This implies not patching net-snmp itself. The desire is to use an AgentX subagent. Also, because these interfaces are dynamic, they can't be configured statically to be hidden using the run-time feature provided for this in snmpd.conf. DILEMMA: This would be a two-line patch if we patched net-snmp, but this approach is not considered optimal. If we wrote our own ifTable/ifXTable handlers from scratch, that would be a project and they would be bug-prone. If we copied the existing handlers and tweaked them, that would involve a lot of work to shoehorn it in, and we still would risk breakage and/or missing fixes on net-snmp updates. PROPOSAL: What I want to do is edit an existing AgentX subagent that has successfully extended ifTable/ifXTable to handle proprietary hardware, to handle all ifTable/ifXTable requests, returning "No Such" for the rows I want to suppress, and passing the requests I approve up via netsnmp_call_next_handler or some other mechanism to be handled by existing net-snmp code. IMPLEMENTATION: I coded a prototype where I register each column of each interface I find with netsnmp_handler_registration_create, and check each interface on callback to see if it should be suppressed, and return SNMP_NOSUCHOBJECT if it is. Otherwise, I pass it up the handler chain. RESULTS: It correctly returns NOSUCH for gets but doesn't work for walks; I still see the original interface. Oh, and small detail: Some data is off; e.g. interface eth0 shows zero ifInOctets even though ifconfig shows a large number, ifPhysAddress is wrong on several interfaces, etc. QUESTION: Before I spend too much time going down a rathole, I want to know if I have the right approach to the problem in the first place, and additional resources I can consult. I know this topic has been discussed before but crafting a search query for it is a bit tricky. I've done a lot of searching but haven't come up with solid answers. VERSION: We are using net-snmp-5.7.1-3.8.1 (OpenSuSE) DISCLAIMER: I am very much a net-snmp newbie. I've dallied with snmp my whole career, and used net-snmp a fair amount, maybe touched on code here and there, but this is the most substantial project coding with net-snmp I've done. Thanks to anyone who can shed light on this problem. Eric [cid:image001.jpg@01CFE88F.D6C18D90]
<<attachment: Eric J Ewanco.vcf>>
------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho
_______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users