Skip to main content

SNMP Agent Simulator

Project description

SNMP Agent Simulator

This tool allows you to take the output of an snmpwalk command and then pretend to be the agent that it was gathered from. This can be useful when you’re developing SNMP management tools.


Twisted, TwistedSNMP and PySNMP-SE.

Twisted is available from PyPI and will be automatically installed if you go the route of easy_install or pip. TwistedSNMP and PySNMP-SE are not currently available from PyPI and should be individually downloaded from sourceforge and installed from source.


I recommend installing snmposter within a Python virtualenv. This makes it easier to install on operating systems such as CentOS 5 where the default system Python version is older than 2.5. Due to the dependency on Twisted, snmposter requires Python 2.5 or newer.

The following steps are specific to Red Hat Enterprise Linux 5 or one of its binary compatible distributions such as CentOS.

  1. Install the EPEL repository.

    rpm -ivh
  2. Install Python 2.6 and development tools.

    yum -y --enablerepo=epel install python26-devel gcc
  1. Install, setup and activate virtualenv.

    yum -y --enablerepo=epel install python26-virtualenv
    virtualenv-2.6 /snmposter
    source /snmposter/bin/activate
  2. Install TwistedSNMP dependency.

    tar -xzf TwistedSNMP-0.3.13.tar.gz
    cd TwistedSNMP-0.3.13
    python install
    cd ..
  3. Install PySNMP-SE dependency.

    tar -xzf pysnmp-se-3.5.2.tar.gz
    cd pysnmp-se-3.5.2
    python install
    cd ..
  4. Install snmposter.

    pip install snmposter


Installing will create a command line tool called snmposter. This tool requires root access because it listens on 161/udp and creates loopback aliases to support emulating multiple SNMP agents simultaneously.

The snmposter command takes a single command line argument: -f or –file. The file passed to this option must contain one or more rows with two columns each. The first column should be the absolute or relative path to a file containing the output of an snmpwalk command. The second column should contain an IP address that this snmpwalk data will be exposed on.

Example usage:

source /snmposter/bin/activate
snmposter -f /etc/snmposter/agents.csv

Example contents of /etc/snmposter/agents.csv:


This example usage will cause snmposter to run in the background, create two new IP aliases on the loopback interface ( and, and expose the contents of each snmpwalk file as an SNMP agent on UDP port 161 of the appropriate IP address. If you’re going to be using this frequently I would recommend adding some entries to your /etc/hosts file to make it even easier.

Example additions to /etc/hosts:      cisco-2811      netapp-filer-fa3020

Important Note: The snmpwalk output file that snmposter consumes must be generated with very specific snmpwalk command line options. These options allow snmposter to get the most raw data possible and provides the most accurate simulation.

Example snmpwalk command to generate the above Cisco_2811.snmpwalk file:

snmpwalk -v2c -c public -ObentU localhost .1 > Cisco_2811.snmpwalk

The important command line options are -m none -O enU to get the raw output and ‘-C c’ to ignore out of sequence responses from the switch. (Sometimes this validation error is triggered when walking routing MIBS on some switches)

Don’t worry if you get an error like Cannot find module (none): At line 0 in (none) as this is expected and a result of us trying to load a non-existent MIB.

Project details

Release history Release notifications

History Node


This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
snmposter-1.0.3.tar.gz (5.8 kB) Copy SHA256 hash SHA256 Source None Feb 6, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page