Re: Disable specifc OIDs in MIB

Thommandra Gowtham <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <CA+XNQ=jGG7AnUg8N9kr5V5zkXfN8b3LuMOGFewjzwPXiNDAH5A@mail.gmail.com>
Robert,

Thanks for your reply. More in-line

On Tue, Jul 3, 2018 at 10:01 PM, Robert Story <[email protected]> wrote:

> On Tue, 3 Jul 2018 19:05:59 +0530 Thommandra wrote:
> TG> - How can we disable an OID from snmpwalk output?
>
> For snmpd, you can configure VACM views in snmpd.conf to exclude
> certain OIDS. It's not very intuitive, but should be possible.
>

Can we remove the OIDs at compile time (using configure option) like we do
for modules? Changing VACM views is tedious and has to be configures for
all communities/users etc.
And if the list of OIDs is huge, it is not feasible.


>
> For the client, there isn't a way to not query for something during
> a snmpwalk.
>
> TG> c) Can we disable an entire MIB during compile time? Ex: TCP or
> TG> UDP-MIB
>
> Yes. You can disable MIBs via configure and at run-time.
>

Was able to figure that out. Thanks.


>
> TG> Also,  I see that after moving to 5.7.3 snmpwalk times-out
> TG> after walking the VRRP-MIB though there is data beyond that
> TG> OID. And this is happening always when there is data in
> TG> VrrpOperTable.
>
> We don't implement the VRRP-MIB, so you'll have to check with the
> device vendor. Increasing the timeout may help.
>

Actually I understand that. I went further and enabled debug on snmpgetnext
to find that the failure is due to the error during snmp_parse()
And it is because the getnext PDU contains an IP_ADDR as a value
(vrrpOperMasterIpAddr OID)

On debugging further, I found that the below change in 5.7.3 is actually
causing the issue

net-snmp-5.7.3/snmplib/snmp_api.c

4594         case ASN_IPADDRESS:
4595             if (vp->val_len != 4)
4596                 return -1;
4597             /* fallthrough */
4598         case ASN_OCTET_STR:
4599         case ASN_OPAQUE:
4600         case ASN_NSAP:

We fail if ASN_IPADDRRESS len is not 4. Earlier in 5.7.2, we did not have
this check.

And looking at the history, it seems like you have modified/added those
lines. May I know if this is a bug?
BTW, removing that val_len check from snmp_api.c makes the snmpwalk work
smooth.

Please note that our implementation of VRRP-MIB was done using mib2c
utility. And so vrrpOperMasterIpAddr is implemented as u_long in the code.

Regards,
Gowtham


>
> Robert
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
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.