(Posting this here to get a wider audience for my stuck patch review.)

I have a patch in review (https://github.com/net-snmp/net-snmp/pull/24)
where I'm trying
to prune a large number of interfaces (~2000 or more).

The patch introduces a new configuration option to limit the number
of interfaces that the IF-MIB will process. On Linux servers with a
large number of interfaces (ppp, dummy, bridge, etc.), the IF-MIB
timer based stats collector can take a large amount of CPU processing.

The new config option "include_ifmib_iface_prefix" takes a space
separated string of ifname prefixes ("eth lo bridg") and will only
include interfaces with these prefixes in the IF-MIB tables.

If this config option is not present (the default), all interfaces
will continue to be processed in the IF-MIB.

This patch is largely based on work by Collet Thibaut from

https://sourceforge.net/p/net-snmp/patches/1352/
The problem I'm trying to solve is that even though my configuration
option is parsed and I have checks in place to prevent
non-matched prefixes from being included in the IF-MIB,
for the first 300 seconds after snmpd is started, all the interfaces
are included.  So even with my patch, the CPU for snmpd will be
rather high (depending on the number if interfaces) for these first 5
minutes.

So even though I can register a callback for SNMP_CALLBACK_POST_READ_CONFIG,
I'm not sure how to limit (or prune) the interface list that is somehow
generated
in ifTable_interface.c. There's some initialization magic (m2c?) that has
to happen
to prevent *all* interfaces from being included until the 300 second cache
timer pops.

Is there an easy way to bring up snmpd and remove (or change) the interfaces
included in the IF-MIB? I have the prefix list (index_list) already filled
in at startup.

How would I do this from my post-read callback function?

Any hints would be appreciated.

Thanks,
Sam
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to