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
0
votes
1 answer

How to get my pysnmp script to work

I am trying to perform an snmpwalk to get number of errors on each interface of a device (via DNS name). I can successfully run the following snmpwalk from a Debian box: snmpwalk -v2c -c public atlanta-r1…
0
votes
1 answer

pysnmp snmpwalk giving timeouterror

I am able to run snmpwalk from my machine snmpwalk -c public -v 2c junipertestrtr 1.3.6.1.4.1.2636.5.1.1.2.1.1.1.13.0.1 from the same computer's command line I get the right…
0
votes
0 answers

pysnmp script giving error

I was trying too many things and hence I pasted the wrong code. Here is the code I am using from pysnmp.entity.rfc3413.oneliner import cmdgen from pysnmp.smi import * cmdGen = cmdgen.CommandGenerator() errorIndication, errorStatus, errorIndex,…
0
votes
1 answer

pysnmp.smi.error.SmiError: No symbol

I cannot seem to get this script to work. Any help is greatly appreciated. Here's the error I keep getting: ./snmptester.py Traceback (most recent call last): File "./snmptester.py", line 35, in cmdgen.MibVariable(mib, oid), File…
0
votes
1 answer

how to use a callback from a pysnmp V3 command responder?

I am using latest version of pysnmp 4.2.4 and have tested the SNMPV1/2C command responder example (http://pysnmp.sourceforge.net/examples/current/v1arch/agent/cmdrsp.html) which is returning an Uptime value in response to OID 1,3,6,1,2,1,1,3,0 I…
Steve
  • 59
  • 1
  • 7
0
votes
1 answer

pySnmp async reacts differently from sync

I have 2 almost identical method calls and they return different results from pyasn1.type import univ from pysnmp.entity.rfc3413.oneliner import cmdgen def printResult(*result): print str(result) print…
Sjuul Janssen
  • 1,772
  • 1
  • 14
  • 28
0
votes
2 answers

Do you have any other alternativ beside Udp6SocketTransport Pysnmp

I am trying to make a program that can use IPv6 in Pysnmp and I already read a lot from google and so on. And I always found that people use Udp6SocketTransport. but the problem is this class does not work on all platform and I need it so it might…
0
votes
1 answer

How to make a multiple GETNEXT query in AsynCommandGenerator?

#!/usr/bin/env python #-*- coding: utf-8 -*- from pysnmp.entity.rfc3413.oneliner import cmdgen def cbFun(sendRequestHandle, errorIndication, errorStatus, errorIndex, varBinds, cbCtx): print varBinds def main(): ip = '127.0.0.1' cmdGen =…
kalombo
  • 861
  • 1
  • 9
  • 31
0
votes
1 answer

Is it possible to set context name in SNMPv3 using pySNMP library

There is one simulator available using pySNMP called SNMP simulator. It sets a default context name value. Is there anyway to set custom context name value for snmpv3 ? Here is an extract from snmpsimd.py where i tried to give context name…
Antarus
  • 1,573
  • 2
  • 15
  • 32
0
votes
1 answer

Python threading with web.py and pysnmp to create a web service

I'm attempting to create a small service for my home network that reads SNMP values from my switch for the port that the router is on, does a few calculations and returns the current average bandwidth utilization. I got pysnmp working well enough…
Blark
  • 307
  • 1
  • 3
  • 15
0
votes
2 answers

pySNMP sequence on managed objects for setCmd

According to the documentation the setCmd varBinds reference is a sequence of managed objects. However, I have tried to pass a list [(oid0, value0), (oid1, value1)] or a tuple ((oid0, value0), (oid1, value1)) or a set set([(oid0, value0), (oid1,…
scriptOmate
  • 57
  • 1
  • 2
  • 7
0
votes
2 answers

How do I use the setCmd in pySNMP for a table element?

I have tried various things according to the documentation, but I cannot figure out how set the MIB in a dynamic table. I have code that sets scalar values and works fine. I know that I have to set a value of createAndGo(4) on the RowStatus and…
scriptOmate
  • 57
  • 1
  • 2
  • 7
0
votes
1 answer

pysnmp 4.2.3: pysnmp.smi.error.SmiError: importSymbols: empty MIB module name

I have two scenarios, both reference SNMP.py in this answer: pysnmp (v4.2.3) and pysnmp-mibs (v0.1.4): >>> # pysnmp-mibs 0.1.4 and pysnmp 4.2.3 >>> from SNMP import v2c >>> snmp = v2c('172.16.1.1', 'public') >>> snmp.walk('ifName') Traceback (most…
Mike Pennington
  • 41,899
  • 19
  • 136
  • 174
0
votes
1 answer

how can I clear the pySNMP timout?

I would like to check tree system's status, I'm using the following code, but I have problem with the timeout, for example when one of the system is down than in the next system I'm getting a time out as well. try: snmp = pySNMPCom(…
Mokus
  • 10,174
  • 18
  • 80
  • 122
-1
votes
0 answers

Why is my script not printing all my OID descriptions?

import csv import re from pysnmp.entity.rfc3413.oneliner import cmdgen from concurrent.futures import ThreadPoolExecutor # Define your SNMP oids and other variables here # (Keep your OID definitions and descriptions here) UPS_Mode =…
1 2 3
31
32