Skip to main content

interactive SNMP tool

Project description

https://badge.fury.io/py/snimpy.svg https://github.com/vincentbernat/snimpy/workflows/Tests/badge.svg https://coveralls.io/repos/vincentbernat/snimpy/badge.svg

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snimpy-1.1.1.tar.gz (78.4 kB view details)

Uploaded Source

File details

Details for the file snimpy-1.1.1.tar.gz.

File metadata

  • Download URL: snimpy-1.1.1.tar.gz
  • Upload date:
  • Size: 78.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for snimpy-1.1.1.tar.gz
Algorithm Hash digest
SHA256 7abb5ae39f5b5fef2893c6b446f066a167e4538d184f65028fa0d37d023c1963
MD5 a276b83c3cf435d582e058168d446826
BLAKE2b-256 5af6efc852717bc35bfef0976bdebd5d0658047f185db7d0faf2fed0907c37cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page