Table Operations

SNMP defines tables within the MIBs. These tables are indexed by one or more index columns and contain several value columns (of different types).

The following table is a simplified view of an SNMP table within an agent:

Simple Table

ifIndex ifDescr ipOperStatus ifSpeed ifInOctets ifOutOctets
1 Lo0 1 (up) 100 Mb 1,000,000 3,000,000
2 Eth1 1 (up) 10 Mb 200,000 400,000
4 Eth2 2 (down) 768 Kb 0 0

The first column ( ifIndex ) represents the key column. Values inside the key column are unique; this represents the primary key of the table. If you know one value in the key column (for example, ifIndex=2 ) and the name of a value column (for example, ifSpeed ), you can unambiguously access a table cell (for example, ifSpeed.2 = 10 Mb ).

Some tables have a more complex structure where the primary key is made up of two columns. Values in each column of the key do not have to be unique -- only the pairs formed by the two values must be unique. Consider the following table:

Complex Table

frCircuitIfIndex frCircuitDlci frCircuitState frCircuit Throughput frCircuitSent Octets frCircuit Octets
2 201 2 (active) 100 Mb 1,000,000 3,000,000
2 202 2 (active) 10 Mb 200,000 400,000
4 401 1 (inactive) 768 Kb 0 0

To unambiguously access a table cell, you must know the two values that correspond to one entry in the primary key (for example, frCircuitIfIndex = 2 AND frCircuitDlci = 202 ) and the name of a value column (for example, frCircuitThroughput ). Therefore, the cell definition would be:

frCircuitThroughput.2.202 = 10 Mb

The formula language provides a way to retrieve pieces of these SNMP tables, one column at a time, and either manipulate them or store them in temporary variables. When pieces are retrieved, the full corresponding primary key is also retrieved and kept with the retrieved value.

For example, using See Simple Table, ifSpeed.%I1; where I1 = *; would retrieve:

I1 ifSpeed
1 100 Mb
2 10 Mb
4 768 Kb

Note that the name of the variable that is used to specify the scope of the retrieval (in this example, %I1 ) becomes the name of the key column. Because the retrieval is done on a single column, there can only be one result ( IfSpeed ) column, but there can be several key ( I1 ) values. Throughout this guide, a result table like this is called a vector because it contains only one column besides the key column.

Pieces of the table can then be:

  • Combined with operators to produce new values
  • Filtered or sorted
  • Truncated using aggregation
  • Displayed, returned, or used to populate properties during the discovery phase