Comments (4)
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.
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.
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.
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)
- Issue with negative Oid values HOT 7
- buffer error? HOT 4
- udp_stub_connection.go and flag.PrintDefaults() HOT 1
- Counter64 Support HOT 2
- type 65 not recognized HOT 1
- EncodeInteger/EncodeUint Issue HOT 4
- Using WSDL files for description methods HOT 1
- License info HOT 2
- Why is the OID required to start with .1.3? HOT 9
- Various bugs/issues for discussion HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wapsnmp.