Comments (3)
I'd like to help fix this issue, because I have a certain OID I cannot set properly without the Hex-String functionality.
from easysnmp.
Hello,
Is there any developments about this problem? or Any solution?
from easysnmp.
For anyone else that comes across this, while I agree the compat could use some help on OCTET STR types. A short work around that appears to be good and concise:
from easysnmp import snmp_get
OID = iso.0.8802.1.1.2.1.4.1.1.7.2520.9.1
snmp_get(OID, hostname='192.0.2.1', community='public', version=2).value.encode('latin-1')
You'll end up with a bytes object of the hex.
E.g. follow the original example if snmpget returns:
iso.0.8802.1.1.2.1.4.1.1.7.2520.9.1 = Hex-STRING: 31 2F 33 00
Then you would get:
from easysnmp import snmp_get
OID = iso.0.8802.1.1.2.1.4.1.1.7.2520.9.1
snmp_get(OID, hostname='192.0.2.1', community='public', version=2).value.encode('latin-1')
b'\x31\x2f\x33\x00'
I'm sure there was some design reason behind using latin-1 encoding originally. But it does draw a good amount of confusion, especially with beginners. And the fragmentation of SNMP in Python doesn't help much.
from easysnmp.
Related Issues (20)
- [BUG] Seg fault in interface.c:py_netsnmp_attr_string HOT 1
- [BUG] macOS compilation fails due to improper setup.py logic
- [PROPOSAL] Drop Python 2 support HOT 1
- Cannot install MacOS 12.5 (M1 ARM64) HOT 12
- [BUG] SIGSEGV if type not set in snmp_set() HOT 3
- [BUG] Unable to set 64 bit integer on 32 bit ARM device HOT 10
- Possible Memory Leak Using Session API HOT 4
- [BUG] HOT 2
- [FEATURE] Support 16bitIDs in sessions
- failed to install/compile with pip on debian11 [BUG]
- How to install easysnmp with net-snmp installed in /opt/netsnmp HOT 1
- [BUG] Unsupported privacy protocol DES
- [FEATURE] Python 3.11 support
- [BUG] DeprecationWarning future library HOT 1
- [FEATURE] Read the Docs Action required - Add a configuration file to your project to prevent build failures
- [BUG] MacOS install fatal error: 'openssl/ossl_typ.h' file not found HOT 1
- Please support apple silicon[FEATURE] HOT 1
- Cant install easysnmp using pip3.11 in RHEL 7.9 HOT 3
- [BUG] Empty string in second argument for `set` results in segmentation fault HOT 1
- [BUG] When installing easysnmp 0.2.6 using pip and wheel, current algos introduced with 0.2.6 are not working
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 easysnmp.