Using the SNMPWALK -o Option

Instead of writing the voluminous results of the SNMPWalk to the Debug log, InterMapper can write the results to an SQLite file. To use this feature, you use the -o option.

When you use the -o option, snmpwalk stores its output into an SQLite database. To use this feature, you specify the name of the database file following the -o option.


To create an SQLite3 database named "foo" and store the snmpwalk results there, use the following "server command":

snmpwalk -v1 -c public -o foo switch 1.3

This writes the output to an SQLite database file named "foo", located in InterMapper Settings/Temporary directory. The database file named "foo" may contain multiple snmpwalk's. The file is created if it doesn't exist.

When the -o option is used, only these four lines are written to the Debug log:

SNMPWalk command received: 'snmpwalk -v1 -c public -o foo -n 10 switch 1.3'
  SNMPWalk 3: prefix 1.3 (version SNMPv1 ...
  SNMPWalk on switch started
  SNMPWalk 3: Finished (10 OIDs ...   



Here is the schema used for the snmpwalk database:

     id           INTEGER PRIMARY KEY,
     address      TEXT,
     port         INTEGER,
     startOid     TEXT,
     snmpVersion  INTEGER,
     pktTimeout   INTEGER,
     pktRetries   INTEGER,
     maxOids      INTEGER,
     toEnd        INTEGER,
     timeStarted  INTEGER,
     timeFinished INTEGER,
     oidCount     INTEGER,
     stopReason   TEXT

   CREATE TABLE results (
     walk_id      INTEGER,
     name TEXT,
     oid          TEXT,
     type         INTEGER,
     value        BLOB

Table: walks

The walks table stores one row for each snmpwalk command. Each walk will receive a unique id that is used to identify it (id). The other columns are:


the address of the snmpwalk target device


the udp port number of the snmpwalk target device


the starting OID specified in the snmpwalk command


the SNMP version specified


the packet timeout specified


the packet retry count specified


the maximum number of OID's specified


a boolean flag indicating that the walk should proceed to the end (i.e. don't limit by startOid).


the UTC timestamp when the walk was started


the UTC timestamp when the walk was completed


the number of OID rows walked


text indicating the reason the walk stopped where it did

Table: results

The results table stores a row for each entry of one snmpwalk, as specified by id in the walks table.


the id of the walk (references


the text of the OID naming the SNMP variable


the ASN.1 type integer for the SNMP variable


the actual, uninterpreted binary value returned by the SNMP agent

Accessing the SQLite Data

On Mac OS X 10.4, you can use the built-in sqlite3 command to access the data in the SQLite database file:

  $ sqlite3 foo

  sqlite> .mode csv
  sqlite> select * from walks;
  1,"",161,1.0,0,10000,3,2000,0,1178801645,1178801685,0,"No answer received"
  2,"",161,1.3,0,10000,3,2000,0,1178801708,1178801895,2000,"Finished (2000 OIDs found)"
  sqlite> select count(*) from results where walk_id = 1;
  sqlite> select count(*) from results where walk_id = 2;
  sqlite> select * from results where walk_id = 2 order by oid limit 5; 
  2,"",4,"HP J4813A ProCurve Switch 2524..."
  2,"",4,"Bill Fisher"
  2,"",4,"HP ProCurve Switch 2524"

There is a Firefox add-on called "SQLite Manager" that opens and displays SQLite database files. This makes it a cross-platform tool, requiring only Firefox 3.5 or greater, plus a small download.

To install SQLite Manager:

  1. Start Firefox 3.5 or newer - Tools -> Add-ons - Click Get Add-ons
  2. Enter "SQLite" into the Search field and press Return.
  3. Double-click the "SQLite Manager" item to install it. Restart Firefox when instructed.

To use SQLite Manager:

  1. Tools -> SQLite Manager to open it.
  2. Use the Database -> Connect Database (within the window) to open a saved SQLite database
  3. Click the results table to view it.