A blazingly fast and Pythonic SNMP library based on the official Net-SNMP bindings.
Project description
Artwork courtesy of Open Clip Art Library
Introduction
Ez SNMP is a fork of Easy SNMP
Why Another Library?
Quick Start
There are primarily two ways you can use the Ez 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 ezsnmp 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 Ez SNMP via its simple interface which is intended for one-off operations (where you wish to specify all details in the request):
from ezsnmp 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 Ez SNMP documentation at. This includes installation instructions for various operating systems.
You may generate the documentation as follows:
# Install Sphinx
# See this website for install instructions https://www.sphinx-doc.org/en/master/usage/installation.html
# Build the documentation into static HTML pages
cd sphinx_docs_build
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
Kent Coble: who was the most recent maintainer. Easy SNMP
Running Tests
Tests use Pytest. You can run them with the following on Linux:
git clone https://github.com/ezsnmp/ezsnmp.git;
cd ezsnmp;
sudo apt update && sudo apt upgrade -y;
sudo apt install -y snmpd libsnmp-dev libperl-dev snmp-mibs-downloader valgrind;
sudo apt install -y python3-pip python3-dev python3-setuptools gdb -y;
sudo systemctl stop snmpd;
sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig;
sudo cp tests/snmpd.conf /etc/snmp/snmpd.conf;
sudo download-mibs;
mkdir -p -m 0755 ~/.snmp;
echo 'mibs +ALL' > ~/.snmp/snmp.conf;
sudo systemctl start snmpd;
rm -drf build/ dist/ ezsnmp.egg-info;
python3 -m pip install -r requirements.txt;
python3 setup.py build && python3 -m pip install -e . && python3 -m pytest .;
# Bottom one for debug. Replace the top one with it if needed.
# python3 setup.py build && python3 -m pip install -e . && gdb -ex run -ex bt -ex quit --args python3 -m pytest .;
On MacOS
git clone https://github.com/ezsnmp/ezsnmp.git;
cd ezsnmp;
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig;
cp tests/snmpd.conf /etc/snmp/snmpd.conf;
launchctl unload /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist;
launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist;
rm -drf build/ dist/ ezsnmp.egg-info;
python3 setup.py build && python3 -m pip install -e . && python3 -m pytest .;
License
Ez SNMP is released under the BSD license. Please see the LICENSE file for more details.
Copyright
The original version of this library is copyright (c) 2006 G. S. Marzot. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Net-SNMP itself.
Copyright (c) 2006 SPARTA, Inc. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Net-SNMP itself.
Copyright (c) 2024 carlkidcrypto All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Net-SNMP itself.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for ezsnmp-1.0.0b0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d05d150f2caa0bd48f01f7c9051e902bedec88a5ffdd1b7319069e1c2c4e873 |
|
MD5 | 07001ea2fdeed56547c418ac0a21b208 |
|
BLAKE2b-256 | 47203cfefbcedcd01f0eaa03344eb1ce2f0e178fefac924c4b91f54a3de9044f |
Hashes for ezsnmp-1.0.0b0-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 996efeb3a3347969eda73194596f0179b8bc0af7c53a4bf40ff9a30e11a98f93 |
|
MD5 | 7c19144c1eb150816156c6add43084eb |
|
BLAKE2b-256 | d3745747990cedca524548ed4584ac3dd3c5afed29a0d735af0444d45956d5d2 |
Hashes for ezsnmp-1.0.0b0-pp310-pypy310_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b05177460948a22419b3b04bc98f72bdaf275cb61a881d5954ebc1fa3770b804 |
|
MD5 | 2a3d3c3e9b2572025cca9502095cc971 |
|
BLAKE2b-256 | 250233a19a917d4b06e7ae0b1610f3c88383616f2cd8cd9ea9ac8b57a04d192d |
Hashes for ezsnmp-1.0.0b0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e300c84cc471b0e20b66ccb7de655da5d3dd93e1a59730f088b02bb367b053cb |
|
MD5 | a5c14d3910365efd721792f002166b8b |
|
BLAKE2b-256 | 48b5423879ccc3106e838c081c5f3541905374b42340e8157502c06bc2149be3 |
Hashes for ezsnmp-1.0.0b0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 946fbba69c10f9614b13fb1c6dd939861055b5968ef158ffd82f5dfc8c60a76f |
|
MD5 | 9b6f6f54add73201097095776c86a68d |
|
BLAKE2b-256 | 20f52a15b284bf154fe03391a0351038ae2857fe644a4e67f119dff5c85c8354 |
Hashes for ezsnmp-1.0.0b0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77826bf325ec52e1d44cbc74b037720182f3892dd7c8307de5a582a9c6f26cee |
|
MD5 | 9561788aa0b5e1e0b6b70b8c7d4f6217 |
|
BLAKE2b-256 | d47a6284f2af9bdfc385ef6d5858105a609307819af8b5b0af18a80de5ea5f77 |
Hashes for ezsnmp-1.0.0b0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f315f786e61c3aa8f72b9d3efd9d9c3d7a672be74c0d131e3a0d21b5397945e0 |
|
MD5 | d89fd25c704dfe42d0501926cd201a8c |
|
BLAKE2b-256 | 8981daf68f24e95ef80466f7637f39d0b924adcae0f27014b474d2fe4baf3ada |
Hashes for ezsnmp-1.0.0b0-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d946081545eb86212ef189d97f5e390bb24cd06ae801e50a31454ea64eba2b9b |
|
MD5 | 946a61011314b560fff12471ccabfa27 |
|
BLAKE2b-256 | 9bd6bdcd20be4045e8546d33f8121aaacf41c0591aa820867a5e31e36d33e40a |
Hashes for ezsnmp-1.0.0b0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84208a173f06a550fd45240d1bc1fd9acd66f9ebbcf4552a968f92c26622bb1f |
|
MD5 | 98ab423934fa9c6875e4611b24d82070 |
|
BLAKE2b-256 | 26a0e69e0b4b8a7e35168a11ec7cf9adb8bea8e33e4b0c7b1c7f907d5c014260 |
Hashes for ezsnmp-1.0.0b0-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e3f0abd022679926c2013be773acd58328f440e5cb90f6ce69dfd604eb1b3a0 |
|
MD5 | 60e29980ab033b6075b8552e989fda07 |
|
BLAKE2b-256 | 839e01e47508d286ca147a8be5cc1ca487f09897d71f7ea7ba07252586df85e0 |
Hashes for ezsnmp-1.0.0b0-cp312-cp312-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e48fe6b40b09ca74e0543d5356e4852570e134c4287f82997bbbc8d9c5efad9 |
|
MD5 | ca713c2432ac6187c4d0059e0d4428b3 |
|
BLAKE2b-256 | 768b542d459a82c93618efe360ad4a10d7b7ace2a3ca3af838cf97521df91156 |
Hashes for ezsnmp-1.0.0b0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cd69936c464e5660e2dadd7ec5e4b9d74d263e65b8d160add67d93b41bc4b82 |
|
MD5 | c8bff30a624851a1f57769addbe0512a |
|
BLAKE2b-256 | e87688fb11402dadd4510e396e31edbd3214dd0387c302017c516249a150c24b |
Hashes for ezsnmp-1.0.0b0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f76882d2c1c88a13078c70e34de7714e6ca385473bd703f039672f012b2f257 |
|
MD5 | 4683d79e0e161e0af803ab9d84e2e021 |
|
BLAKE2b-256 | 8fa4b0bfe0cc2b7ec0da5f9b0ff9e4124b579b563d5973cb94f799e49690a4af |
Hashes for ezsnmp-1.0.0b0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9da33d6df2d8da64b517c0408ba1f1d1ab9c491133ae7b527d88d8c072b85a6 |
|
MD5 | b1a0323755724c0294b36f29d1ff2b0f |
|
BLAKE2b-256 | 9fe7f448662c00c2e2cb5a0d045771114d244a970e7ced5796025920d23e2a5c |
Hashes for ezsnmp-1.0.0b0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b305ff8f8db082682a5b64fb64c5cdb432e159685e2edba9577f32f7950e1f26 |
|
MD5 | de470a80b6ba13c4374408501e8a4fa6 |
|
BLAKE2b-256 | 82df5281c1835ef9f7aac4134fb52d21a369e023b5728d2f08120c5c0dac9f48 |
Hashes for ezsnmp-1.0.0b0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe0cfdc5f0431144eac93b1528ade045e201884ed4f25db66bf2a47ddab6f65b |
|
MD5 | b58bb89e46c01812136992428f38e47f |
|
BLAKE2b-256 | b94329aaf374302eb299c499d7f9dcae08f2af59b7c32cf875b24a5254e4b7e1 |
Hashes for ezsnmp-1.0.0b0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c0b4cd4e66baa5038b2c546dabacc19b6c8d6605dbc1300fa87f0ef30361941 |
|
MD5 | 34f941263aef92616711e02a90ceef14 |
|
BLAKE2b-256 | 6b0ff6ac5a368f303ce99b7649ec9bf8f396c926a558d4bcba995ef4aa7687e8 |
Hashes for ezsnmp-1.0.0b0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 128fe930c3deb15ec34190e55c47979aea071d99f7687eb01596e675cd2b5206 |
|
MD5 | 4d7a2d88fae66cd87a5f8496608ef112 |
|
BLAKE2b-256 | e8bb8f731b7e92528c057ec57a6491ac55f3450d6682d474de4db7044a183707 |
Hashes for ezsnmp-1.0.0b0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0647900cce6347ffad6cf70371cb184f5a76738167434af292285c6b93cdf4c3 |
|
MD5 | 7b95821535919b44f726ece226d3be29 |
|
BLAKE2b-256 | f0f33d775148dd1afc534ac3b8e5a577661a1c87b2801353a1f5e0d2a857f632 |
Hashes for ezsnmp-1.0.0b0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37d46ed7a0ea19fdf740c3aca4469f6f69d527716ec191101e559dd4d8eb7162 |
|
MD5 | 86b4921c8beafee5917babb221ad6351 |
|
BLAKE2b-256 | 63e788f885878dea4dc84d2aadb80aab529af9086bec32988926b0b5d0e0b4df |
Hashes for ezsnmp-1.0.0b0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05410db6adae1ce8addd0ff3b5bf54b3828f967acd2ba605a7f5387937fcf821 |
|
MD5 | b973e8942433e242e841b6dd01a9f996 |
|
BLAKE2b-256 | c23c73024309eaf70fe21e909d38ae82dabfae5e981e7c2a1f4bc84c5eab6977 |
Hashes for ezsnmp-1.0.0b0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a91a0d492f49dc1bccccf96ec721bff7e88943d2b42a25972ec100759e09df67 |
|
MD5 | 4a4d903f6587038a8240828b0858a11c |
|
BLAKE2b-256 | 6bf4509e95acba9dced00e95cb31e226b7b9b110efce8919772717a00c961b26 |
Hashes for ezsnmp-1.0.0b0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee31f9b5356638fe416d96ae2f063e1a4079d474914b2810aefbb389e311164c |
|
MD5 | d8282259f816b183b92d2cf0fdc4b15c |
|
BLAKE2b-256 | 1761c755d41105a0860eac5aa8797902cb96e17fb9db1b51ad5f3c569b9332a0 |
Hashes for ezsnmp-1.0.0b0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 123b6fd4218a82e01488cfe3c10110b99af832d7cc7382b23b787f4bdeb004bd |
|
MD5 | 84c86a77e2ff81385135ccf85028efab |
|
BLAKE2b-256 | 9c22a345864640ef8cd117bc4839ce6d825fb502e059961d938ac36d46697cb6 |
Hashes for ezsnmp-1.0.0b0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba35bd48c890a8a0deb9a6f941cbd59cf728cdde203a49fc44509da533c8338e |
|
MD5 | 26ddaf0fa762370bfb00d38a634891a6 |
|
BLAKE2b-256 | f2db867ed6cb90d44a2a2b1b6db117d2cf0bdd81cc59ce2e477b09a27d7f3926 |
Hashes for ezsnmp-1.0.0b0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bce4238adc390d8b8c2938cb238982b795f2224fbe6c53419c3968121239aa79 |
|
MD5 | ff7bc0c900b25a691e2a7a2dd95c8511 |
|
BLAKE2b-256 | a795a1a0be131088461cd897b56e7d2c0c31149abecd42229ee775d4dd9fa8cb |
Hashes for ezsnmp-1.0.0b0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7c7eb81ed3cf865360c741494770196d07fdbf0734eaa645e4a44880200112f |
|
MD5 | ceafd4fad337b6a77d3f5d9d2d4fcf38 |
|
BLAKE2b-256 | 60ab7f931fd2e5d17ced6ed30309e68ad0c20d5a8d5077a7d3014f7ab6d0638b |
Hashes for ezsnmp-1.0.0b0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81ad9ed5e57839b24c5c8b8e749ea9f8a03bfbc5d4c2f2debcf93b1159c68655 |
|
MD5 | 4a6cedd13eed2a8340bdd7ab199e3c10 |
|
BLAKE2b-256 | 962ec138be12f10c70c891a85d336be0dc98098fc82d4558eb5d98852b80bfac |
Hashes for ezsnmp-1.0.0b0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23bab1a4112cf550b47febdaa31466e0c0a1be4ce8ba7d59849512bc0897b61e |
|
MD5 | 60ad2e893f94bbef0c4c8b67c8ee6cbd |
|
BLAKE2b-256 | a97dd414b9d1726216b1f3106160bbbfecb33dc0453ef20634438f6dcf88c461 |
Hashes for ezsnmp-1.0.0b0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b2f9de8d2be22f571a4cf7a6496874d7ae3b0f5956d9329099b7d79eea7f082 |
|
MD5 | b9444283fc1d6bb5a9af7e233dfb83c6 |
|
BLAKE2b-256 | be9718cc295d68282a2a8dc840a04c9b7dea183cc835a8ccf12bed8340dd64d7 |
Hashes for ezsnmp-1.0.0b0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6f1ffb3181ede6d15fc8906ce51ccdbcad024a90dd4c08398067758ca8252a4 |
|
MD5 | b44d483bad99e787c1965aee1c8a32de |
|
BLAKE2b-256 | d9480cefa5808dceb495cf095c0b2791a6aaf76ebe2570cd9a52cfc08fa69d65 |
Hashes for ezsnmp-1.0.0b0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88a763e521f45d87e7ab917341f4162fdf0d374c22b7816e27540d94576f607e |
|
MD5 | 4109ae84d6d156a02db0b868c1a9fed6 |
|
BLAKE2b-256 | 47d69da176ed5c2fd5fa41ef76fabe21745dcdbf4fce10c9a3164dd96dfa23e4 |
Hashes for ezsnmp-1.0.0b0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f98e1ee67230a8f2c13c308616c52182fe4ef0b0283dc57e4362c693e13daefa |
|
MD5 | 6ad5b45636c26fc70877d7c80bc82400 |
|
BLAKE2b-256 | e165e9c58f23d5c1bb142f594dea7b3365076951052146819cc41ea7cfac861f |
Hashes for ezsnmp-1.0.0b0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33511805de4ac36db24026c5f1f4e0afb9680d4beedf10f5297d8e00df5e30c0 |
|
MD5 | 193592ad350620c55fa22d559782ad2a |
|
BLAKE2b-256 | 35d1b0e3640f389f8989be35fac7c03d618240608fcf176dceca739d1ee00a45 |