Command-line SNMP tools#
This is the collection of command-line SNMP tools written in pure-Python and tightly aligned with the de-facto standard SNMP tools that come with Net-SNMP e.g. snmpget, snmpwalk and many others.
In most cases, you should be able to alternate between Net-SNMP tools and the tools provided by this project without changing much at the command line.
The goals of this project is to bring SNMP tooling to a wider range of computing platforms and ease introducing new SNMP features by leveraging the high-level programming language.
These SNMP tools are free and open-source. Source code is hosted in a GitHub repo and distributed under 2-clause BSD-style license.
Quick start#
If you understand SNMP and have some experience with the Net-SNMP tool set, you do not need to learn much. Just install snmpclitools and run the SNMP tool you want.
For example, Net-SNMP works like this,
$ snmpget -v2c -c public demo.pysnmp.com sysDescr.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux zeus 4.8.6.5-smp #2 SMP Sun Nov 13 14:58:11 CDT 2016 i686
and snmpclitools works like this,
$ snmpget -v2c -c public demo.pysnmp.com sysDescr.0
SNMPv2-MIB::sysDescr.0 = DisplayString: Linux zeus 4.8.6.5-smp #2 SMP Sun Nov 13 14:58:11 CDT 2016 i686
Here and later throughout the examples we will be using the public instance of SNMP agent simulator at demo.pysnmp.com. You are welcome to use it as well. ;-)
All SNMP versions are indeed supported including version 3.
$ snmpget -v3 -u usr-md5-des -l authPriv \
-A authkey1 -X privkey1 demo.pysnmp.com sysDescr.0
SNMPv2-MIB::sysDescr.0 = DisplayString: Linux zeus 4.8.6.5-smp #2 SMP Sun Nov 13 14:58:11 CDT 2016 i686
Note
The SNMP tools support many strong encryption algorithms that have been introduced to SNMP at the later stages of the standards development.
SNMP employs MIB files to describe the structure of the system being managed from the management perspective. Typically, each SNMP-enabled system implements some of the well-known MIBs (such as SNMPv2-MIB) along with some vendor-specific MIBs.
With SNMP tools you can pass MIB module name together with the SNMP object you want to manage. By default, the tool will try to pull required SNMP MIB by name from this large MIB repository, compile the MIB and use the information it contains for building SNMP query.
For example, the snmpget tool in the snippet below will pull IF-MIB file, parse it to find the object ID of the ifNumber object, build and send proper SNMP query:
$ snmpget -v3 -u usr-md5-des -l authPriv \
-A authkey1 -X privkey1 demo.pysnmp.com IF-MIB::ifNumber.0
IF-MIB::ifNumber.0 = Integer32: 2
More information on the supported options can be looked up at the documentation.
Documentation#
Download#
Best way is usually to
# pip install snmpclitools
If that does not work for you for some reason, you might need to read the following page.
Changes#
- Changelog
- Revision 0.7.2, released on Aug 24, 2024
- Revision 0.7.1, released on Jul 16, 2024
- Revision 0.7.0, released on Mar 03, 2024
- Revision 0.6.4, released on Aug 11, 2019
- Revision 0.6.3, released on Apr 14, 2019
- Revision 0.6.2, released on Dec 30, 2018
- Revision 0.6.1, released on Jan 07, 2018
- Revision 0.5.3, released on Jan 06, 2018
- Revision 0.5.2, released on Dec 22, 2017
- Revision 0.5.1, released on Nov 21, 2017
- Revision 0.4.2, released on Aug 09, 2017
- Revision 0.4.1, released on Feb 12, 2016
- Revision 0.4.0, released on Sep 28, 2015
- Revision 0.3.4, released on Oct 05, 2013
- Revision 0.3.3, released on Jan 30, 2013
- Revision 0.3.2, released on Apr 21, 2012
- Revision 0.3.1, released on Nov 06, 2011
- Revision 0.2.11b
- Revision 0.2.11a
- Revision 0.2.10a
- Revision 0.2.9a
- Revision 0.2.8a
- Revision 0.2.7a
- Revision 0.2.6a
- Revision 0.2.5a
- Revision 0.2.4a
- Revision 0.2.3a
- Revision 0.2.2a
- Revision 0.2.1a
- Revision 0.1.1a
- Revision 0.1.0a
- Revision 0.0.3
- Revision 0.0.2
- Revision 0.0.1
License#
Contact#
In case of questions or issues using these SNMP tools, please open up an issue at GitHub. Or just fix it and send us a pull request. ;-)