pysnmp

Error: OID not increasing: SNMPv2-SMI::dod, How to increase OID?

限于喜欢 提交于 2020-01-15 05:41:25
问题 I am trying to implement a snmp agent with two different context name.I got some sample program .This is my agent side code look like . which I got from the snmplabs.com. I tried to implement it and I am facing some error while doing the snmpwalk. """ | $ snmpwalk -v3 -u usr-md5-none -l authNoPriv -A authkey1 -n context-a 127.0.0.1 .1.3.6 | $ snmpwalk -v3 -u usr-md5-none -l authNoPriv -A authkey1 -n context-b 127.0.0.1 .1.3.6 """ # from pysnmp.entity import engine, config from pysnmp.entity

PyInstaller does NOT work when including Pysnmp

a 夏天 提交于 2020-01-10 05:48:06
问题 Just trying one of the official documentation site examples: from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), CommunityData('public'), UdpTransportTarget(('192.168.1.14', 161)), ContextData(), ObjectType(ObjectIdentity('1.3.6.1.2.1.1.1.0'))) ) if errorIndication: print(errorIndication) elif errorStatus: print('%s at %s' % ( errorStatus.prettyPrint(), errorIndex and varBinds[int(errorIndex)-1][0] or '?' ) ) else: for varBind in varBinds

What is the most efficient way to scrape multiple single and branch OIDs?

好久不见. 提交于 2020-01-07 05:47:09
问题 I am always in a war between maximum speed and minimal resource consumption, so my goal is to find the best combination for speed and resource consumption. For each snmp device I would like to scan the oids under several branches. Each branch has a dynamic amount of oids under it so i don't know what specific oids i need, I just know that I need all oids under a branch. I have some devices that only support SNMPv1 so for those devices I write code that is compatible with SNMPv1. For the rest

PySNMP Short OID Error Trying To Translate OIDs using MIB Textual Conventions

此生再无相见时 提交于 2020-01-05 14:03:24
问题 I am using the method described in the issue Translate OID value pairs from MIB textual convention using pysnmp to translate OID and OID values according to MIB Textual Conventions. Using a test OID and test OID value my code is as follows: from pysnmp.smi import builder, view from pysnmp.entity.rfc3413.oneliner import mibvar from pysnmp.proto import rfc1902 from pyasn1.type import univ mibBuilder = builder.MibBuilder() mibPath = mibBuilder.getMibSources() + (builder.DirMibSource('/home/rong

Translate OID value pairs from MIB textual convention using pysnmp

我与影子孤独终老i 提交于 2020-01-04 06:17:27
问题 I am trying to write a piece of code that accepts a JSON object with OIDs as keys and OID values as values. An Example would be: {".1.3.6.1.4.1.562.29.6.2.3": "Link Down", ... } When this JSON object is received I want to translate the OID and the OID value using PySNMP, but I do not know how I can translate the OID value according to Textual Conventions defined within a corresponding MIB file. An example MIB file would define: TruthValue ::= TEXTUAL-CONVENTION STATUS current DESCRIPTION

PySNMP exceptions

随声附和 提交于 2020-01-03 05:27:11
问题 I am trying to make an SNMP agent following this tutorial: http://www.nealc.com/blog/blog/2013/02/23/writing-an-snmp-agent-with-a-custom-mib-using-pysnmp/ I am using the exact code in the tutorial, but when I run the code it ends in this: DBG: [19:13:54.964]: file SNMPv2-SMI.pyc mtime 1379957443 DBG: [19:13:54.964]: file SNMPv2-SMI.py mtime 1402947591 DBG: [19:13:54.965]: loadModules: evaluating /usr/local/lib/python2.7/dist-packages/pysnmp/smi/mibs/SNMPv2-SMI.py Traceback (most recent call

Reuse getCmd object in pysnmp

微笑、不失礼 提交于 2019-12-25 08:46:13
问题 In the pysnmp documentation there is a getCmd class, I was wondering if it was possible to just instantiate the class once and reuse it at a later point by passing it new oids. I am not sure if the getCmd class exposes methods to allow me to change the oids. http://pysnmp.sourceforge.net/docs/hlapi/asyncore/sync/manager/cmdgen/getcmd.html 回答1: The getCmd name is referring to a function, not a class. Technically, it is a generator, but that is not important here. It is cheap to call *Cmd()

Uhandled error in pysnmp twisted client with more than 1000 hosts

老子叫甜甜 提交于 2019-12-24 00:00:38
问题 I have this code: from twisted.internet import reactor from twisted.internet import defer, task from pysnmp.entity import engine, config from pysnmp.carrier.twisted import dispatch from pysnmp.carrier.twisted.dgram import udp from pysnmp.entity.rfc3413.twisted import cmdgen import __webimport__ import tools.config from tools.database import makedsn import psycopg2 def cmp_varBinds(varBind, varName): if varName[0] in str(varBind[0]): return True def cbFun(cbCtx, ip, varNames): (errorIndication

how to load and walk a custom mib in pysnmp?

依然范特西╮ 提交于 2019-12-21 21:28:59
问题 I'm new to SNMP/pysnmp and I'm trying to implement an agent that uses a custom MIB. I'm looking at the following example on the pysnmp site, but I can't seem to get it to work. Here are the steps I'm taking: convert my MIB file to a pysnmp module using build-pysnmp-mib (this succeeds without errors) set MIB source and load the MIB module using MibBuilder() use the example referenced above to set up the agent (only thing I added is the mibBuilder) use net-snmp's snmpwalk to view the loaded MIB

Implementing a custom MIB in a PySNMP agent

随声附和 提交于 2019-12-21 03:22:08
问题 I'm having difficulty implementing a custom MIB in a PySNMP agent. I've started with: http://pysnmp.sourceforge.net/examples/4.x/v3arch/agent/cmdrsp.html created my own MIB file, used build-pysnmp-mib to make a Python module and successfully imported the symbol. I can't see where to go next. I need to somehow mount the imported symbol on the list of served MIBs and provide an implementation. (It's currently a MIB with one read-only INTEGER property.) The MIB file passes smilint without