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

Try to use snmpfwd converting v1 to v2c but it is not working #18

Closed
almendes opened this issue Aug 30, 2017 · 6 comments
Closed

Try to use snmpfwd converting v1 to v2c but it is not working #18

almendes opened this issue Aug 30, 2017 · 6 comments
Labels

Comments

@almendes
Copy link

This is the error that I got when I try to use snmpfwd to convert from v1 to v2c ...


2017-08-29 12:14:43,758 ERROR poll error: Traceback (most recent call last):
; File "/usr/local/lib/python2.7/dist-packages/pysnmp/carrier/asyncore/dispatch.py", line 46, in runDispatcher
use_poll=True, map=self.__sockMap, count=1)
; File "/usr/lib/python2.7/asyncore.py", line 220, in loop
poll_fun(timeout, map)
; File "/usr/lib/python2.7/asyncore.py", line 201, in poll2
readwrite(obj, flags)
; File "/usr/lib/python2.7/asyncore.py", line 123, in readwrite
obj.handle_error()
; File "/usr/lib/python2.7/asyncore.py", line 108, in readwrite
obj.handle_read_event()
; File "/usr/lib/python2.7/asyncore.py", line 449, in handle_read_event
self.handle_read()
; File "/usr/local/lib/python2.7/dist-packages/pysnmp/carrier/asyncore/dgram/base.py", line 163, in handle_read
self._cbFun(self, transportAddress, incomingMessage)
; File "/usr/local/lib/python2.7/dist-packages/pysnmp/carrier/base.py", line 70, in _cbFun
self, transportDomain, transportAddress, incomingMessage
; File "/usr/local/lib/python2.7/dist-packages/pysnmp/entity/engine.py", line 152, in __receiveMessageCbFun
self, transportDomain, transportAddress, wholeMsg
; File "/usr/local/lib/python2.7/dist-packages/pysnmp/proto/rfc3412.py", line 420, in receiveMessage
pdu=PDU)
; File "/usr/local/lib/python2.7/dist-packages/pysnmp/entity/observer.py", line 56, in storeExecutionContext
cbFun(snmpEngine, execpoint, variables, self.__contexts[cbFun])
; File "/usr/local/bin/snmpfwd-server.py", line 418, in requestObserver
'|'.join([str(x[0]) for x in apiPDU.getVarBinds(variables['pdu'])])]
; File "/usr/local/lib/python2.7/dist-packages/pysnmp/proto/api/v1.py", line 119, in getVarBinds
return [apiVarBind.getOIDVal(varBind) for varBind in pdu.getComponentByPosition(3)]
;TypeError: 'Integer' object is not iterable

Below I copied the configuration file used during this test.

SNMP TRAP forwarder: Manager part configuration

config-version: 2
program-name: snmpfwd-server

snmp-credentials-group {
snmp-transport-domain: 1.3.6.1.6.1.1.100
snmp-bind-address: 127.0.0.1:1234

snmp-engine-id: 0x0102030405070809

snmp-community-name: Ik0n0graf1c0
snmp-security-name: Ik0n0graf1c0

snmp-security-model: 1
snmp-security-level: 1

snmp-credentials-id: snmp-credentials
}

context-group {
snmp-context-engine-id-pattern: .?
snmp-context-name-pattern: .
?

snmp-context-id: any-context
}

content-group {
snmp-pdu-type-pattern: (TRAPv1|TRAPv2)
snmp-pdu-oid-prefix-pattern-list: .*?

snmp-content-id: trap-content
}

peers-group {
snmp-transport-domain: 1.3.6.1.6.1.1.100
snmp-bind-address-pattern-list: .?
snmp-peer-address-pattern-list: .
?

snmp-peer-id: 100
}

trunking-group {
trunk-bind-address: 127.0.0.1
trunk-peer-address: 127.0.0.1:30301
trunk-ping-period: 60
trunk-connection-mode: client

trunk-id: trunk-1
}

routing-map {
matching-snmp-credentials-id-list: snmp-credentials
matching-snmp-context-id-list: any-context
matching-snmp-content-id-list: trap-content
matching-snmp-peer-id-list: 100

using-trunk-id-list: trunk-1
}

Could you help me any how ?

@etingof
Copy link
Owner

etingof commented Aug 30, 2017

Thank you for your report!

It would be helpful if you could re-run the crashing tool with debugging enabled (--debug-snmp=msgproc,secmod,io,dsp) and attach the debugging output to this issue.

@almendes
Copy link
Author

almendes commented Aug 30, 2017 via email

@etingof
Copy link
Owner

etingof commented Aug 30, 2017

I believe this issue has been fixed in current master. I'd appreciate you testing it. Thanks!

@almendes
Copy link
Author

almendes commented Aug 31, 2017 via email

@etingof
Copy link
Owner

etingof commented Aug 31, 2017

You can pip install right from GitHub repo.
Or download .zip and install it locally.
Or clone (or fork->clone) the repo and install from there.

@almendes
Copy link
Author

almendes commented Aug 31, 2017 via email

@etingof etingof closed this as completed Sep 5, 2017
@etingof etingof added the bug label Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants