Suppressing rows (specific interfaces) in ifTable

Eric Ewanco <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
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:[email protected]]

------------------------------------------------------------------------------
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
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
image001.jpg (image/jpeg, 10.4 KB) - not displayed
Eric J Ewanco.vcf (text/x-vcard, 3.7 KB)
BEGIN:VCARD
VERSION:2.1
X-MS-SIGNATURE:YES
N;LANGUAGE=en-us:Ewanco;Eric;J
FN:Eric J Ewanco
ORG:GENBAND;2022 Product Session & Security
TITLE:Senior Designer
TEL;WORK;VOICE:+1 (978) 947-3412
TEL;CELL;VOICE:+1 (508) 410-0470
X-MS-TEL;VOICE;COMPANY:62-73412
ADR;WORK;PREF:;;3 Federal St;Billerica;MA;01821;United States of America
LABEL;WORK;PREF;ENCODING=QUOTED-PRINTABLE:3 Federal St=0D=0A=
Billerica MA 01821
X-MS-OL-DEFAULT-POSTAL-ADDRESS:2
URL;WORK:www.genband.com
EMAIL;PREF;INTERNET:[email protected]
X-MS-IMADDRESS:[email protected]
X-MS-CARDPICTURE;TYPE=JPEG;ENCODING=BASE64:
 /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAcFBQYFBAcGBQYIBwcIChELCgkJChUPEAwRGBUa
 GRgVGBcbHichGx0lHRcYIi4iJSgpKywrGiAvMy8qMicqKyr/2wBDAQcICAoJChQLCxQqHBgc
 KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKir/wAAR
 CAAjAB0DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAA
 AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK
 FhcYGRolJicoKSo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awGnJIZPtjiILEhjQ
 AnkljktgZPGB6+ldjFGIYlRFAAFONOLk1bRCq4qrToqXN77erW9ltfz1ZKRxXM6/PJpEaf2c
 5hDnlRyOvYHIH4UUVrP4WcGHV5pM1tNgjMYuSu6Z1GXYknHoPQew4rQooq1sZ1fjZ//Z

X-MS-OL-DESIGN;CHARSET=utf-8:<card xmlns="http://schemas.microsoft.com/office/outlook/12/electronicbusinesscards" ver="1.0" layout="left" bgcolor="ffffff"><img xmlns="" align="tleft" area="15" use="cardpicture"/><fld xmlns="" prop="name" align="left" dir="ltr" style="b" color="000000" size="10"/><fld xmlns="" prop="title" align="left" dir="ltr" color="000000" size="8"/><fld xmlns="" prop="blank" size="8"/><fld xmlns="" prop="org" align="left" dir="ltr" color="000000" size="8"/><fld xmlns="" prop="telwork" align="left" dir="ltr" color="000000" size="8"><label align="left" color="626262">office </label></fld><fld xmlns="" prop="telorg" align="left" dir="ltr" color="000000" size="8"><label align="left" color="626262">a2       </label></fld><fld xmlns="" prop="telcell" align="left" dir="ltr" color="000000" size="8"><label align="left" color="626262">mobile</label></fld><fld xmlns="" prop="email" align="left" dir="ltr" color="000000" size="8"><label align="left" color="626262">email   </label></fld><fld xmlns="" prop="im" align="left" dir="ltr" color="000000" size="8"><label align="left" color="626262">talk     </label></fld><fld xmlns="" prop="addrwork" align="left" dir="ltr" color="000000" size="8"/><fld xmlns="" prop="webwork" align="left" dir="ltr" color="000000" size="8"/><fld xmlns="" prop="dept" align="left" dir="ltr" color="000000" size="8"/><fld xmlns="" prop="blank" size="8"/><fld xmlns="" prop="blank" size="8"/><fld xmlns="" prop="blank" size="8"/><fld xmlns="" prop="blank" size="8"/></card>
REV:20110809T170626Z
END:VCARD
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.