[질문] snmpwalk는 잘되는데 snmpget이 잘안됩니다
안녕하세요. snmpd를 설치해할 일이 생겨서 Net-snmp-5.2.1을 설치하였습니다. 초짜라 그런지 어려움이 많네요. 고수님들의 도움을 부탁드립니다.
정상적으로 동작한는지 확인을 하려고
snmpget -c omni localhost sysLocation.0
snmpget -c omni localhost system.sysLocation.0
등의 명령을 내려보았는데요
sysLocation.0: Unknown Object Identifier (Sub-id not found: (top) -> sysLocation)
이런식의 메시지가 나옵니다.
snmpwalk -c omni localhost 라고 명령을 내리면
iso.3.6.1.2.1.1.1.0 = STRING: "Linux omniswtest 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10
iso.3.6.1.2.1.1.3.0 = Timeticks: (151694) 0:25:16.94
iso.3.6.1.2.1.1.4.0 = STRING: "Me <me@somewhere.org>"
iso.3.6.1.2.1.1.5.0 = STRING: "omniswtest"
iso.3.6.1.2.1.1.6.0 = STRING: "omnidevice"
iso.3.6.1.2.1.1.8.0 = Timeticks: (1) 0:00:00.01
iso.3.6.1.2.1.1.9.1.2.1 = OID: iso.3.6.1.2.1.31
iso.3.6.1.2.1.1.9.1.2.2 = OID: iso.3.6.1.6.3.1
iso.3.6.1.2.1.1.9.1.2.3 = OID: iso.3.6.1.2.1.49
iso.3.6.1.2.1.1.9.1.2.4 = OID: iso.3.6.1.2.1.4
iso.3.6.1.2.1.1.9.1.2.5 = OID: iso.3.6.1.2.1.50
iso.3.6.1.2.1.1.9.1.2.6 = OID: iso.3.6.1.6.3.16.2.2.1
iso.3.6.1.2.1.1.9.1.2.7 = OID: iso.3.6.1.6.3.10.3.1.1
iso.3.6.1.2.1.1.9.1.2.8 = OID: iso.3.6.1.6.3.11.3.1.1
iso.3.6.1.2.1.1.9.1.2.9 = OID: iso.3.6.1.6.3.15.2.1.1
iso.3.6.1.2.1.1.9.1.3.1 = STRING: "The MIB module to describe generic objects for network interface sub-layers"
iso.3.6.1.2.1.1.9.1.3.2 = STRING: "The MIB module for SNMPv2 entities"
iso.3.6.1.2.1.1.9.1.3.3 = STRING: "The MIB module for managing TCP implementations"
iso.3.6.1.2.1.1.9.1.3.4 = STRING: "The MIB module for managing IP and ICMP implementations"
iso.3.6.1.2.1.1.9.1.3.5 = STRING: "The MIB module for managing UDP implementations"
iso.3.6.1.2.1.1.9.1.3.6 = STRING: "View-based Access Control Model for SNMP."
.
.
.
iso.3.6.1.2.1.11.13.0 = Counter32: 834
iso.3.6.1.2.1.11.14.0 = Counter32: 0
iso.3.6.1.2.1.11.15.0 = Counter32: 0
iso.3.6.1.2.1.11.16.0 = Counter32: 838
iso.3.6.1.2.1.11.17.0 = Counter32: 0
iso.3.6.1.2.1.11.18.0 = Counter32: 0
iso.3.6.1.2.1.11.19.0 = Counter32: 0
iso.3.6.1.2.1.11.20.0 = Counter32: 0
iso.3.6.1.2.1.11.21.0 = Counter32: 0
iso.3.6.1.2.1.11.22.0 = Counter32: 0
iso.3.6.1.2.1.11.24.0 = Counter32: 0
iso.3.6.1.2.1.11.25.0 = Counter32: 0
iso.3.6.1.2.1.11.26.0 = Counter32: 0
iso.3.6.1.2.1.11.27.0 = Counter32: 0
iso.3.6.1.2.1.11.28.0 = Counter32: 848
iso.3.6.1.2.1.11.29.0 = Counter32: 0
iso.3.6.1.2.1.11.30.0 = INTEGER: 2
iso.3.6.1.2.1.11.31.0 = Counter32: 0
iso.3.6.1.2.1.11.32.0 = Counter32: 0
등이 출력됩니다.
제 생각엔 snmpget이 어떤정보와 매핑이 되야 하는것 같다는 생각이 듭니다만....어떤지 잘모르겠습니다.
무엇이 문제일까요?
그럼 좋은하루 되십시요 :)
net-snmp.org에서는 위와 같은 문제에 대해Requesti
net-snmp.org에서는 위와 같은 문제에 대해
Requesting an object fails with "Unknown Object Identifier" Why?
----------------------------------------------------------------
If a general snmpwalk shows the entry, but asking for it more
specifically gives a "sub-identifier not found:" or "Unknown Object
Identifier" error, then that's a problem with the tool, rather than
the agent.
Firstly, make sure that you're asking for the object by the right name.
Object descriptors are case-sensitive, so asking for 'sysuptime' will
not be recognised, but 'sysUpTime' will.
Secondly, the object may be defined in a MIB that hasn't been loaded.
Try loading in all the MIB files:
snmpget -m ALL -v1 -c public localhost sysUpTime.0
(though if snmpwalk displays the object by name, this is unlikely to
be the cause).
Thirdly, earlier versions of the UCD software expected "full" paths
for object names, either based at the root of the whole MIB tree
(".iso.org.dod.internet.mgmt.mib-2.system.sysUpTime") or the 'mib-2'
subtree ("system.sysUpTime"). Try:
snmpget -v1 -c public myhost system.sysUpTime.0
These earlier versions of the tools may take a command-line option '-R'
or '-IR' (depending on vintage) to invoke this "random-access" mode.
Note that snmptranslate still requires "random-access" to be specified
explicitly - all other command tools now use this mode by defaults.
All versions of the UCD and Net-SNMP tools accept the syntax
snmpget -v1 -c public myhost RFC1213-MIB:sysUpTime.0
to denote a particular object in a specific MIB module. Note that this
uses the name of the *module*, not the name of the file. See the second
question in this section for the distinction.
위와 같이 해결책으로 나왔는데요, 다 해봤는데 역시 마찬가지네용
그리고 원격에서 mib browser를 이용해서 접근하며 다 접근이 되네요..
May The Force Be With You
irdeal
에공....패쓰(path)를 잘못잡았었네용.
이것저것 해보다.........원인을 알아냈습니다...패쓰를 잘못잡았네용..
MIBDIRS = /usr/local/share/snmp/mibs 로 고쳐주니까 되는군요..
그럼 좋은하루되세용
May The Force Be With You
irdeal
댓글 달기