Fork me on GitHub

Project Notes

Python SNMP Servers

Researching simple pure Python SNMP Server options


This is just a quick scan to see whether therre are any decent SMPN server implementations in python.

tldr: not really


A quick search didn’t bring much joy. My short-list after a bit more research:

  • snmp-agent - experimental and minimal SNMP Server implementation.
  • pytest-snmpserver SNMP server as a pytest plugin
    • I suspect based on snmp-server however the versions are not aligned, and the egg version does not contain an SNMP server that can be run stand-alone

Inspecting pytest-snmpserver

Get the source distribution from pytest-snmpserver

echo "pytest_snmpserver-0.1.9.tar.gz" >> .gitignore
tar zxvf pytest_snmpserver-0.1.9.tar.gz

Inspecting pytest_snmpserver-0.1.9/pytest_snmpserver/ and unfortunately it is hard-coded to run on a specific port and expect a specific request, so not suitable for stand-alone use.

Using snmp-server

The snmp-server project on GitHub has a simple pure-python SNMP server.

I believe that the pytest-snmpserver egg is based on this project, however the versions are not aligned, and the egg version does not contain an SNMP server that can be run stand-alone

However rhe snmp-server does run stand-alone…

Installing Requirements

This is not distributed as an egg, so installing and running from source.

Just need to clone the repo:

$ echo "snmp-server" >> .gitignore
$ python --version
Python 3.7.3
$ git clone

Running the SNMP Server

$ cd snmp-server
$ python -p 7161 DeprecationWarning: Using or importing the ABCs from 'collections' instead of from '' is deprecated, and in 3.8 it will stop working
  from collections import Iterable
SNMP server listening on

Testing with snmp cli

$ snmpget -v 2c -c public iso. = STRING: “”

$ snmpwalk -v 2c -c public iso. = STRING: “”

Credits and References

About LCK#225 pythonSNMP
Project Source on GitHub Return to the Project Catalog

This page is a web-friendly rendering of my project notes shared in the LittleCodingKata GitHub repository.

LittleCodingKata is my collection of programming exercises, research and code toys broadly spanning things that relate to programming and software development (languages, frameworks and tools).

These range from the trivial to the complex and serious. Many are inspired by existing work and I'll note credits and references where applicable. The focus is quite scattered, as I variously work on things new and important in the moment, or go back to revisit things from the past.

This is primarily a personal collection for my own edification and learning, but anyone who stumbles by is welcome to borrow, steal or reference the work here. And if you spot errors or issues I'd really appreciate some feedback - create an issue, send me an email or even send a pull-request.