Bug 254231 - bsnmpget MIB definition file inconsistency
Summary: bsnmpget MIB definition file inconsistency
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 11.4-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Shteryana Shopova
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-12 06:54 UTC by Michael Proto
Modified: 2023-06-21 18:15 UTC (History)
3 users (show)

See Also:


Attachments
fix for mibII definitions for bsnmpget/walk (318 bytes, patch)
2021-03-12 06:54 UTC, Michael Proto
no flags Details | Diff
updated patch (318 bytes, patch)
2021-03-12 06:57 UTC, Michael Proto
no flags Details | Diff
Proposed final mib-2 patch (1.15 KB, patch)
2022-08-29 08:57 UTC, Shteryana Shopova
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Proto 2021-03-12 06:54:59 UTC
Created attachment 223197 [details]
fix for mibII definitions for bsnmpget/walk

Found an issue when using info-level logging with bsnmpget and bsnmpd. I'm running a local network utilization monitor and found a discrepancy with /usr/share/snmp/defs/mibII_tree.def, what bsnmpget uses to retrieve MIBs. If syslog is set to user.info the following message appears with the default configuration when trying to pull entries referenced in mibII_tree.def:


Mar 12 00:37:07 <user.info> socrates bsnmpget: Matching OIDs with different string mappings: old - mib2, new - mibII


This seems to be because mibII_tree.def lists its MIBs, like the log says, under mib2 and not mibII. Applied the attached patch and I no longer receive these superfluous log messages.



Thanks!
Michael Proto
Comment 1 Michael Proto 2021-03-12 06:57:36 UTC
Created attachment 223198 [details]
updated patch

earlier patch was reversed, this is the correct patch
Comment 2 Michael Proto 2021-03-12 07:15:20 UTC
For reference I was able to expose this by enabling bsnmpd on my system and running locally (after enabling user.info logging via syslogd):

 bsnmpget -p getbulk -s stream::public@ ifName
Comment 3 Bjoern A. Zeeb freebsd_committer freebsd_triage 2022-08-19 17:12:16 UTC
I also just saw this now while debugging a bsnmpget problem.

@syrinx, do you want to check and commit this or should I?
Comment 4 Shteryana Shopova freebsd_committer freebsd_triage 2022-08-29 08:57:45 UTC
Created attachment 236198 [details]
Proposed final mib-2 patch
Comment 5 Shteryana Shopova freebsd_committer freebsd_triage 2022-08-29 08:58:13 UTC
This is an issue we've had for years now, and after looking again at it I would suggest we should follow the standard definition from RFC2578 - 

mib-2          OBJECT IDENTIFIER ::= { mgmt 1 }

and list the definitions under mib-2 . Proposed final patch is in the attachment.
Comment 6 commit-hook freebsd_committer freebsd_triage 2022-12-29 20:03:25 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=4ac8f4067096a9d4a00e41cd53bd5c4fa295fd15

commit 4ac8f4067096a9d4a00e41cd53bd5c4fa295fd15
Author:     Shteryana Shopova <syrinx@FreeBSD.org>
AuthorDate: 2022-12-29 19:52:46 +0000
Commit:     Shteryana Shopova <syrinx@FreeBSD.org>
CommitDate: 2022-12-29 20:02:27 +0000

    Follow the standard object definition from RFC2578
    Use mib-2 throughout the files where applicable

    PR:             254231
    Reported by:    Michael Proto
    Reviewed by:    bz (at) FreeBSD (dot) org

 contrib/bsnmp/gensnmptree/gensnmptree.1 | 2 +-
 contrib/bsnmp/snmp_mibII/mibII_tree.def | 2 +-
 contrib/bsnmp/snmpd/tree.def            | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Comment 7 Graham Perrin freebsd_committer freebsd_triage 2023-06-21 01:11:47 UTC
Any more to do here, or can we close this as fixed?

Thanks
Comment 8 Michael Proto 2023-06-21 01:55:29 UTC
Fixed from my perspective.