Skip to main content

Easy SNMP

Python Code Style Build Status Join the Discussions! License

Easy SNMP Logo

Artwork courtesy of Open Clip Art Library

Introduction

Easy SNMP is a fork of Net-SNMP Python Bindings that attempts to bring a more Pythonic interface to the library. Check out the Net-SNMP website for more information about SNMP.

This module provides a full-featured SNMP client API and supports all dialects of the SNMP protocol.

Why Another Library?

  • The original Net-SNMP Python library is a great starting point but is quite un-Pythonic and lacks proper unit tests and documentation.

  • PySNMP is entirely written in Python and therefore has a huge performance hit. In some brief tests, I estimate that both the Net-SNMP Python bindings and Easy SNMP are more than 4 times faster than PySNMP. Further to this, PySNMP has an even less Pythonic interface than the official Net-SNMP bindings.

  • Many other libraries like Snimpy are sadly based on PySNMP, so they also suffer performance penalty.

Quick Start

There are primarily two ways you can use the Easy SNMP library:

1. By using a Session object which is most suitable when you want to request multiple pieces of SNMP data from a source:

from easysnmp import Session

# Create an SNMP session to be used for all our requests
session = Session(hostname='localhost', community='public', version=2)

# You may retrieve an individual OID using an SNMP GET
location = session.get('sysLocation.0')

# You may also specify the OID as a tuple (name, index)
# Note: the index is specified as a string as it can be of other types than
# just a regular integer
contact = session.get(('sysContact', '0'))

# And of course, you may use the numeric OID too
description = session.get('.1.3.6.1.2.1.1.1.0')

# Set a variable using an SNMP SET
session.set('sysLocation.0', 'The SNMP Lab')

# Perform an SNMP walk
system_items = session.walk('system')

# Each returned item can be used normally as its related type (str or int)
# but also has several extended attributes with SNMP-specific information
for item in system_items:
    print '{oid}.{oid_index} {snmp_type} = {value}'.format(
        oid=item.oid,
        oid_index=item.oid_index,
        snmp_type=item.snmp_type,
        value=item.value
    )

2. By using Easy SNMP via its simple interface which is intended for one-off operations (where you wish to specify all details in the request):

from easysnmp import snmp_get, snmp_set, snmp_walk

# Grab a single piece of information using an SNMP GET
snmp_get('sysDescr.0', hostname='localhost', community='public', version=1)

# Perform an SNMP SET to update data
snmp_set(
    'sysLocation.0', 'My Cool Place',
    hostname='localhost', community='public', version=1
)

# Perform an SNMP walk
snmp_walk('system', hostname='localhost', community='public', version=1)

Documentation

Please check out the Easy SNMP documentation at Read the Docs. This includes installation instructions for various operating systems.

You may generate the documentation as follows:

# Install Sphinx
pip install sphinx

# You may optionally export the READTHEDOCS environment variable to build docs
# on systems where you haven't built the C interface
export READTHEDOCS=1

# Build the documentation into static HTML pages
cd docs
make html

Acknowledgments

I’d like to say thanks to the following folks who have made this project possible:

  • Giovanni Marzot: the original author

  • ScienceLogic, LLC: sponsored the initial development of this module

  • Wes Hardaker and the net-snmp-coders: for their hard work and dedication

  • fgimian and nnathan: the original contributors to this codebase

Running Tests

Tests use Pytest. You can run them with the following:

git clone https://github.com/easysnmp/easysnmp.git
cd easysnmp
pip install pytest
pytest

License

Easy SNMP is released under the BSD license. Please see the LICENSE file for more details.

Metadata

