Coder Social home page Coder Social logo

Calls to Poll use fixed timeout about wapsnmp HOT 4 CLOSED

cdevr avatar cdevr commented on September 15, 2024
Calls to Poll use fixed timeout

from wapsnmp.

Comments (4)

cdevr avatar cdevr commented on September 15, 2024

This is a complex question that has more to do with operational responsibility than with software design. The short answer is that you need to decide whether users of your tool need to be able to change the SNMP timeout (and max. retries probably).

If your operational team (the people who keep your application running) is mature enough to have valid and good opinions on this, and therefore can be trusted to handle these values responsibly (e.g. do they understand why setting it to 1h timeout and 1000 retries would be bad), then I'd say make these values configurable.

You should keep in mind that these values can change the time you need to query a router can change a lot when you change these values. If you walk a malfunctioning router for 10000+ values and set the values large, then you could find it takes hours and hours to get the information. If you set the timeout really low, then you could overload the router you're querying. So this is not a trivial issue.

from wapsnmp.

virtuallynathan avatar virtuallynathan commented on September 15, 2024

Ah, yes, that makes quite a bit of sense. I guess i'll make a fork and allow these values to be tweaked. In my case i'm only (currently) polling 10-15 OIDs from a device that is happy to respond quickly.

Thanks!

from wapsnmp.

britcey avatar britcey commented on September 15, 2024

Can we revisit this? I'm dealing with a bunch of equipment on the other side of the planet, so 500ms doesn't give me a lot of wiggle room. I'd prefer not to fork (this works great, otherwise, btw).

I'd assumed the 'timeout' argument to NewWapSNMP was for more than just the initial connect; having that also used for the calls to poll is what I was expecting. I'll be happy to submit a pull request replacing '500*time.Millisecond' with 'w.timeout', if that helps.

By way of comparison, the net-snmp tools default to 1 second timeout between requests (and 5 retries), both of which are configurable.

Thanks.

from wapsnmp.

cdevr avatar cdevr commented on September 15, 2024

I've had a good think about this, and I think you're right. The values should be configurable. So I've made the patch and applied it.

Commit is 2d8130a

Cheers,

Christophe

from wapsnmp.

Related Issues (11)

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.