Giter Site home page Giter Site logo

haad / net-snmp Goto Github PK

View Code? Open in Web Editor NEW
57.0 57.0 61.0 29.87 MB

net-snmp repository with ocfs & ocfs2 support.

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

License: Other

C 87.04% Rust 0.01% D 0.02% Shell 8.19% Objective-C 0.05% Perl 4.58% Python 0.13%

net-snmp's People

Contributors

alexb7 avatar bvanassche avatar haad avatar hardaker avatar magfr avatar nielsb avatar sjfriedl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

net-snmp's Issues

getNext can not return correct value

Hi ALL,
I have question on table handler.If I get GetNext Request OID is 1.3.6.1.4.1.39604.2.1.1.1,I fill the result in netsnmp_table_build_result(); I think the next OID should be 1.3.6.1.4.1.39604.2.1.2.1,but It is always 1.3.6.1.4.1.39604.2.1.5.0.0,what is wrong? I don't know how to fill netsnmp_table_request_info *table_info , I just fill index value, The table index is OCTE_String. Thanks a lot

How to properly use async API for multi-threading

I'm trying to write a ruby binding for this library, which only relies on the async API (because the C gem doesn't it's in ruby and does not release the global interpreter lock).

I'm using FFI for accessing C library internal structures.

The steps I do are:

  • Initialize a C SNMP Session and keep the signature.
  • Get the socket fileno and use it to create a ruby IO object (1. this sometimes breaks).
  • I create the PDUs and send them using snmp_sess_async_send (2. if there's a lot of congestion, it breaks often).
  • Use my ruby IO object to use the ruby select API call (releases the thread while waiting for work to be done) (3. sometimes hangs).
  • Use snmp_sess_read, this will trigger the callback, load the response pdu in a known location from which I retrieve it, and I proceed with my life (4. this sometimes doesn't have anything there waiting).

Quite a bumpy ride. I'll proceed to explain each failure in detail:

  1. Sometimes I get Errno::EBADF (the fd was marked as bad by the OS). In which circumstances I can know this? Does netsnmp provide some API to check?
  2. In an example where I have 100 batches of 4 agents, each batch running on a separate thread, the async send returns 0 more often than I'd like to admit. How can I keep this under control?
  3. The official API tells me to use snmp_sess_select_info to get the number of descriptors to read. So, I don't know if I'm doing it properly by waiting on events on the socket fd from the session. This seems a completely different use case though.
  4. This one is also interesting. Is the callback triggered in a background thread? Because I see it being triggered, but when it comes to handling the response, it's just not there.

Could you provide me with a way of patching these issues and make this workable for ruby or any other binding-able VM? I saw that it was done for python, would be cool to achieve this for ruby.

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.