Hello folks,
The following patch uses the known_missing flag to make sure that the
transient interfaces that are known to have gone away are not sent in
response to GET* requests. If it is an acceptable solution to the
missing-interfaces-being-displayed-by-snmpwalk problem, I will post it
to net-snmp.org/patches.
Thanks
- Tushar
Index: net-snmp-5.4/agent/mibgroup/if-mib/ifTable/ifTable_interface.c
===================================================================
--- net-snmp-5.4.orig/agent/mibgroup/if-mib/ifTable/ifTable_interface.c
+++ net-snmp-5.4/agent/mibgroup/if-mib/ifTable/ifTable_interface.c
@@ -997,8 +997,15 @@ _mfd_ifTable_get_values(netsnmp_mib_hand
if (NULL == tri)
continue;
- rc = _ifTable_get_column(rowreq_ctx, requests->requestvb,
- tri->colnum);
+ /* Don't report interfaces for which known_missing flag is set */
+ if (!rowreq_ctx->known_missing)
+ rc = _ifTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ else {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+
if (rc) {
if (MFD_SKIP == rc) {
requests->requestvb->type = SNMP_NOSUCHINSTANCE;
Index: net-snmp-5.4/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
===================================================================
--- net-snmp-5.4.orig/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
+++ net-snmp-5.4/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
@@ -872,8 +872,15 @@ _mfd_ifXTable_get_values(netsnmp_mib_han
if (NULL == tri)
continue;
- rc = _ifXTable_get_column(rowreq_ctx, requests->requestvb,
- tri->colnum);
+ /* Don't report interfaces for which known_missing flag is set */
+ if (!rowreq_ctx->known_missing)
+ rc = _ifXTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ else {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+
if (rc) {
if (MFD_SKIP == rc) {
requests->requestvb->type = SNMP_NOSUCHINSTANCE;
Robert Story wrote:
> On Fri, 13 Mar 2009 12:00:09 -0700 Tushar wrote:
> TG> > Is the ifStatus down?
> TG> >
> TG>
> TG> The interface is not down, but is removed using the command:
>
> right.. but I'm asking about the net-snmp ifStatus.
>
> TG> It is not an issue to keep the entry if the vlan interface is down. But
> TG> the entry remains in the cache even after you remove the vlan
> TG> interface. How should this situation be handled?
>
> That's a matter of opinion. Some people, like yourself, might want the
> interface and all it's stats to completely disappear. Others might want it to
> remain, so that cumulative stats for a particular interface can be graphed.
>
> TG> I see a known_missing flag indicating the interface is not to be found
> TG> anymore. That flag seems to be set after I remove the interface using
> TG> 'vconfig rem.' It is not set when the vlan interface is down.
>
> Right. So, if you would like to come up with a patch that optionally remove
> the
> interface in that case, it could be considered for a future release.
>
------------------------------------------------------------------------------
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders