You can implement the entire ifTable in your sub-agent, and then use the function add_to_init_list() with the object name prefixed by "-" to indicate to netsnmp to not register its own ifTable. You will also have to override the scalar ifNumber which stores the number of ifTable rows there are.
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:net-snmp-coders- > [EMAIL PROTECTED] On Behalf Of net-snmp-coders- > [EMAIL PROTECTED] > Sent: 03 February 2008 20:09 > To: [email protected] > Subject: Net-snmp-coders Digest, Vol 21, Issue 2 > > Send Net-snmp-coders mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/net-snmp-coders > or, via email, send a message with subject or body 'help' to > [EMAIL PROTECTED] > > You can reach the person managing the list at > [EMAIL PROTECTED] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Net-snmp-coders digest..." > > > Today's Topics: > > 1. RE: overwrite standard mib2/interfaces (Masoud Fatollahy) > 2. RE: overwrite standard mib2/interfaces (Magnus Fromreide) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 02 Feb 2008 21:42:43 +0100 > From: "Masoud Fatollahy" <[EMAIL PROTECTED]> > Subject: RE: overwrite standard mib2/interfaces > To: "Mike Ayers" <[EMAIL PROTECTED]>, > [EMAIL PROTECTED], > [email protected] > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="us-ascii" > > Hi and thanks for the response, > Since it is not possible to add our own rows to the ifTable right now and we > don't know when this feature can be added to the net-snmp, I think it should > be nice and helpful to know the way to disable/exclude ifTable on net-snmp > and do everything in our subagent? > > Thanks, > > /Masoud > > > -----Original Message----- > > From: "Mike Ayers" <[EMAIL PROTECTED]> > > To: "Masoud Fatollahy" <[EMAIL PROTECTED]>, > <[EMAIL PROTECTED]>, > <[email protected]> > > Date: Fri, 1 Feb 2008 10:38:12 -0800 > > Subject: RE: overwrite standard mib2/interfaces > > > > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] On > > > Behalf Of Masoud Fatollahy > > > Sent: Thursday, January 31, 2008 7:24 AM > > > > > We are planning to find the best possible way to register our > > > ports as interface in mib2/interfaces(if-mib/ifTable) table > > > on net-snmp-5.4.1. since these ports are not seen by the > > > linux system then we should include them to the interface > > > list ourselves, but the idea is to keep net-snmp as it is and > > > do not modify anything(modify as little as possible). in > > > order to do this we have decided to use a sub-agent and > > > AgentX to talk to net-snamp agent. the question is: > > > How can we do this to achieve our goal? > > > A answer which we are looking at right now is that remove > > > registration of MIB2/Interfaces(if-mib/ifTable) and use our > > > subagent to register all interface mibs and callbacks functions. > > > Since you are the experties, I want to know your idea about this? > > > > There is no need to clobber the entire ifTable. Simply register a row > for each port. You'll need to register each object in each row > individually, which is a bit of a pain, but that's the only real problem. I > don't know if there are helpers for this. I would recommend using very > large numbers for your ifIndex to keep clear of those generated by the MIB > module. > > > > Hopefully, the ifTable implementation has a way to cooperatively add your > own rows, but I've never examined it. Anyone? > > > > > > Thanks, > > > > Mike > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 2 > Date: Sun, 03 Feb 2008 08:08:08 +0100 > From: Magnus Fromreide <[EMAIL PROTECTED]> > Subject: RE: overwrite standard mib2/interfaces > To: Masoud Fatollahy <[EMAIL PROTECTED]> > Cc: [email protected], Mike Ayers > <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1 > > > On l?r, 2008-02-02 at 21:42 +0100, Masoud Fatollahy wrote: > > Hi and thanks for the response, > > Since it is not possible to add our own rows to the ifTable right now > > and we don't know when this feature can be added to the net-snmp, I > > think it should be nice and helpful to know the way to disable/exclude > > ifTable on net-snmp and do everything in our subagent? > > It is possible, just register your row using > > Register-PDU ( ifDescr.[ifIndex] .. ifSpecific.[ifIndex] ) and it should > show up. > > The problem is that you have to make sure that you don't clash with the > normal ifTable and that your interface number allocations stays the same > over time, specifically there is a requirement that interface numbers > are constant between agent (and subagent) restarts. > > As for turning off the module: > > >From the command line: > -I -ifTable,ifXTable > > Using configure: > --with-out-mib-modules=if-mib > > > Thanks, > > > > /Masoud > > > > > > -----Original Message----- > > From: "Mike Ayers" <[EMAIL PROTECTED]> > > To: "Masoud Fatollahy" <[EMAIL PROTECTED]>, > > <[EMAIL PROTECTED]>, > > <[email protected]> > > Date: Fri, 1 Feb 2008 10:38:12 -0800 > > Subject: RE: overwrite standard mib2/interfaces > > > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] On > > > Behalf Of Masoud Fatollahy > > > Sent: Thursday, January 31, 2008 7:24 AM > > > > > We are planning to find the best possible way to register > > our > > > ports as interface in mib2/interfaces(if-mib/ifTable) table > > > on net-snmp-5.4.1. since these ports are not seen by the > > > linux system then we should include them to the interface > > > list ourselves, but the idea is to keep net-snmp as it is > > and > > > do not modify anything(modify as little as possible). in > > > order to do this we have decided to use a sub-agent and > > > AgentX to talk to net-snamp agent. the question is: > > > How can we do this to achieve our goal? > > > A answer which we are looking at right now is that remove > > > registration of MIB2/Interfaces(if-mib/ifTable) and use our > > > subagent to register all interface mibs and callbacks > > functions. > > > Since you are the experties, I want to know your idea about > > this? > > > > There is no need to clobber the entire ifTable. Simply > > register a row for each port. You'll need to register each > > object in each row individually, which is a bit of a pain, but > > that's the only real problem. I don't know if there are > > helpers for this. I would recommend using very large numbers > > for your ifIndex to keep clear of those generated by the MIB > > module. > > > > Hopefully, the ifTable implementation has a way to > > cooperatively add your own rows, but I've never examined it. > > Anyone? > > > > > > Thanks, > > > > Mike > > > > ------------------------------------------------------------------------ - > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ Net-snmp-coders > mailing list [email protected] > https://lists.sourceforge.net/lists/listinfo/net-snmp-coders > > > > > ------------------------------ > > ------------------------------------------------------------------------ - > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > ------------------------------ > > _______________________________________________ > Net-snmp-coders mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/net-snmp-coders > > > End of Net-snmp-coders Digest, Vol 21, Issue 2 > ********************************************** ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
