Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error executing snmpwalk.py -v 2c -c public 172.16.1.22 1.2.840.10006.300.43.1.2.1.1.13 #182

Open
ghost opened this issue Aug 2, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 2, 2018

While it is working with:
snmpwalk -v 2c -c public 172.16.1.22 1.2.840.10006.300.43.1.2.1.1.13
output:
iso.2.840.10006.300.43.1.2.1.1.13.436207616 = INTEGER: 369098753
iso.2.840.10006.300.43.1.2.1.1.13.436211712 = INTEGER: 369098753
iso.2.840.10006.300.43.1.2.1.1.13.436215808 = INTEGER: 369098771
iso.2.840.10006.300.43.1.2.1.1.13.436228096 = INTEGER: 369098831
iso.2.840.10006.300.43.1.2.1.1.13.436232192 = INTEGER: 369098769
iso.2.840.10006.300.43.1.2.1.1.13.436260864 = INTEGER: 369098761
iso.2.840.10006.300.43.1.2.1.1.13.436264960 = INTEGER: 369098761
iso.2.840.10006.300.43.1.2.1.1.13.436281344 = INTEGER: 369098755
iso.2.840.10006.300.43.1.2.1.1.13.436285440 = INTEGER: 369098755
iso.2.840.10006.300.43.1.2.1.1.13.436305920 = INTEGER: 369098851
iso.2.840.10006.300.43.1.2.1.1.13.436310016 = INTEGER: 369098851
iso.2.840.10006.300.43.1.2.1.1.13.436367360 = INTEGER: 369098796
iso.2.840.10006.300.43.1.2.1.1.13.436371456 = INTEGER: 369098796

its giving error with snmpwalk.py as below:

[root@elk-stack ~]# snmpget.py -v 2c -c public 172.16.1.1 .1.0.8802.1.1.2.1.4.1.1.7
Error: poll error: Traceback (most recent call last):
; File "/usr/lib/python2.7/site-packages/pysnmp/carrier/asyncore/dispatch.py", line 46, in runDispatcher
use_poll=True, map=self.__sockMap, count=1)
; File "/usr/lib64/python2.7/asyncore.py", line 220, in loop
poll_fun(timeout, map)
; File "/usr/lib64/python2.7/asyncore.py", line 201, in poll2
readwrite(obj, flags)
; File "/usr/lib64/python2.7/asyncore.py", line 123, in readwrite
obj.handle_error()
; File "/usr/lib64/python2.7/asyncore.py", line 108, in readwrite
obj.handle_read_event()
; File "/usr/lib64/python2.7/asyncore.py", line 449, in handle_read_event
self.handle_read()
; File "/usr/lib/python2.7/site-packages/pysnmp/carrier/asyncore/dgram/base.py", line 163, in handle_read
self._cbFun(self, transportAddress, incomingMessage)
; File "/usr/lib/python2.7/site-packages/pysnmp/carrier/base.py", line 70, in _cbFun
self, transportDomain, transportAddress, incomingMessage
; File "/usr/lib/python2.7/site-packages/pysnmp/entity/engine.py", line 152, in __receiveMessageCbFun
self, transportDomain, transportAddress, wholeMsg
; File "/usr/lib/python2.7/site-packages/pysnmp/proto/rfc3412.py", line 486, in receiveMessage
cachedParams['cbCtx'])
; File "/usr/lib/python2.7/site-packages/pysnmp/entity/rfc3413/cmdgen.py", line 152, in processResponsePdu
cbFun(snmpEngine, origSendRequestHandle, None, PDU, cbCtx)
; File "/usr/lib/python2.7/site-packages/pysnmp/entity/rfc3413/cmdgen.py", line 220, in processResponseVarBinds
PDU and v2c.apiPDU.getVarBinds(PDU) or (), cbCtx)
; File "/usr/bin/snmpget.py", line 66, in cbFun
cbCtx['mibViewController'], oid, val
; File "/usr/lib/python2.7/site-packages/snmpclitools/cli/mibview.py", line 338, in getPrettyOidVal
m, n, s = mibViewController.getNodeLocation(prefix[:-1])
; File "/usr/lib/python2.7/site-packages/pysnmp/smi/view.py", line 290, in getNodeLocation
oid, label, suffix = self.getNodeName(nodeName, modName)
; File "/usr/lib/python2.7/site-packages/pysnmp/smi/view.py", line 241, in getNodeName
oid, label, suffix = self.getNodeNameByDesc(nodeName[0], modName)
; File "/usr/lib/python2.7/site-packages/pyasn1/type/univ.py", line 1154, in getitem
return self._value[i]
;IndexError: tuple index out of range

