SNMPMAN

Travis CI Codacy Badge Codacy Badge Maven Central License

The SNMPMAN is a command-line application that simulates SNMP-capable devices and was developed to be usable during unit testing. It may be used to test traffic monitoring applications that execute SNMP queries. Due to the lack of flexibility in already existing alternatives, it was developed by the 1&1 Ionos SE to improve flexibility. Therefore the SNMPMAN is highly extendable and will be enhanced over time.

Multiple SNMP agents may be started at once and will run in parallel. The agents running in parallel will return the data queried and save it to a textual walk result file. This file will be created by querying a real device. It is also possible to query several device types at once. The query configuration may contain policies on how to dynamically change the query responses. E.g. the response of an ifInOctets may be incremented with each query to simulate traffic. Several variable modifiers are already in existence for different data types.

Also checkout the SNMPMAN GitHub IO page here!

Usage

You can include the SNMPMAN as a Maven dependency from [Maven Central]().

<dependency>
    <groupId>com.oneandone</groupId>
    <artifactId>snmpman</artifactId>
    <version>2.0.0</version>
</dependency>

In order to start and stop the simulation use this code snippet as an example:

/* 
 * creates a new instance of the SNMPMAN with the specified configuration file 
 * and executes all agents 
 */
Snmpman snmpman = Snmpman.start(new File("configuration.yaml"));
/* ... do something with the agents */

/* stop the SNMPMAN and all started agents */
snmpman.stop();

Installation and building

Prerequisites

Building a fat Jar

In order to build the SNMPMAN you can use Apache Maven to build a far JAR:

mvn clean package

After that you find your JAR in snmpman-cli/target/snmpman-cli-$VERSION-SNAPSHOT-jar-with-dependencies.jar.

Execution

To execute an instance of the SNMPMAN you have to start the execution script and specify a value for the -c or --configuration option that lists the path to the configuration YAML file that will be loaded during execution.

Configuration

The SNMPMAN configuration can be found in two main YAML files ...

You can find some YAML example configuration files within the test resources of this project in this directory.

The third component of the configuration are the walk files for the agents as specified in the agent configuration.

This is a basic overview and more information will be provided on the project's Wiki pages.

Contribution

This section gives some pointers about contributions to the snmpman project. The project is being developed by the community. Maintainers merge pull-requests, fix critical bugs, etc.

If you fixed or added something useful to the project, you can send a pull-request. It will be reviewed and accepted, or commented on for rework by maintainers. Pull-requests are declined if a maintainer closes the request.