interactive SNMP tool with Python
Python Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
examples
man Update snimpy homepage Jun 6, 2012
snimpy lint: fix two linting issues Nov 15, 2016
tests
.gitignore
.gitmodules doc: use Sphinx to generate documentation Oct 18, 2013
.travis.yml
AUTHORS.rst docs: add a section about licensing Oct 18, 2013
CONTRIBUTING.rst
HISTORY.rst
MANIFEST.in setup: use vcversioner for version numbering Jun 25, 2015
Makefile build: make clean should only remove files Feb 21, 2015
README.rst doc: provide a link to libsmi home page Sep 19, 2016
requirements.txt
setup.py
tox.ini travis: test pypy only with PySNMP 4.2 Dec 3, 2015

README.rst

snimpy

https://badge.fury.io/py/snimpy.png https://travis-ci.org/vincentbernat/snimpy.png?branch=master https://coveralls.io/repos/vincentbernat/snimpy/badge.png

Interactive SNMP tool.

Snimpy is a Python-based tool providing a simple interface to build SNMP query. Here is a very simplistic example that allows us to display the routing table of a given host:

load("IP-FORWARD-MIB")
m=M("localhost", "public", 2)
routes = m.ipCidrRouteNextHop
for x in routes:
    net, netmask, tos, src = x
    print("%15s/%-15s via %-15s src %-15s" % (net, netmask, routes[x], src))

You can either use Snimpy interactively throught its console (derived from Python own console or from IPython if available) or write Snimpy scripts which are just Python scripts with some global variables available.

Snimpy requires libsmi to work correctly. See the documentation for more information.

Features

Snimpy is aimed at being the more Pythonic possible. You should forget that you are doing SNMP requests. Snimpy will rely on MIB to hide SNMP details. Here are some "features":

  • MIB parser based on libsmi (through CFFI)
  • SNMP requests are handled by PySNMP (SNMPv1, SNMPv2 and SNMPv3 support)
  • scalars are just attributes of your session object
  • columns are like a Python dictionary and made available as an attribute
  • getting an attribute is like issuing a GET method
  • setting an attribute is like issuing a SET method
  • iterating over a table is like using GETNEXT
  • when something goes wrong, you get an exception