Usage: /usr/bin/snmpget.py [OPTIONS]
Command-line SNMP tools version 0.6.1, written by Ilya Etingof [email protected]
Foundation libraries: pysmi 0.3.1, pysnmp 4.4.4, pyasn1 0.4.3
Python interpreter: 2.7.5 (default, Jun 24 2015, 00:41:19) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
Software documentation and support at http://snmplabs.com
-h display this help message
-V software release information
-d dump raw packets
-D category enable debugging [mibbuild,all,app,msgproc,proxy,io,secmod,dsp,acl,mibview,mibinstrum]
SNMP message processing options:
-v VERSION SNMP version (1|2c|3)
SNMPv1/v2c security options:
-c COMMUNITY SNMP community string (e.g. public)
SNMPv3 security options:
-u SECURITY-NAME SNMP USM user security name (e.g. bert)
-l SECURITY-LEVEL security level (noAuthNoPriv|authNoPriv|authPriv)
-a AUTH-PROTOCOL authentication protocol ID (MD5|SHA|SHA224|SHA256|SHA384|SHA512)
-A PASSPHRASE authentication protocol pass phrase (8+ chars)
-x PRIV-PROTOCOL privacy protocol ID (3DES|AES|AES128|AES192|AES192BLMT|AES256|AES256BLMT|DES)
-X PASSPHRASE privacy protocol pass phrase (8+ chars)
-E CONTEXT-ENGINE-ID context engine ID (e.g. 800000020109840301)
-e ENGINE-ID security SNMP engine ID (e.g. 800000020109840301)
-n CONTEXT-NAME SNMP context name (e.g. bridge1)
-Z BOOTS,TIME destination SNMP engine boots/time
MIB options:
-m MIB[:...] load given list of MIBs (ALL loads all compiled MIBs)
-M DIR[:...] look in given list of directories for MIBs
-P MIBOPTS Toggle various defaults controlling MIB parsing:
XS: search for ASN.1 MIBs in remote directories specified
in URL form. The @mib@ token in the URL is substituted
with actual MIB to be downloaded. Default repository
address is http://mibs.snmplabs.com/asn1/@mib@
XB: search for pysnmp MIBs in remote directories specified
in URL form. The @mib@ token in the URL is substituted
with actual MIB to be downloaded. Default repository
address is http://mibs.snmplabs.com/pysnmp/fulltexts/@mib@
-O OUTOPTS Toggle various defaults controlling output display:
q: removes the equal sign and type information
Q: removes the type information
f: print full OIDs on output
s: print only last symbolic element of OID
S: print MIB module-id plus last element
u: print OIDs using UCD-style prefix suppression
n: print OIDs numerically
e: print enums numerically
b: do not break OID indexes down
E: include a " to escape the quotes in indices
X: place square brackets around each index
T: print value in hex
v: print values only (not OID = value)
U: don't print units
t: output timeticks values as raw numbers
-I INOPTS Toggle various defaults controlling input parsing:
h: don't apply DISPLAY-HINTs
u: top-level OIDs must have '.' prefix (UCD-style)
General communication options
-r RETRIES number of retries when sending request
-t TIMEOUT request timeout (in seconds)
Agent address:
[:]
transport-domain: (udp|udp6)
transport-endpoint: (IP|IPv6|FQDN[:port])
Management parameters:
[mib-module::]object-name|oid ...
mib-module: MIB name (e.g. SNMPv2-MIB)
object-name: MIB symbol (e.g. sysDescr.0) or OID
[root@elk-stack ~]#

@etingof
Copy link
Owner

etingof commented Aug 2, 2018

Thank you for raising this issue! It looks like a bug, from the first glance...

It would be incredibly helpful if you could provide the debug output from the tool and underlying libs:

 snmpget.py -D all -v 2c -c public 172.16.1.1 .1.0.8802.1.1.2.1.4.1.1.7

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant