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
1
vote
1 answer

Error in parsing mibs using build-pysnmp-mibs and loading mibs using pysnmp

I am trying to load some custom mibs using mibBuilder. Initially, as per the pysnmp documentation, I used the build-pysnmp-mib utility for converting the mibs to pysnmp mib format. But I get the following error: from pysnmp.smi import builder Empty…
karan
  • 11
  • 2
1
vote
1 answer

Increment OIDs dynamically at SNMP agent

I have written the SNMP agent code by configuring two different context names at the SnmpContext class instance. It will register a MIB tree under particular contextName like below, class Test(): def readVars (self , varBinds, acInfo=(None,…
Shri
  • 11
  • 2
1
vote
1 answer

Is it possible to pull the interface name and interface status from this table?

Ultimately, I would like to be able to have the output in the format of: 'Interface lo is up' The output is: ['IF-MIB::ifDescr.1 = lo', 'IF-MIB::ifOperStatus.1 = up'] ['IF-MIB::ifDescr.2 = eth0', 'IF-MIB::ifOperStatus.2 = up'] Code: from…
Lj G
  • 23
  • 2
1
vote
2 answers

PySnmp: unable to set value of OID ('str' object has no attribute 'getTagSet')

I'm using PySnmp library for Python3. I'm having issues trying to set a value using the complete OID. Everything is fine using MIB class/name instead. What I'm trying to do basically is: objIdentity =…
Daniele
  • 11
  • 3
1
vote
1 answer

snmp responder installing error : ERROR: Could not find a version that satisfies the requirement pysnmp>=5.0.0 (from snmpresponder)

I am trying to install snmpresponder using the pip (in windows). I am using python 2.7. I found the snmpresponder from the following website. http://snmplabs.com/snmpresponder/ This is what I tried pip install snmpresponder But I am getting the…
Visakh V
  • 55
  • 1
  • 11
1
vote
1 answer

How can I register a MIB module in a different (SNMPv3) context. In SNMP agent side

I am new to SNMP and I am trying to create SNMP agent in the cloud which will use the context name to distinguish the devices. I am using pysnmp in the agent side. I am also following the sample program available in the…
Visakh V
  • 55
  • 1
  • 11
1
vote
1 answer

pysnmp How to use varBinds content of an incoming trap to forward a new trap?

I am writing a code to receive SNMP v2c traps, store them in a DB, and then forward the trap to another IP. I would like to confirm whether I may use the varBinds variable associated to the incoming trap, update its content, and use it as the info…
Sebd77
  • 21
  • 2
1
vote
1 answer

How to pull MAC addresses per vlan using SNMPv3 from cisco switch?

I want to pull all the MAC addresses that the switch knows about. I found in SNMPv2 This command is successful from a linux terminal snmpwalk -v2c -c SNMPCommunity@10 10.10.10.10 .1.3.6.1.2.1.17.4.3.1.1 This command needs to have the "@10"…
Dwight
  • 15
  • 6
1
vote
0 answers

How to write a code for agent side response for give request in pysnmp for example a get-request and what are the required prerequisite

I am trying to code a agent which can response to the request from the manager. i am unable to know from where to start and what are the steps to be followed I am using ubuntu-18.04.2 LTS and i want to know the commands required to do my…
s_kifayath
  • 17
  • 5
1
vote
1 answer

How to parse MIB and retrieve TEXTUAL-CONVENTION without OID in Python

How to parse a MIB file in python and retrieve an object representing its TEXTUAL-CONVENTION? For instance, CISCO-RTTMON-TC-MIB: http://www.circitor.fr/Mibs/Html/C/CISCO-RTTMON-TC-MIB.php#RttMplsVpnMonRttType Defines values: INTEGER jitter(1),…
Ferdinand.kraft
  • 12,579
  • 10
  • 47
  • 69
1
vote
1 answer

How to specify auth/priv keys instead of pass phrases with PySNMP?

I have the following successful net-snmp command: snmpget -v3 -l authPriv -3k $auth_key -3K $priv_key -u $user udp6:$ip 1.3.6.1.2.1.1.1.0 I've been trying to replicate this in PySNMP, but it seems that the keys aren't being accepted. I get the sense…
GlenboLake
  • 13
  • 6
1
vote
1 answer

Using PySNMP as Trap Receiver with own/vendor MIB

I try to use PySNMP to receive SNMPv3 Traps. I found this example code: #!/usr/bin/env /usr/bin/python3 from pysnmp.entity import engine, config from pysnmp.carrier.asyncore.dgram import udp from pysnmp.entity.rfc3413 import ntfrcv from…
1
vote
0 answers

PYSNMP v3 vs CISCO

I'm trying to get an answer from ucs-6100 by SNMP. Through the console: (analogue of my request) >>> snmpget -v3 -l authPriv -u usr-sha-aes -A authkey1 -X privkey1 -a SHA -x AES demo.snmplabs.com SNMPv2-MIB::sysDescr.0 I succeed But when I use a…
Alex
  • 37
  • 4
1
vote
1 answer

SNMP SET request using Python

I need to controle a simple device via SNMP using Python 3.7 just to get it "ON" (1) and "OFF" (0). In the device manual, in the MIB information, there is a list of OID for each command (ex : GET output statue : 1.3.6........). I manage to have the…
C.Pail
  • 11
  • 1
  • 4
1
vote
1 answer

How to investigate errorStatus for each oid in Pysnmp when querying multiple OID's in a single transaction

I am Trying to query multiple OID's in a single getCMD command. I am looking to figure out the best way to check the response of each for errorIndication and errorStatus.One way that I have been able to achieve this is by creating a dictionary and…
adamz88
  • 319
  • 3
  • 12