Questions tagged [pysnmp]

PySNMP is a pure Python module used for SNMP operations.

PySNMP

PySNMP is a pure-Python module that can talk SNMPv1/v2/v3, automatically download and parse MIBs via pysmi and is designed with asynchronous applications in mind (e.g. asyncio).

Its source code spans over multiple GitHub repositories and you can get started from https://github.com/etingof/pysnmp

As the original project owner passed away, future ownership is to be determined. More details can be found in https://github.com/etingof/pysnmp/issues/429

477 questions
2
votes
1 answer

AttributeError: 'module' object has no attribute 'MibVariable'

I am exploring pysnmp (python snmp library). While executing an example, I got error AttributeError: 'module' object has no attribute 'MibVariable' against method call cmdgen.MibVariable('SNMPv2-MIB', 'sysDescr', 0) Example code is given below from…
2
votes
2 answers

How to identify a "NoSuchObject" in Python?

I'm currently working on a SNMP module in Python 3 (Python 3.1.3) based on PySnmp to easily send GET/WALK SNMP queries from other programs. This is mainly for fun/learning. When querying an existing OID, I get a tuple such as…
Httqm
  • 799
  • 7
  • 13
2
votes
1 answer

how to load and walk a custom mib in pysnmp?

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…
verboze
  • 419
  • 1
  • 7
  • 10
2
votes
1 answer

ipv6 support in pysnmp

I am using the following code: import pysnmp from pysnmp.entity.rfc3413.oneliner import cmdgen errorIndication, errorStatus, errorIndex, \ varBindTable = cmdGen.nextCmd ( cmdgen.CommunityData(agent,…
ashokadhikari
  • 1,182
  • 3
  • 15
  • 29
2
votes
2 answers

How to lookup mib-table in pysnmp?

When I use snmpwalk on a OID ( 1.3.6.1.4.1.2021.4), i get the following result as: UCD-SNMP-MIB::memIndex.0 = INTEGER: 0 UCD-SNMP-MIB::memErrorName.0 = STRING: swap UCD-SNMP-MIB::memMinimumSwap.0 = INTEGER: 16000 kB But, when i use the pysnmp…
ashokadhikari
  • 1,182
  • 3
  • 15
  • 29
1
vote
1 answer

SNMP oids corresponding to CLI command

info configure xdsl line 1/1/1/2 output : configure xdsl #------------------------------ echo "xdsl" #------------------------------ line 1/1/1/2 service-profile 1 spectrum-profile 1 admin-up transfer-mode…
onur taskin
  • 929
  • 1
  • 14
  • 33
1
vote
0 answers

SNMP NoSuchInstance Exception

I'm using python and pysnmp library. I'm trying to get parameters of service profile from mib browser. i defined SNMP OID groupings in a class. oidGroups = { 'serv_profiles': [ ('xdslRARatioDownstream', 'line.interval',…
Selin
  • 616
  • 2
  • 9
  • 23
1
vote
1 answer

PySNMP MIB module failing when attempting to access function Counter64

Attempting to run a MIB based SNMP script and I running into an issue. It is unable to run the function Counter64 though I know that the module which contains that function is installed. the MIB module is automatically generated so I attempted to…
Drahkar
  • 1,694
  • 13
  • 17
1
vote
1 answer

PySNMP: load error: Bad OctetString initializer

I have the following example from the pysnmp page: # GET Command Generator from pysnmp.entity.rfc3413.oneliner import cmdgen errorIndication, errorStatus, \ errorIndex, varBinds = cmdgen.CommandGenerator().getCmd( # SNMP…
Peanut
  • 3,753
  • 3
  • 31
  • 45
1
vote
1 answer

SNMP wrapper agent?

So we have some internal applications that provide metrics via a RESTful api. We would like to expose this data via SNMP. What I am thinking is that at the host level an SNMP wrapper would receive a SNMPGET and then perform a HTTP request for the…
CarpeNoctem
  • 5,540
  • 8
  • 30
  • 33
1
vote
2 answers

How to make a single GETNEXT query in PySNMP

I'm trying to make a simple snmp GETNEXT query to retrieve only the next item of given OID in tree hierarchy. For example, what I want is: When i make a GETNEXT request with OID 1.3.6.1.2.1.1 (iso.org.dod.internet.mgmt.mib-2.system) I expect to get…
Cankut
  • 667
  • 1
  • 9
  • 22
1
vote
1 answer

Issues translating an snmpwalk command to python - pysnmp v3

I was wondering if anyone has any ideas on what i'm goofing up. Essentially i am trying to fetch the entire mac table from a cisco switch using snmpv3. Apparently cisco sucks and you need to query each vlan individually unlike other vendors ... So…
Rob
  • 153
  • 1
  • 3
  • 14
1
vote
1 answer

pysnmp send Notification not working - return None

I develop two programs which are an SNMP agent and an SNMP manager, with the PySnmp library: agent : receives GET requests, generates Notifications (trap / inform) manager : generates GET requests, receives Notifications (and answers to…
RamboSushi
  • 69
  • 5
1
vote
0 answers

Need to create custom OID on my computer that will respond to get and set commands

I have a generic SNMP agent emulator, but I don't know if it works with my computers existing MIBS and OIDs or simply responds to the Master's get/set commands in a vacuum. I need to be able to ensure that the agent emulator responds to a get…
Digit_Fish
  • 21
  • 2
1
vote
1 answer

SNMP library for python failed return SNMP details

Unable to get Fetch SNMP variable details using sample posted at (https://snmplabs.thola.io/pysnmp/quick-start.html) and got error response . please advice how to fix the error . Thanks in advance Traceback (most recent call last): File…