LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2011, 03:20 AM   #1
lettuce84@naver.com
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Rep: Reputation: 0
how to add MIB (Linux SNMP)


I've got MIB files already under /usr/share/snmp/mibs


-----------------------------------------------------
AGENTX-MIB.txt IPV6-TCP-MIB.txt SNMP-NOTIFICATION-MIB.txt
DISMAN-EVENT-MIB.txt IPV6-UDP-MIB.txt SNMP-PROXY-MIB.txt
DISMAN-SCHEDULE-MIB.txt LM-SENSORS-MIB.txt SNMP-TARGET-MIB.txt
DISMAN-SCRIPT-MIB.txt MTA-MIB.txt SNMP-USER-BASED-SM-MIB.txt
EtherLike-MIB.txt NET-SNMP-AGENT-MIB.txt SNMP-USM-AES-MIB.txt
HCNUM-TC.txt NET-SNMP-EXAMPLES-MIB.txt SNMP-USM-DH-OBJECTS-MIB.txt
HOST-RESOURCES-MIB.txt NET-SNMP-EXTEND-MIB.txt SNMP-VIEW-BASED-ACM-MIB.txt
HOST-RESOURCES-TYPES.txt NET-SNMP-MIB.txt SNMPv2-CONF.txt
IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt NET-SNMP-TC.txt SNMPv2-MIB.txt
IANA-LANGUAGE-MIB.txt NETWORK-SERVICES-MIB.txt SNMPv2-SMI.txt
IANA-RTPROTO-MIB.txt NOTIFICATION-LOG-MIB.txt SNMPv2-TC.txt
IANAifType-MIB.txt RFC-1215.txt SNMPv2-TM.txt
IF-INVERTED-STACK-MIB.txt RFC1155-SMI.txt TCP-MIB.txt
IF-MIB.txt RFC1213-MIB.txt TRANSPORT-ADDRESS-MIB.txt
INET-ADDRESS-MIB.txt RMON-MIB.txt UCD-DEMO-MIB.txt
IP-FORWARD-MIB.txt SCTP-MIB.txt UCD-DISKIO-MIB.txt
IP-MIB.txt SMUX-MIB.txt UCD-DLMOD-MIB.txt
IPV6-ICMP-MIB.txt SNMP-COMMUNITY-MIB.txt UCD-IPFWACC-MIB.txt
IPV6-MIB.txt SNMP-FRAMEWORK-MIB.txt UCD-SNMP-MIB.txt
IPV6-TC.txt SNMP-MPD-MIB.txt UDP-MIB.txt
------------------------------------------------------


but can't get data from other MIB files except SNMPv2-MIB.txt by command

snmpwalk -v 2c -c public localhost mgmt

so I can only get system data..

------------------------------------------------------

SNMPv2-MIB::sysDescr.0 = STRING: Linux SM-VPN 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.8072.3.2.10
SNMPv2-MIB::sysUpTime.0 = Timeticks: (2231571) 6:11:55.71
SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
SNMPv2-MIB::sysName.0 = STRING: SM-VPN
SNMPv2-MIB::sysLocation.0 = STRING: Unknown (edit /etc/snmp/snmpd.conf)
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (8) 0:00:00.08
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.2 = OID: SNMPv2-SMI::mib-2.49
SNMPv2-MIB::sysORID.3 = OID: SNMPv2-SMI::mib-2.4
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-SMI::mib-2.50
SNMPv2-MIB::sysORID.5 = OID: SNMPv2-SMI::snmpModules.16.2.2.1
SNMPv2-MIB::sysORID.6 = OID: SNMPv2-SMI::snmpModules.10.3.1.1
SNMPv2-MIB::sysORID.7 = OID: SNMPv2-SMI::snmpModules.11.3.1.1
SNMPv2-MIB::sysORID.8 = OID: SNMPv2-SMI::snmpModules.15.2.1.1
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.5 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORDescr.6 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.8 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (8) 0:00:00.08
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (8) 0:00:00.08
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (8) 0:00:00.08
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (8) 0:00:00.08
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (8) 0:00:00.08
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (8) 0:00:00.08
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (8) 0:00:00.08
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (8) 0:00:00.08
SNMPv2-SMI::mib-2.25.1.1.0 = Timeticks: (19911749) 2 days, 7:18:37.49
SNMPv2-SMI::mib-2.25.1.1.0 = No more variables left in this MIB View (It is past the end of the MIB tree)
[root@SM-VPN mibs]#


------------------------------------------------------

I think .. need to add or register MIB files to somewhere.

but can't find the way to add MIB to SNMP tree.

Please help me.. T.T

Last edited by lettuce84@naver.com; 03-11-2011 at 03:23 AM.
 
Old 03-11-2011, 08:30 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,493

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
You won't get any smnpwalk output from the MIBS installed on your system. When you do an snmpwalk on localhost, snmpget actually communicates with localhost to retrieve snmp data. The snmpdata is returned from localhost, regardless of the presence of the MIB file. Without MIB file you'd get the same values, but no names in the smnptree, just numbers like 2.3.8.1.3.4.11.5.3.6.2.3.1.1.

Actually, the MIB only translates the numeric strings to meaningful names to make it easy for us humans. Just try it, do a snmpget -v OID, and when you got the numeric address do the same with the numeric address.

MIB files are specified in /etc/snmp/snmp.conf (check snmp.conf and where they are on your system). This is an example:
Code:
mibdirs /usr/share/snmp/mibs/
mibs THALES-SMI:THALES-ECOS2-MIB
Furthermore, if you have reason not to use this conffile, you can specify the MIB on the command line:
Code:
/usr/bin/snmpget -v 2c -m /usr/share/snmp/mibs/VISUS.MIB -c ****** 192.168.xxx.xxx VISUS::visus.hsv.\"RBE_RNW_NLANT:POWER.COMMON:STATUS.FUELLEVEL\"
jlinkels
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SNMP IF-MIB counters Ken Chapman Linux - Networking 11 02-19-2013 01:41 PM
HOW TO MAKE MIB FILE OF SNMP protocol...in linux.... dashang.trivedi Linux - Networking 3 03-09-2011 09:17 AM
MIB and SNMP allomeen Programming 2 01-17-2006 11:23 AM
snmp mib ody1 Programming 0 01-09-2005 10:31 AM
SNMP MIB question arffer Linux - Networking 2 10-30-2000 05:44 PM


All times are GMT -5. The time now is 02:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration