Page 1 of 5

MIBS problem

Posted: Tue May 21, 2013 7:59 am
by MPIvan
Hi all

sorry for opening similar posts but i think that this topic should have separate post.

Here is what i think more of us have this kind of problems. Im using Ubuntu server 12.04 LTS and I was following the tutorial of NET-SNMP and i have this errors and problems that i can't figure out what is going on and what is the problem ... so if you can gave me some hints or help me to solve this arrogant problem :evil: i will be very thankful !
here is the problems and errors i have ....
root@nagios:/usr/share/mibs/netsnmp# net-snmp-config --default-mibdirs
/root/.snmp/mibs:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
root@nagios:/usr/share/mibs/netsnmp#

root@nagios:/usr/share/mibs/netsnmp# snmptranslate -Dinit_mib .1.3 2>&1 |grep MIBDIR
init_mib: Seen MIBDIRS: Looking in '/root/.snmp/mibs:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp' for mib dirs ...
root@nagios:/usr/share/mibs/netsnmp#
root@nagios:/usr/share/mibs/netsnmp# snmptranslate .1.3.6.1.2.1.1.3.0
No log handling enabled - turning on stderr logging
MIB search path: /root/.snmp/mibs:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
Cannot find module (sysUpTime): At line 0 in (none)
iso.3.6.1.2.1.1.3.0
root@nagios:/usr/share/mibs/netsnmp#
in more cases i have this error about MIB search path ... and in the first paragraph i can't understand tha MIBS path that i get from the "net-snmp-config --default-mibdirs" command. Because when i try to find the MIBS i have this
root@nagios:/usr/share/mibs/netsnmp# find / -name mibs
/usr/share/mibs
/usr/share/snmp/snmpconf-data/snmp-data/mibs
/var/lib/mibs
root@nagios:/usr/share/mibs/netsnmp#
and this lines i can't understand ....
No log handling enabled - turning on stderr logging
MIB search path: /root/.snmp/mibs:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
Cannot find module (sysUpTime): At line 0 in (none)
iso.3.6.1.2.1.1.3.0

/root/.snmp/mibs:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp

Re: MIBS problem

Posted: Tue May 21, 2013 3:21 pm
by sreinhardt
Hmm so it seems that snmptranslate is looking in paths that either do not exist or are not default paths for mib placement in ubuntu. Have you tried symlinking one of the non existing directories to one that ubuntu uses?

Re: MIBS problem

Posted: Wed May 22, 2013 3:24 am
by MPIvan
Hi sreinhardt,

Paths like exist
/usr/share/mibs/iana
/usr/share/mibs/ietf
/usr/share/mibs/netsnmp
other paths does not exist ... like
/root/.snmp/mibs:/usr/share/mibs/site:/usr/share/snmp/mibs:
no i dont have try symlinking ... what to do exactly with that, what can i do wit it and what is the difference ... and if i use symlinking some script may work or not ?

Re: MIBS problem

Posted: Wed May 22, 2013 3:17 pm
by sreinhardt
well considering you would want this to run as nagios you would really want /home/nagios/.snmp/mibs. However lets start by listing the existing directories and seeing what we find. Symlinking is a common practice in Linux that allows you to create a link in one folder to another actual folder. This allows you to appear to duplicate files and information without taking up more space.

Code: Select all

ls -la /usr/share/mibs/iana
ls -la /usr/share/mibs/ietf
ls -la /usr/share/mibs/netsnmp

Re: MIBS problem

Posted: Thu May 23, 2013 1:22 am
by MPIvan
Hi.
here is the output of

Code: Select all

