SNMP Simulator Project Logo
SNMP Simulator introduction
Producing SNMP snapshots
Simulating SNMP Agents
Transport-based variation
Sharing snapshots
MIB-based simiulation
Simulation based on captured traffic
Simulation with variation modules
Recording with variation modules
Managing data files
Large scale simulation
Tips and tricks
Download & Install
Github repo
Adding features
Simulation Service
Get SNMP Simulator at Fast, secure and Free Open Source software downloads

Simulation based on MIB files

Besides using tool for making snapshots off your donor device, the other way to produce data files is to run the tool against virtually any MIB file. With that method you do not have to have a donor device and the values, that are normally returned by a donor device, will instead be chosen randomly.

Keep in mind that you may run into either of two issues with these randomly chosen values:

  1. Some MIB data suggest certain correlation between formally unrelated pieces of information. Such relationships may be described informally, e.g. in natural language in the Description field. The automated values generation procedure has no chance to assure proper correlations, in that case the overall snapshot may appear inconsistent.
  2. Some data types specified in the MIB may impose certain restrictions on the type instance values. For example an integer-typed Managed Object may be allowed to be either 0 or 12. If a guessed value turns out to be 2, it will be incompatible with this type. While it is possible to introspect type objects and generate a compliant value, the tool does not do that [yet]. A non-compliant value will result an exception on MIB node instantiation. In that case the script will revert to an interactive mode and ask you for a compliant value.
  3. When building snapshots from MIBs, rather then recording them off a prototype device, you are not simulating the actual values device is producing. In other words, with MIB-based simulation you can only simulate the collection of OIDs, not their combined values which are characteristic to particular device you wish to simulate.

On the bright side, the tool will respect Managed Object type (e.g type associated with the OIDs), and produce valid indices for the MIB tables.

Device file generation from a MIB file would look like this:

$ -h
  Converts MIB modules into SNMP Simulator data files.
  Takes MIB module in PySNMP format and produces data file for SNMP Simulator
  to playback. Chooses random values or can ask for them interactively.
  Able to fill SNMP conceptual tables with consistent indices.
Usage: scripts/ [--help]
    [--pysnmp-mib-dir=<path>] [--mib-module=<name>]
    [--start-oid=<OID>] [--stop-oid=<OID>]

Here we produce values for a portion of OID space of SNMPv2-MIB:

$ --mib-module=SNMPv2-MIB --start-oid= 
# MIB module: SNMPv2-MIB|4|Portez ce vieux|6||67|350728093|4|whisky|4||4|whisky au juge blond|2|4|67|3138976393
# End of SNMPv2-MIB, 8 OID(s) dumped

As you can see, values are autogenerated and would still benefit from manual improvement.

The tool can also generate values for SNMP conceptual tables. It's doing that by iterating over table definition in MIB for specified number of times.

Assuming the IF-MIB module in ASN.1 format could be found at typical locations on local filesystem (e.g. /usr/share/snmp/mibs/IF-MIB.txt), otherwise it could be downloaded from a MIBs repository, the following command will analyze given MIB and produce two rows for IF-MIB::ifTable table:

$ snmptranslate -On IF-MIB::ifTable

$ --mib-module=IF-MIB --start-oid=
--stop-oid= --table-size=2
# MIB module: IF-MIB
# Starting table IF-MIB::ifTable (
# Synthesizing row #1 of table
# Finished table (2 rows)|2|12|2|26|4|vieux whisky|4|ce vieux whisky au juge|2|29|2|1|2|28|2|16|66|3029607807|66|3150811331|4||4||2|1|2|1|2|6|2|5|67|2871454194|67|496156868|65|1488410552|65|3473823260|65|1727276906|65|342963679|65|1511248359|65|2207653511|65|4226165132|65|36536957|65|130591184|65|1852726355|65|3301920138|65|470729731|65|4148984503|65|953020685|65|1569764479|65|2095562772|65|238446444|65|3268308217|65|3230500934|65|566234076|65|3549197996|65|2834484035|66|68812076|66|1903146216|6||6|
# End of IF-MIB, 44 OID(s) dumped

The range of values for automatic and random selection can be controlled on a per-type basis with the --counter-range, --counter64-range, --gauge-range, --timeticks-range, --unsigned-range, --integer32-range options. Words for strings generations can be passed via --string-pool option. For example:

$ --mib-module=UDP-MIB --table-size=1 --counter-range=0,100
# MIB module: UDP-MIB
# Starting table UDP-MIB::udpTable (
# Finished table (1 rows)
# Starting table UDP-MIB::udpEndpointTable (
# Finished table (1 rows)|65|66|65|49|65|91|65|14|64x|a99468e1|2|14|2|4|4||66|127|2|2|4||66|137|66|182|66|185|70|9808059939656837207|70|10931009272993024622
# End of UDP-MIB, 16 OID(s) dumped

If you wish to specify each value rather then rely on automatic random selection, use --manual-value command line switch. If you would rather have tool to work out all the values by itself, consider raising the --automatic-values max probes value (default is 5000 probes).

Finally, you could always modify your data files with a text editor.

Need help? Open an issue at GitHub or ask question at Stack Overflow or try browsing snmpsim-users mailing list.