Comments (2)
Assuming you are not setting msgMaxSize
to something other than the default, this actually seems like a bug in the implementation of the agent. If an agent generates a response that is larger than the limit specified in the request, it's supposed to return a tooBig
error. In this case, since it's not doing it, the UDP packet, which may be up to 65535 bytes is getting truncated by the ethernet layer, which supports a maximum payload of 1500 bytes. Clearly netsnmp is more fault-tolerant in this way, and it's able to detect that this is a valid packet that's simply been truncated by the network, and so it downgrades use a getNext request, which you would expect to have a smaller payload.
I'm not sure precisely what it would take to enable this type of fault-tolerance. It would probably involve creating a subclass of ParseError
to replace the "Incomplete value" error in the decode()
function in ber.py
. The SNMPv3Message
and PDU
classes would need to be updated to continue parsing after detecting this error, in order to read the message/request ID, if possible, so that the proper RequestHandle
can be notified of the failure, and propagate the error to the caller of getBulk()
.
In the meantime, you will probably need to manually limit the number of values you request at once, so that the agent will not generate responses that are too large.
from python-snmp.
In general, ZTE vendor's equipment is quite unstable. It is hard to argue with this.
To check, I reduced max-repetitions
to 2 (it was 10) and got a correct response (from wireshark's point of view).
![image](https://private-user-images.githubusercontent.com/5622389/330299399-1f61d8bf-da9d-481f-9048-57adca1d8cd3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3ODM5ODAsIm5iZiI6MTcyMzc4MzY4MCwicGF0aCI6Ii81NjIyMzg5LzMzMDI5OTM5OS0xZjYxZDhiZi1kYTlkLTQ4MWYtOTA0OC01N2FkY2ExZDhjZDMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTZUMDQ0ODAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWYyNDI5ZWYyZjQ5YjM2YjM2MGY4MTZiMWUzODAyMTc2NGJlZjllNzU0ODMzNWQwYWU1YTczYTBhOGEyNzNlMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.g9zxbokviYCtPvlS5MOUaMH5PaJua1gbpSuQFxHVlpM)
But anyway I see that net-snmp makes an additional snmp-get request to explicitly get noSuchObject
. And this idea seems quite good to me.
Maybe that practice should be adopted for python-snmp as well? Including within the getNext and getBulk methods, so that instead of repeating snmp-get-next or snmp-get-bulk requests within a timeout, perform a snmp-get request to determine if the requested OID exists?
from python-snmp.
Related Issues (12)
- Example throws exception HOT 2
- Tutorial not working on Ubuntu HOT 12
- Bad Community string handling in v2c? and 'get' Timeout HOT 4
- SNMPv2c - TypeError: can't concat str to bytes HOT 1
- Garbled hex-string HOT 2
- snmpwalk HOT 7
- Test compatibility with macOS HOT 4
- SNMPv1 when the endOfMib is reached, an ErrorResponse is thrown HOT 2
- OID increase check HOT 3
- Adherence to coding style
- Not able to install using PIP HOT 1
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 python-snmp.