Giter Site home page Giter Site logo

michalmazurek / easysnmp2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from easysnmp/easysnmp

7.0 7.0 1.0 606 KB

A blazingly fast and Pythonic SNMP library based on the official Net-SNMP bindings

Home Page: http://www.net-snmp.org/

License: Other

Python 34.83% C 65.17%

easysnmp2's People

Contributors

cybersol795 avatar fgimian avatar kamakazikamikaze avatar larsmichelsen avatar michalmazurek avatar nnathan avatar sthomen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

shameempk

easysnmp2's Issues

Memory leak

Hi!

I've come across easysnmp2 as I found a memory leak using easysnmp library... Unlucky I got the same issue using easysnmp2 :-(

I'm using a Session object to perform several get, also with multiple oid at the same time, could it be that the problem?

Received signal SIGSEGV, Segmentation fault with repeated requests

I use the Bottle framework with a Paste server and when I query several devices simultaneously in SNMP, the Python crashes with an exit 139 code.

When I use the PySNMP library I don't have this problem but the requests are much longer, hence the fact that I want to use your library.

Debug with GDB : gdb -ex r --args .venv/bin/python3 -m my_module

Thread 8 "python3" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdf7fe700 (LWP 15222)]
0x00000000004c8e8a in unicode_fromformat_write_cstr (writer=writer@entry=0x7fffdf7f8a80, str=0x0, width=width@entry=-1, precision=precision@entry=-1) at ../Objects/unicodeobject.c:2627
2627    ../Objects/unicodeobject.c: No such file or directory.

Does not work on Ubuntu20.04 LTS due to libsnmp30 dependency

The newest easysnmp2 version 0.3.1 needs libsnmp30, but Ubuntu only provides libsnmp35.
Is it possible to allow newer libsnmp versions or lower the version restrictions?

$ uname -a
Linux mycomputer 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal
Python 3.10.13 (main, Aug 25 2023, 13:20:03) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import easysnmp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../.venv/lib/python3.10/site-packages/easysnmp/__init__.py", line 1, in <module>
    from easysnmp.easy import (  # noqa
  File ".../.venv/lib/python3.10/site-packages/easysnmp/easy.py", line 3, in <module>
    from easysnmp.session import Session
  File ".../.venv/lib/python3.10/site-packages/easysnmp/session.py", line 8, in <module>
    from easysnmp import interface
ImportError: libnetsnmp.so.30: cannot open shared object file: No such file or directory
(.venv) $ pip list --local
Package            Version
------------------ ---------
[...]
easysnmp2          0.3.1
apt list libsnmp*
Auflistung... Fertig
libsnmp-base/focal-updates,focal-updates,now 5.8+dfsg-2ubuntu2.9 all  [installiert]
[...]
libsnmp35/focal-updates,now 5.8+dfsg-2ubuntu2.9 amd64  [installiert]

get_bulk doesn't return all the values (net-snmp bug?)

When I do a get_bulk() on .1.3.6.1.2.1.47.1.1.1.1.7, I get 26 values.
When I do a get_bulk() on .1.3.6.1.2.1.47.1.1.1.1.2, I get 26 values.
When I do a get bulk on the two of them together, I get 49 values.

This is problematic because the results don't return in pairs, and of course, because the last 3 values were omitted.

Unfortunately, this is exactly the same result I get with net-snmp on my Mac :-(
$ /usr/bin/snmpbulkget -C r26 -O fn -c public 10.10.10.249 .1.3.6.1.2.1.47.1.1.1.1.7 | wc -l
26
$ /usr/bin/snmpbulkget -C r26 -O fn -c public 10.10.10.249 .1.3.6.1.2.1.47.1.1.1.1.2 | wc -l
26
$ /usr/bin/snmpbulkget -C r26 -O fn -c public 10.10.10.249 .1.3.6.1.2.1.47.1.1.1.1.7 .1.3.6.1.2.1.47.1.1.1.1.2 | wc -l
49

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.