Package: snmp-mibs-downloader
Version: 1.6
Severity: wishlist

Hi,

I've been using snmp-mibs-downloader for getting MIB files for my
netgear switch, but I'm running into problems because RFC-1212, RFC-1215
and IANA-ENTITY-MIB are not present.

# RFC-1212 and RFC-1215
Looking at these rfcs, they are a bit different than most others. The
RFC does not contain a full MIB with a "XXX DEFINITIONS ::= BEGIN", but
instead offer a lot of textual advice and examples about how other RFCs
could define their MIBs.

However, these two RFCs do define macros (OBJECT-TYPE and TRAP-TYPE
respectively), that *are* used by other MIBs:

  $ grep -R -B 1 RFC-1215 /usr/share/snmp/mibs
  /usr/share/snmp/mibs/ietf/RFC1382-MIB-        TRAP-TYPE
  /usr/share/snmp/mibs/ietf/RFC1382-MIB:                FROM RFC-1215
  $ grep -R -B 1 RFC-1212 /usr/share/snmp/mibs | head -n 5
  /usr/share/snmp/mibs/ietf/FDDI-SMT73-MIB-        OBJECT-TYPE
  /usr/share/snmp/mibs/ietf/FDDI-SMT73-MIB:            FROM RFC-1212;
  --
  /usr/share/snmp/mibs/ietf/PPP-LCP-MIB-     OBJECT-TYPE
  /usr/share/snmp/mibs/ietf/PPP-LCP-MIB:          FROM RFC-1212;
  (15 more imports omitted)

Also note that one reference is made to RFC1212 instead of RFC-1212 and
since the RFC itself does not define the MIB name, this is not
necessarily incorrect, but the consensus does seem to be to use
RFC-1212:

  $ grep -R FROM.RFC1212 /usr/share/snmp/mibs | wc -l
  1
  $ grep -R FROM.RFC-1212 /usr/share/snmp/mibs | wc -l
  17

See also:

  https://www.rfc-editor.org/rfc/rfc1212.txt
  https://www.rfc-editor.org/rfc/rfc1215.txt

# Adding RFC-1212 and RFC-1215
Adding these to snmp-mibs-downloader might be a bit tricky - because
the relevant definitions are not contained in an "XXX DEFINITIONS ::
BEGIN" block, the current script cannot extract these definitions as-is.

A pragmatic approach to this could be to add a PREDIFF config option
that patches the downloaded RFC file before running smistrip, though
that does require saving the RFC to a file to patch it, it seems that
patch does not support patching stdin: 
https://unix.stackexchange.com/questions/737104/how-to-apply-a-patch-as-part-of-a-pipe-in-other-words-how-to-patch-stdin



# IANA-ENTITY-MIB
In addition to these RFCs, I'm also missing the IANA-ENTITY-MIB,
which is referenced once:

  $ grep -R FROM.IANA-ENTITY-MIB /usr/share/snmp/mibs
  /usr/share/snmp/mibs/ietf/ENTITY-MIB:        FROM IANA-ENTITY-MIB; -- RFC 6933

This one is easy - it is contained in RFC 6933 that also contains
ENTITY-MIB, so this adding IANA-ENTITY-MIB is a matter of editing
rfclist to:

  6933    ENTITY-MIB:IANA-ENTITY-MIB:UUID-TC-MIB

Tried, works.


Thanks,

Matthijs


-- System Information:
Debian Release: trixie/sid
  APT prefers noble
  APT policy: (500, 'noble'), (500, 'mantic-updates'), (500, 
'mantic-security'), (500, 'mantic'), (100, 'mantic-backports'), (50, 
'unstable-debug'), (50, 'testing-debug'), (50, 'oldstable-debug'), (50, 
'unstable'), (50, 'stable'), (50, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.0-44-generic (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages snmp-mibs-downloader depends on:
ii  patch     2.7.6-7build2
ii  smistrip  0.4.8+dfsg2-16
ii  wget      1.21.3-1ubuntu1.1

snmp-mibs-downloader recommends no packages.

Versions of packages snmp-mibs-downloader suggests:
ii  unzip  6.0-28ubuntu1.1

-- Configuration Files:
/etc/snmp-mibs-downloader/rfc.conf changed [not included]
/etc/snmp-mibs-downloader/rfclist changed [not included]

-- no debconf information

Reply via email to