Release files for easysnmp 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easysnmp 0.2.6
File Size Uploaded
easysnmp-0.2.6.tar.gz 43.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for easysnmp 0.2.6
File
easysnmp-0.2.6-pp39-pypy39_pp73-macosx_10_9_x86_64.whl PyPy 3.9 PyPy 3.9 7.3 macOS 10.9+ x86-64 Details
easysnmp-0.2.6-pp38-pypy38_pp73-macosx_10_9_x86_64.whl PyPy 3.8 PyPy 3.8 7.3 macOS 10.9+ x86-64 Details
easysnmp-0.2.6-pp37-pypy37_pp73-macosx_10_9_x86_64.whl PyPy 3.7 PyPy 3.7 7.3 macOS 10.9+ x86-64 Details
easysnmp-0.2.6-cp310-cp310-manylinux_2_24_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.24+ x86-64 Details
easysnmp-0.2.6-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
easysnmp-0.2.6-cp39-cp39-manylinux_2_24_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.24+ x86-64 Details
easysnmp-0.2.6-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
easysnmp-0.2.6-cp38-cp38-manylinux_2_24_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.24+ x86-64 Details
easysnmp-0.2.6-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
easysnmp-0.2.6-cp37-cp37m-manylinux_2_24_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.24+ x86-64 Details
easysnmp-0.2.6-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
easysnmp-0.2.6-cp36-cp36m-manylinux_2_24_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.24+ x86-64 Details
easysnmp-0.2.6-cp36-cp36m-macosx_10_9_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 Details

Total release size: 19.0 MB

Release files / easysnmp-0.2.6.tar.gz

Download URL easysnmp-0.2.6.tar.gz
Size 43.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8326df1bc8d9cdb29e3e43d55d56cb24c0d98f6997a7a1571f32815e8bdfef15
BLAKE2b-256 checksum
How to use checksums
21d16681212ad035c6421f529bbbea52330c4575979f5eea5e8aad6eb54bf45d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-pp39-pypy39_pp73-macosx_10_9_x86_64.whl

Download URL easysnmp-0.2.6-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Size 1.4 MB
Tags PyPy 3.9 PyPy 3.9 7.3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
9fc6dee930f31d34cf37153dccc2df343afc3aaa2cd35bf0d54250f61b6f7d96
BLAKE2b-256 checksum
How to use checksums
4634f9f548c4b32d1b1861a7437e67f9039fec88ceb7b74c0ca0cc1540329b4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-pp38-pypy38_pp73-macosx_10_9_x86_64.whl

Download URL easysnmp-0.2.6-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Size 1.4 MB
Tags PyPy 3.8 PyPy 3.8 7.3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
a57b2fe7c8f49b0bacb12214f0fb952ffed4a40326faa30dc417f04a68d2fb2d
BLAKE2b-256 checksum
How to use checksums
a6e236d2df30665aacd87d202a7ebde435698fb2b2dd3d87e2186fb26373517e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-pp37-pypy37_pp73-macosx_10_9_x86_64.whl

Download URL easysnmp-0.2.6-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Size 1.4 MB
Tags PyPy 3.7 PyPy 3.7 7.3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
41273ce4e073847441eb9e9b576d3018c11916fa6ef33dbdbe995830c9711bf3
BLAKE2b-256 checksum
How to use checksums
543e2df8190be076d6e1adaa150c0acc33a52b95c7597fa7332b0014f437f6ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-cp310-cp310-manylinux_2_24_x86_64.whl

Download URL easysnmp-0.2.6-cp310-cp310-manylinux_2_24_x86_64.whl
Size 1.5 MB
Tags CPython 3.10 Linux glibc 2.24+ x86-64
SHA-256 checksum
How to use checksums
f76feb57e2649ae38ccfd5fd03d695b35734c1217151ca5d868fd0efe5849c46
BLAKE2b-256 checksum
How to use checksums
69b31313e7366a976e4ae0ff6f7977f691f9b332fa5257278bbaabcb715222ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-cp310-cp310-macosx_10_9_x86_64.whl

Download URL easysnmp-0.2.6-cp310-cp310-macosx_10_9_x86_64.whl
Size 1.4 MB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
e7a1a0f7b9672a132b22a486117781285c22faa5fe55d9a53e57ba79eb28f92e
BLAKE2b-256 checksum
How to use checksums
dece01a6d7fa1650a37963ff933dc91b9db3d66a23c44ac74a0551e546260a43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-cp39-cp39-manylinux_2_24_x86_64.whl

