Re: Using and loading MIBS
gday vw <[email protected]> Sat, 16 Nov 2024 11:15:40 +1100
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <CADPbiLOdKNWfd6vQt+VX83irfmm7o5488+TpArNysogwOkogow@mail.gmail.com> |
--===============8928959029849480406== Content-Type: multipart/alternative; boundary="000000000000040bf90626fc961d" --000000000000040bf90626fc961d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, I have unpacked all of the net-snmp-5.9.4\mibs\ files as recommended to /usr/share/snmp/mibs The example in the Wiki now works zen@debian11-DR6:~$ snmptranslate -m +CISCO-RHINO-MIB -IR -On ciscoLS1010ChassisFanLed .1.3.6.1.4.1.9.5.11.1.1.12 However when I try to query any of the entries in the UI-UniFi-MIB file I'm still getting errors. zen@debian11-DR6:~$ snmptranslate -m +UI-UniFi-MIB -IR -On unifiIfIp MIB search path: /home/zen/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/sh= are/snmp/mibs/ietf Cannot find module (UI-UniFi-MIB): At line 1 in (none) Unknown object identifier: unifiIfIp The UI-UniFi-MIB file is in the above folder along with all the other MIB files, so the "Cannot find module" is misleading. The MIB file is there, I'm still doing something wrong. At least I'm making progress. Thanks for the assistance. On Thu, Nov 14, 2024 at 7:31=E2=80=AFPM Lee <[email protected]> wrote: > Hi, > > On Tue, Nov 12, 2024 at 7:16=E2=80=AFPM gday vw wrote: > > > > Hello, > > > > I'm an SNMP newbie and I'm trying to follow this tutorial. > > > > > http://www.net-snmp.org/wiki/index.php/TUT:Using_and_loading_MIBS#Net-SNM= P_Command_Line_Applications > > > > OS is Debian > > zen@debian11-DR6:~$ cat /proc/version > > Linux version 5.10.0-33-amd64 ([email protected]) (gcc-10 > (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.= 2) > #1 SMP Debian 5.10.226-1 (2024-10-03) > > > > Command and output > > zen@debian11-DR6:~$ snmptranslate -m +UI-UniFi-MIB -IR -On unifiApSyste= m > > MIB search path: > /home/zen/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/= share/snmp/mibs/ietf > > Cannot find module (SNMPv2-MIB): At line 1 in (none) > > Cannot find module (IF-MIB): At line 1 in (none) > > Cannot find module (IP-MIB): At line 1 in (none) > > OK, that's enough. It looks like you're missing a _lot_ of MIB files, > so download the latest net-snmp tarball > > https://sourceforge.net/projects/net-snmp/files/net-snmp/5.9.4/net-snmp-5= .9.4.tar.gz/download > and unpack all of the net-snmp-5.9.4\mibs\ files. > > I put everything into /usr/local/share/snmp/mibs you can put them > there, /usr/share/snmp/mibs or wherever.. > In any case you should have something that looks like > > $ ls /usr/local/share/snmp/mibs > EtherLike-MIB.txt SNMP-COMMUNITY-MIB.txt > HCNUM-TC.txt SNMP-FRAMEWORK-MIB.txt > HOST-RESOURCES-MIB.txt SNMP-MPD-MIB.txt > HOST-RESOURCES-TYPES.txt SNMP-NOTIFICATION-MIB.txt > IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt SNMP-PROXY-MIB.txt > IANA-LANGUAGE-MIB.txt SNMP-TARGET-MIB.txt > IANAifType-MIB.txt SNMP-USER-BASED-SM-MIB.txt > IF-INVERTED-STACK-MIB.txt SNMP-USM-AES-MIB.txt > IF-MIB.my SNMP-USM-DH-OBJECTS-MIB.txt > INET-ADDRESS-MIB.txt SNMP-VIEW-BASED-ACM-MIB.txt > IP-FORWARD-MIB.txt SNMPv2-CONF.txt > IP-MIB.txt SNMPv2-MIB.txt > IPV6-FLOW-LABEL-MIB.txt SNMPv2-SMI.txt > IPV6-ICMP-MIB.txt SNMPv2-TC.txt > IPV6-TCP-MIB.txt SNMPv2-TM.txt > IPV6-UDP-MIB.txt TCP-MIB.txt > NOTIFICATION-LOG-MIB.txt TRANSPORT-ADDRESS-MIB.txt > RFC1155-SMI.txt TUNNEL-MIB.txt > RFC1213-MIB.my UCD-SNMP-MIB.txt > RFC1215.txt UDP-MIB.txt > RFC1271.MIB V2ADMIN.txt > RFC2496.MIB cisco > RMON-MIB.txt netgate > SCTP-MIB.txt tplink > > Note that cisco, netgate and tplink are subdirectories. I keep vendor > specific mib files there. > > $ env | grep -i mib > MIBS=3DALL > > MIBDIRS=3D/usr/local/share/snmp/mibs:/usr/local/share/snmp/mibs/cisco:/us= r/local/share/snmp/mibs/netgate:/usr/local/share/snmp/mibs/tplink > > $ snmptranslate -IR -On ifDescr > .1.3.6.1.2.1.2.2.1.2 > > $ snmptranslate .1.3.6.1.2.1.2.2.1.2 > RFC1213-MIB::ifDescr > > $ snmpwalk librarysw ifDesc > RFC1213-MIB::ifDescr.2 =3D STRING: "Vlan-interface2" > RFC1213-MIB::ifDescr.49153 =3D STRING: "gigabitEthernet 1/0/1" > RFC1213-MIB::ifDescr.49154 =3D STRING: "gigabitEthernet 1/0/2" > RFC1213-MIB::ifDescr.49155 =3D STRING: "gigabitEthernet 1/0/3" > RFC1213-MIB::ifDescr.49156 =3D STRING: "gigabitEthernet 1/0/4" > RFC1213-MIB::ifDescr.49157 =3D STRING: "gigabitEthernet 1/0/5" > RFC1213-MIB::ifDescr.49158 =3D STRING: "gigabitEthernet 1/0/6" > RFC1213-MIB::ifDescr.49159 =3D STRING: "gigabitEthernet 1/0/7" > RFC1213-MIB::ifDescr.49160 =3D STRING: "gigabitEthernet 1/0/8" > RFC1213-MIB::ifDescr.49161 =3D STRING: "gigabitEthernet 1/0/9" > RFC1213-MIB::ifDescr.49162 =3D STRING: "gigabitEthernet 1/0/10" > RFC1213-MIB::ifDescr.49163 =3D STRING: "gigabitEthernet 1/0/11" > RFC1213-MIB::ifDescr.49164 =3D STRING: "gigabitEthernet 1/0/12" > RFC1213-MIB::ifDescr.49165 =3D STRING: "gigabitEthernet 1/0/13" > RFC1213-MIB::ifDescr.49166 =3D STRING: "gigabitEthernet 1/0/14" > RFC1213-MIB::ifDescr.49167 =3D STRING: "gigabitEthernet 1/0/15" > RFC1213-MIB::ifDescr.49168 =3D STRING: "gigabitEthernet 1/0/16" > RFC1213-MIB::ifDescr.49169 =3D STRING: "gigabitEthernet 1/0/17" > RFC1213-MIB::ifDescr.49170 =3D STRING: "gigabitEthernet 1/0/18" > RFC1213-MIB::ifDescr.49171 =3D STRING: "gigabitEthernet 1/0/19" > RFC1213-MIB::ifDescr.49172 =3D STRING: "gigabitEthernet 1/0/20" > RFC1213-MIB::ifDescr.49173 =3D STRING: "gigabitEthernet 1/0/21" > RFC1213-MIB::ifDescr.49174 =3D STRING: "gigabitEthernet 1/0/22" > RFC1213-MIB::ifDescr.49175 =3D STRING: "gigabitEthernet 1/0/23" > RFC1213-MIB::ifDescr.49176 =3D STRING: "gigabitEthernet 1/0/24" > RFC1213-MIB::ifDescr.49177 =3D STRING: "gigabitEthernet 1/0/25" > RFC1213-MIB::ifDescr.49178 =3D STRING: "gigabitEthernet 1/0/26" > RFC1213-MIB::ifDescr.49179 =3D STRING: "gigabitEthernet 1/0/27" > RFC1213-MIB::ifDescr.49180 =3D STRING: "gigabitEthernet 1/0/28" > > Hope that helps, > Lee > --000000000000040bf90626fc961d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hello,<div><br></div><div>I have unpacked <span style=3D"f= ont-family:Aptos,sans-serif;font-size:11pt">all of the net-snmp-5.9.4\mibs\= files as recommended to /usr/share/snmp/mibs</span></div><div><span style= =3D"font-family:Aptos,sans-serif;font-size:11pt"><br></span></div><div><spa= n style=3D"font-family:Aptos,sans-serif;font-size:11pt">The example in the = Wiki now works</span></div><div>zen@debian11-DR6:~$ snmptranslate -m +CISCO= -RHINO-MIB -IR -On ciscoLS1010ChassisFanLed<br>.1.3.6.1.4.1.9.5.11.1.1.12<s= pan style=3D"font-family:Aptos,sans-serif;font-size:11pt"></span></div><div= ><br></div><div>However when I try to query any of the entries in the UI-Un= iFi-MIB file I'm still getting errors.=C2=A0</div><div>zen@debian11-DR6= :~$ snmptranslate -m +UI-UniFi-MIB -IR -On unifiIfIp<br>MIB search path: /h= ome/zen/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/shar= e/snmp/mibs/ietf<br>Cannot find module (UI-UniFi-MIB): At line 1 in (none)<= br>Unknown object identifier: unifiIfIp<br></div><div><br></div><div>The UI= -UniFi-MIB file is in the above folder along with all the other MIB files, = so the "Cannot find module" is misleading. The MIB file is there,= I'm still doing something wrong.</div><div><br></div><div>At least I&#= 39;m making progress.</div><div><br></div><div>Thanks for the assistance.= =C2=A0</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"= gmail_attr">On Thu, Nov 14, 2024 at 7:31=E2=80=AFPM Lee <<a href=3D"mail= to:[email protected]">[email protected]</a>> wrote:<br></div><blockquote c= lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli= d rgb(204,204,204);padding-left:1ex">Hi,<br> <br> On Tue, Nov 12, 2024 at 7:16=E2=80=AFPM gday vw wrote:<br> ><br> > Hello,<br> ><br> > I'm an SNMP newbie and I'm trying to follow this tutorial.<br> ><br> > <a href=3D"http://www.net-snmp.org/wiki/index.php/TUT:Using_and_loadin= g_MIBS#Net-SNMP_Command_Line_Applications" rel=3D"noreferrer" target=3D"_bl= ank">http://www.net-snmp.org/wiki/index.php/TUT:Using_and_loading_MIBS#Net-= SNMP_Command_Line_Applications</a><br> ><br> > OS is Debian<br> > zen@debian11-DR6:~$ cat /proc/version<br> > Linux version 5.10.0-33-amd64 (<a href=3D"mailto:[email protected]= ebian.org" target=3D"_blank">[email protected]</a>) (gcc-10 (D= ebian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #= 1 SMP Debian 5.10.226-1 (2024-10-03)<br> ><br> > Command and output<br> > zen@debian11-DR6:~$ snmptranslate -m +UI-UniFi-MIB -IR -On unifiApSyst= em<br> > MIB search path: /home/zen/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/= snmp/mibs/iana:/usr/share/snmp/mibs/ietf<br> > Cannot find module (SNMPv2-MIB): At line 1 in (none)<br> > Cannot find module (IF-MIB): At line 1 in (none)<br> > Cannot find module (IP-MIB): At line 1 in (none)<br> <br> OK, that's enough.=C2=A0 It looks like you're missing a _lot_ of MI= B files,<br> so download the latest net-snmp tarball<br> =C2=A0 <a href=3D"https://sourceforge.net/projects/net-snmp/files/net-snmp/= 5.9.4/net-snmp-5.9.4.tar.gz/download" rel=3D"noreferrer" target=3D"_blank">= https://sourceforge.net/projects/net-snmp/files/net-snmp/5.9.4/net-snmp-5.9= .4.tar.gz/download</a><br> and unpack all of the net-snmp-5.9.4\mibs\ files.<br> <br> I put everything into=C2=A0 /usr/local/share/snmp/mibs=C2=A0 you can put th= em<br> there, /usr/share/snmp/mibs or wherever..<br> In any case you should have something that looks like<br> <br> $ ls /usr/local/share/snmp/mibs<br> EtherLike-MIB.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 SNMP-COMMUNITY-MIB.txt<br> HCNUM-TC.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0SNMP-FRAMEWORK-MIB.txt<br> HOST-RESOURCES-MIB.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0SNMP-MPD-MIB.txt<br> HOST-RESOURCES-TYPES.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SNM= P-NOTIFICATION-MIB.txt<br> IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt=C2=A0 SNMP-PROXY-MIB.txt<br> IANA-LANGUAGE-MIB.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 SNMP-TARGET-MIB.txt<br> IANAifType-MIB.txt=C2=A0 =C2=A0 =C2=A0 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FICATION-LOG-MIB.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TRA= NSPORT-ADDRESS-MIB.txt<br> RFC1155-SMI.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 TUNNEL-MIB.txt<br> RFC1213-MIB.my=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0UCD-SNMP-MIB.txt<br> RFC1215.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 UDP-MIB.txt<br> RFC1271.MIB=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 V2ADMIN.txt<br> RFC2496.MIB=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 cisco<br> RMON-MIB.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0netgate<br> SCTP-MIB.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0tplink<br> <br> Note that cisco, netgate and tplink are subdirectories.=C2=A0 I keep vendor= <br> specific mib files there.<br> <br> $ env | grep -i mib<br> MIBS=3DALL<br> MIBDIRS=3D/usr/local/share/snmp/mibs:/usr/local/share/snmp/mibs/cisco:/usr/= local/share/snmp/mibs/netgate:/usr/local/share/snmp/mibs/tplink<br> <br> $ snmptranslate -IR -On ifDescr<br> .1.3.6.1.2.1.2.2.1.2<br> <br> $ snmptranslate .1.3.6.1.2.1.2.2.1.2<br> RFC1213-MIB::ifDescr<br> <br> $ snmpwalk librarysw ifDesc<br> RFC1213-MIB::ifDescr.2 =3D STRING: "Vlan-interface2"<br> RFC1213-MIB::ifDescr.49153 =3D STRING: "gigabitEthernet 1/0/1"<br= > RFC1213-MIB::ifDescr.49154 =3D STRING: "gigabitEthernet 1/0/2"<br= > RFC1213-MIB::ifDescr.49155 =3D STRING: "gigabitEthernet 1/0/3"<br= > RFC1213-MIB::ifDescr.49156 =3D STRING: "gigabitEthernet 1/0/4"<br= > RFC1213-MIB::ifDescr.49157 =3D STRING: "gigabitEthernet 1/0/5"<br= > RFC1213-MIB::ifDescr.49158 =3D STRING: "gigabitEthernet 1/0/6"<br= > RFC1213-MIB::ifDescr.49159 =3D STRING: "gigabitEthernet 1/0/7"<br= > RFC1213-MIB::ifDescr.49160 =3D STRING: "gigabitEthernet 1/0/8"<br= > RFC1213-MIB::ifDescr.49161 =3D STRING: "gigabitEthernet 1/0/9"<br= > RFC1213-MIB::ifDescr.49162 =3D STRING: "gigabitEthernet 1/0/10"<b= r> RFC1213-MIB::ifDescr.49163 =3D STRING: "gigabitEthernet 1/0/11"<b= r> RFC1213-MIB::ifDescr.49164 =3D STRING: "gigabitEthernet 1/0/12"<b= r> RFC1213-MIB::ifDescr.49165 =3D STRING: "gigabitEthernet 1/0/13"<b= r> RFC1213-MIB::ifDescr.49166 =3D STRING: "gigabitEthernet 1/0/14"<b= r> RFC1213-MIB::ifDescr.49167 =3D STRING: "gigabitEthernet 1/0/15"<b= r> RFC1213-MIB::ifDescr.49168 =3D STRING: "gigabitEthernet 1/0/16"<b= r> RFC1213-MIB::ifDescr.49169 =3D STRING: "gigabitEthernet 1/0/17"<b= r> RFC1213-MIB::ifDescr.49170 =3D STRING: "gigabitEthernet 1/0/18"<b= r> RFC1213-MIB::ifDescr.49171 =3D STRING: "gigabitEthernet 1/0/19"<b= r> RFC1213-MIB::ifDescr.49172 =3D STRING: "gigabitEthernet 1/0/20"<b= r> RFC1213-MIB::ifDescr.49173 =3D STRING: "gigabitEthernet 1/0/21"<b= r> RFC1213-MIB::ifDescr.49174 =3D STRING: "gigabitEthernet 1/0/22"<b= r> RFC1213-MIB::ifDescr.49175 =3D STRING: "gigabitEthernet 1/0/23"<b= r> RFC1213-MIB::ifDescr.49176 =3D STRING: "gigabitEthernet 1/0/24"<b= r> RFC1213-MIB::ifDescr.49177 =3D STRING: "gigabitEthernet 1/0/25"<b= r> RFC1213-MIB::ifDescr.49178 =3D STRING: "gigabitEthernet 1/0/26"<b= r> RFC1213-MIB::ifDescr.49179 =3D STRING: "gigabitEthernet 1/0/27"<b= r> RFC1213-MIB::ifDescr.49180 =3D STRING: "gigabitEthernet 1/0/28"<b= r> <br> Hope that helps,<br> Lee<br> </blockquote></div> --000000000000040bf90626fc961d-- --===============8928959029849480406== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============8928959029849480406== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users --===============8928959029849480406==--