Comments (3)
I am facing the same problem, when I try getting Opaque type OID, I only get the tag. The rest of the values (iid,val and type) are set to "None". Is there a way to read these OIDs through EasySNMP?
from easysnmp.
i never found a way through easysnmp to get/set opaques.
i used pysnmp to get them, but then had to covert them .. here's a sample:
from pysnmp.entity.rfc3413.oneliner import cmdgen
cmdGen = cmdgen.CommandGenerator()
cmdgen.UdpTransportTarget((crateip, 161)),
'1.3.6.1.4.1.19947.1.3.2.1.12', #outputCurrent
'1.3.6.1.4.1.19947.1.3.2.1.10', #outputVoltage
'1.3.6.1.4.1.19947.1.3.2.1.7', #outputMeasurementCurrent
)
currdata = []
currtime = time.time()
for var in varBinds:
for sv in var:
oidsplit = sv[0].getOid().prettyPrint().split('.')
chanidx = oidsplit[-1]
oid_noidx = '.'.join(oidsplit[:-1])
name = mibLUT[oid_noidx]
if re.search('opaque',sv[-1].prettyPrintType(),re.IGNORECASE):
outval = struct.unpack('>f',sv[-1].asOctets()[3:])[0]
else:
outval = sv[-1]._value
currdata.append([currtime, name, outval, chanidx ])
thisdf = pd.DataFrame(currdata,columns=['measurementTime','measurementType','measurementValue','channel'])
from easysnmp.
Thank you for sharing Chris! :)
from easysnmp.
Related Issues (20)
- [BUG] SNMP v1 walk can fail in different ways HOT 13
- [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
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.