etingof / snmpfwd

SNMP Proxy Forwarder
http://snmplabs.com/snmpfwd/
BSD 2-Clause "Simplified" License
67 stars 18 forks source link

Trying to pack snmpfwd into folder with dependencies #33

Closed elviosebastianelli closed 5 years ago

elviosebastianelli commented 5 years ago

Hi, I'm trying to copy snmpfwd and its dependencies into a folder in a sunos 5.10, but I have problem with crypto.cipher module. Any suggest? Thanks for any help.

Here the folders structure and the error:

Folders structure:

elvio@elv034gen:~/HCW/testcdp$ tree -L 2
.
├── client.conf
├── Crypto
│   ├── Cipher
│   ├── Hash
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── IO
│   ├── pct_warnings.py
│   ├── Protocol
│   ├── PublicKey
│   ├── Random
│   ├── SelfTest
│   ├── Signature
│   └── Util
├── Cryptodome
│   ├── Cipher
│   ├── Hash
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── __init__.pyi
│   ├── IO
│   ├── Math
│   ├── Protocol
│   ├── PublicKey
│   ├── py.typed
│   ├── Random
│   ├── SelfTest
│   ├── Signature
│   └── Util
├── filterplus.conf
├── filterplus.py
├── pyasn1
│   ├── codec
│   ├── compat
│   ├── debug.py
│   ├── debug.pyc
│   ├── error.py
│   ├── error.pyc
│   ├── __init__.py
│   ├── __init__.pyc
│   └── type
├── pysnmp
│   ├── cache.py
│   ├── carrier
│   ├── debug.py
│   ├── debug.pyc
│   ├── entity
│   ├── error.py
│   ├── error.pyc
│   ├── hlapi
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── nextid.py
│   ├── nextid.pyc
│   ├── proto
│   └── smi
├── pysnmpcrypto
│   ├── aes.py
│   ├── des3.py
│   ├── des.py
│   └── __init__.py
├── server.conf
├── snmpfwd
│   ├── cparser.py
│   ├── cparser.pyc
│   ├── daemon.py
│   ├── daemon.pyc
│   ├── endpoint.py
│   ├── endpoint.pyc
│   ├── error.py
│   ├── error.pyc
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── lazylog.py
│   ├── log.py
│   ├── log.pyc
│   ├── macro.py
│   ├── macro.pyc
│   ├── next.py
│   ├── next.pyc
│   ├── plugins
│   └── trunking
├── snmpfwd-client.py
└── snmpfwd-server.py

35 directories, 49 files

Error:

elvio@elv034gen:~/HCW/testcdp$ ./snmpfwd-client.py 
Traceback (most recent call last):
  File "./snmpfwd-client.py", line 38, in <module>
    from snmpfwd.trunking.manager import TrunkingManager
  File "/home/elvio/HCW/testcdp/snmpfwd/trunking/manager.py", line 7, in <module>
    from snmpfwd.trunking import client, server
  File "/home/elvio/HCW/testcdp/snmpfwd/trunking/client.py", line 12, in <module>
    from snmpfwd.trunking import protocol
  File "/home/elvio/HCW/testcdp/snmpfwd/trunking/protocol.py", line 11, in <module>
    from snmpfwd.trunking import crypto
  File "/home/elvio/HCW/testcdp/snmpfwd/trunking/crypto.py", line 8, in <module>
    from Cryptodome.Cipher import AES
  File "/home/elvio/HCW/testcdp/Cryptodome/Cipher/__init__.py", line 27, in <module>
    from Crypto.Cipher._mode_ecb import _create_ecb_cipher
ImportError: No module named _mode_ecb
elvio@elv034gen:~/HCW/testcdp$ 
etingof commented 5 years ago

Hey, this seems to have something to do with pycryptodomex. I am not knowledgable in that matter, but you could try to reach out for those folks here on GitHub.

Alternatively, if you could live without trunk encryption (and strong SNMPv3 encryption), you may chose to try this branch - it should work without pycryptodomex installed if you do not have trunk secret key configured in your snmpfwd configuration.

If you still need trunk encryption, I think we could downgrade to something lesser than AES, which is shipped with Python, so it won't cause so much dependency trouble.

WDYT?

elviosebastianelli commented 5 years ago

Hi, I don't need encryption and use snmpv1 & 2 in my environment. Thanks. How can I use the branch? Do I have to wait for you to close the pull request?

etingof commented 5 years ago

No need to wait for PR to be merged. Actually, it would be better if you test it before it's merged. ;-)

To use the latest code from that branch you could just download it as .zip or git clone that branch.

elviosebastianelli commented 5 years ago

OK, as the first test, the processes are running on sunos... :-)

elviosebastianelli commented 5 years ago

Hi, without encryption snmpfwd serverand client are ok now!

thanks again