Download URL easysnmp-0.2.6-cp39-cp39-manylinux_2_24_x86_64.whl
Size 1.5 MB
Tags CPython 3.9 Linux glibc 2.24+ x86-64
SHA-256 checksum
How to use checksums
6600d7be6a01e7339887e01e99651cc3654bacf5579660ad25a92f874a5c2f31
BLAKE2b-256 checksum
How to use checksums
b94c5945dacb7672df5fdf56f0f456d9ca1615352f676ee89e30fba161e090e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-cp39-cp39-macosx_10_9_x86_64.whl

Download URL easysnmp-0.2.6-cp39-cp39-macosx_10_9_x86_64.whl
Size 1.4 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
d50fe515e5f5e04967deabddf56f343727a0c223013342e9ac96db6cc36a14e1
BLAKE2b-256 checksum
How to use checksums
d280907aaa82f3427b73064cb04b1b93040f426dd835f559f4d2ebc863c39f4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-cp38-cp38-manylinux_2_24_x86_64.whl

Download URL easysnmp-0.2.6-cp38-cp38-manylinux_2_24_x86_64.whl
Size 1.5 MB
Tags CPython 3.8 Linux glibc 2.24+ x86-64
SHA-256 checksum
How to use checksums
081b1d11662c94a621867514c5111484039011945c83eb0b25778c3992c1fdaa
BLAKE2b-256 checksum
How to use checksums
0c60f4bffda46f1f9e5b39ec7ec0e8b40e29346b78104f112d5e6ed36035f1d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-cp38-cp38-macosx_10_9_x86_64.whl

Download URL easysnmp-0.2.6-cp38-cp38-macosx_10_9_x86_64.whl
Size 1.4 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
a2f772217278cf7e4176ae25c171f44533b5e31d8f6c88202ea99a08a806aeb7
BLAKE2b-256 checksum
How to use checksums
145369c6a1e74314665fd77081a5060a0d56b3ffce094de42ad6a49e0677b535
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-cp37-cp37m-manylinux_2_24_x86_64.whl

Download URL easysnmp-0.2.6-cp37-cp37m-manylinux_2_24_x86_64.whl
Size 1.5 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.24+ x86-64
SHA-256 checksum
How to use checksums
e1df508e28aa055bd7deeb13394d7821b6d341a9eacce5aefbc4a8c143801ff8
BLAKE2b-256 checksum
How to use checksums
d32c52923cc205b5836fb4b3f94fb50cccbc98753d59fe83562c8480dec542ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL easysnmp-0.2.6-cp37-cp37m-macosx_10_9_x86_64.whl
Size 1.4 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
d5e98cbbe57b8198c0e79cec1d6c0ef567f91375f2e720a001db8990363958d5
BLAKE2b-256 checksum
How to use checksums
11da539aedacf8e94cc5f6fbee9dcdb07c6fc9892fd38387cec5a507e1e4a873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-cp36-cp36m-manylinux_2_24_x86_64.whl

Download URL easysnmp-0.2.6-cp36-cp36m-manylinux_2_24_x86_64.whl
Size 1.5 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.24+ x86-64
SHA-256 checksum
How to use checksums
e6a2e97cd69fdb73a92f626a56ff022f909884e65dc1958ce9d77677aa69af57
BLAKE2b-256 checksum
How to use checksums
ed2f39a18f8beede767905e7d9ec421c160539e9958d897e7b69a47c6ba45c70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / easysnmp-0.2.6-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL easysnmp-0.2.6-cp36-cp36m-macosx_10_9_x86_64.whl
Size 1.4 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
6eed5df81a2fff46aa8035bfdc66fda1da525e7cd7159676ab264f1ab3a55897
BLAKE2b-256 checksum
How to use checksums
ab6556568f386c62251dd8b83af943f5da4830fc39475eb140ec2b32cecf71d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.2.6 This release

14 release files

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page