ls -la /usr/share/mibs/iana
ls -la /usr/share/mibs/ietf
ls -la /usr/share/mibs/netsnmp
root@nagios:~# ls -la /usr/share/mibs/iana
lrwxrwxrwx 1 root root 18 Jun 7 2010 /usr/share/mibs/iana -> /var/lib/mibs/ian a
root@nagios:~# ls -la /usr/share/mibs/ietf
lrwxrwxrwx 1 root root 18 Jun 7 2010 /usr/share/mibs/ietf -> /var/lib/mibs/ietf
root@nagios:~# ls -la /usr/share/mibs/netsnmp
total 432
drwxr-xr-x 2 root root 4096 May 21 13:44 .
drwxr-xr-x 3 root root 4096 Mar 22 12:57 ..
-rw-r--r-- 1 root root 65860 May 21 13:44 CISCO-RHINO-MIB.my
-rw-r--r-- 1 root root 1913 May 23 2012 GNOME-SMI
-rw-r--r-- 1 root root 25042 May 9 2006 IANAifType-MIB.my
-rw-r--r-- 1 root root 686 May 21 13:46 .index
-rw-r--r-- 1 root root 5931 May 23 2012 LM-SENSORS-MIB
-rw-r--r-- 1 root root 15901 May 23 2012 NET-SNMP-AGENT-MIB
-rw-r--r-- 1 root root 9160 May 23 2012 NET-SNMP-EXAMPLES-MIB
-rw-r--r-- 1 root root 9326 May 23 2012 NET-SNMP-EXTEND-MIB
-rw-r--r-- 1 root root 2036 May 23 2012 NET-SNMP-MIB
-rw-r--r-- 1 root root 1215 May 23 2012 NET-SNMP-MONITOR-MIB
-rw-r--r-- 1 root root 3350 May 23 2012 NET-SNMP-PASS-MIB
-rw-r--r-- 1 root root 1226 May 23 2012 NET-SNMP-SYSTEM-MIB
-rw-r--r-- 1 root root 4495 May 23 2012 NET-SNMP-TC
-rw-r--r-- 1 root root 5039 May 23 2012 NET-SNMP-VACM-MIB
-rw-r--r-- 1 root root 102081 Jun 25 1999 RFC1213-MIB.my
-rw-r--r-- 1 root root 31946 Mar 2 2007 SNMPv2-MIB.my
-rw-r--r-- 1 root root 1349 Jun 25 1999 SNMPv2-SMI.my
-rw-r--r-- 1 root root 35185 Sep 22 2009 SNMPv2-TC.my
-rw-r--r-- 1 root root 2163 May 23 2012 UCD-DEMO-MIB
-rw-r--r-- 1 root root 4613 May 23 2012 UCD-DISKIO-MIB
-rw-r--r-- 1 root root 3087 May 23 2012 UCD-DLMOD-MIB
-rw-r--r-- 1 root root 8118 May 23 2012 UCD-IPFWACC-MIB
-rw-r--r-- 1 root root 44971 May 23 2012 UCD-SNMP-MIB
root@nagios:~#

Re: MIBS problem

Posted: Thu May 23, 2013 1:53 pm
by sreinhardt
OK so /usr/share/mibs/netsnmpp looks like the folder to place mibs in and it seems that at least for testing, your permissions are fine. Lets try a grep through your existing mibs to see if they contain the oids you have been looking for.

Code: Select all

cd /usr/share/mibs/netsnmp
grep -i 'iso.3.6.1.2.1.1.3.0' ./*
grep -i '.1.3.6.1.2.1.1.3.0' ./*
grep -i 'sysUpTime' ./*

Re: MIBS problem

Posted: Wed May 29, 2013 7:41 am
by MPIvan
hi sorry for late reply we have some holiday's ....any way here is the output of what you tell me to do ...
root@nagios:~# cd /usr/share/mibs/netsnmp
root@nagios:/usr/share/mibs/netsnmp# grep -i 'iso.3.6.1.2.1.1.3.0' ./*
root@nagios:/usr/share/mibs/netsnmp# grep -i '.1.3.6.1.2.1.1.3.0' ./*
root@nagios:/usr/share/mibs/netsnmp# grep -i 'sysUpTime' ./*
./RFC1213-MIB.my: sysUpTime OBJECT-TYPE
./RFC1213-MIB.my: "The value of sysUpTime at the time the interface
./SNMPv2-MIB.my: sysUpTime OBJECT-TYPE
./SNMPv2-MIB.my: "The value of sysUpTime at the time of the most recent
./SNMPv2-MIB.my: "The value of sysUpTime at the time this conceptual
./SNMPv2-MIB.my: OBJECTS { sysDescr, sysObjectID, sysUpTime,
./SNMPv2-TC.my: "The value of the sysUpTime object at which a specific
root@nagios:/usr/share/mibs/netsnmp#

Re: MIBS problem

Posted: Thu May 30, 2013 9:45 am
by sreinhardt
OK, so you do have the sysUpTime short name for oid .1.3.6.1.2.1.1.3, however you are adding an additional 0 to the end which for my mibs gois to a DISMAN-EVENT-MIB that I do not see listed in your mib directory listing. Also note how none of the oid numerical greps resulted in anything. Just to verify 100% snmptranslate sees sysUpTime try this:

Code: Select all

 snmptranslate .1.3.6.1.2.1.1.3
Should return something like:
SNMPv2-MIB::sysUpTime

Re: MIBS problem

Posted: Thu Jun 06, 2013 10:36 am
by MPIvan
Hi sreinhardt, sorry again for late reply but we making some big changes here and we try to get in line, any how here is the output of what you ask me to do ....
root@nagios:~# snmptranslate .1.3.6.1.2.1.1.3
No log handling enabled - turning on stderr logging
MIB search path: /root/.snmp/mibs:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
Cannot find module (sysUpTime): At line 0 in (none)
iso.3.6.1.2.1.1.3
root@nagios:~#
so what do you suggests to do next ?

Re: MIBS problem

Posted: Thu Jun 06, 2013 2:31 pm
by abrist
Weird. What is the output for:

Code: Select all

snmptranslate .1.3.6.1.2.1.1.3 -m /usr/share/snmp/mibs/SNMPv2-MIB.my