PDF

Custom SNMP Views

Create custom SNMP forms and tables that make SNMP device data readable, editable, and easier to interpret.

NetCrunch SNMP Views let you create custom forms and tables for specific SNMP-capable device types. They make raw SNMP variables easier to read, organize, and edit.

There are two types of SNMP views:

  • form views display separate SNMP variables, such as sysLocation or sysUpTime
  • grid views display SNMP tables, such as ifTable

SNMP Views are especially useful when raw MIB browsing is too low-level for everyday monitoring or administration.

Form View

The Form view displays a set of SNMP variables as fields.

name: Example type: form fields: - caption: Description var: type: oid ref: 1.3.6.1.2.1.1.1.0 - caption: Location var: type: oid ref: 1.3.6.1.2.1.1.6.0 writable: true

Editable Field

Add the writable: true attribute to make a field editable.

To edit SNMP values, the node must use a read-write SNMP profile.

Auto-refresh Field

NetCrunch can read a variable periodically.

Add the autoRefresh attribute to refresh the value every given number of seconds.

autoRefresh: 15

This example refreshes the field every 15 seconds.

Concatenated Field

Use a concatenated field to display two SNMP values in one field.

fields: - caption: Machine var: type: concat refs: - type: oid ref: 1.3.6.1.2.1.1.5.0 - type: oid ref: 1.3.6.1.2.1.1.6.0 concat: $1 in $2

The default format for the concat attribute is $1 $2, but you can add text between the variables.

Calculated Field

Use a calculated field to calculate a value from two SNMP variables.

fields: - caption: Total ICMP packets var: type: expr refs: - type: oid ref: 1.3.6.1.2.1.5.1.0 - type: oid ref: 1.3.6.1.2.1.5.14.0 expression: "+"

Possible expressions:

  • + sum
  • - subtraction
  • * multiplication
  • / division
  • % percent calculation
Mapped Field

Use a mapped field when an SNMP variable returns a numeric value that represents a known state.

For example, a UPS may return a numeric code for its current state. A Value Map can translate this raw value into readable text.

fields: - caption: State var: type: map ref: 1.3.6.1.4.1.318.1.1.1.4.1.1.0 lookup: type: map name: apcUPSCurrentState

Table View

The Table view displays a set of SNMP columns.

All specified columns must belong to the same SNMP table. You can join a column from another SNMP table, but the row indexes in both tables must be consistent, or you must specify a lookup reference.

name: Example Table type: grid columns: - caption: Description var: type: oid ref: 1.3.6.1.2.1.2.2.1.2 display: width: 20 sort: asc summary: count - caption: In Octets var: type: oid ref: 1.3.6.1.2.1.2.2.1.10 dataType: int display: width: 20 summary: sum autoRefresh: 15 - caption: Out Octets var: type: oid ref: 1.3.6.1.2.1.2.2.1.16 dataType: int display: width: 20 summary: sum autoRefresh: 15 format: type: convert format: units: Digital from: B - caption: ifType var: type: oid ref: 1.3.6.1.2.1.2.2.1.3

To group data by a column, add the groupBy attribute and specify the column caption.

groupBy: ifType

Column Display Properties

Optionally, you can set default column properties.

display: width: 20 sort: asc summary: count

Available properties:

  • width - default column width
  • sort - default sorting, either asc or desc
  • summary - summary footer. Possible values are count, sum, min, and max
Editable Column

Add the writable: true attribute to make column cells editable.

A read-write SNMP profile must be defined on the node to edit SNMP values.

Auto-refresh Column

NetCrunch can refresh column data periodically.

Add the autoRefresh attribute to refresh all column rows every given number of seconds.

autoRefresh: 15

Concatenated Column

Use a concatenated column to display row values from two SNMP columns in one column.

columns: - caption: Machine var: type: concat refs: - type: oid ref: 1.3.6.1.2.1.1.5.0 - type: oid ref: 1.3.6.1.2.1.1.6.0 concat: $1 in $2

The default format for the concat attribute is $1 $2, but you can add text between the variables.

Calculated Column

Use a calculated column when each row should contain a value calculated from the corresponding rows of two other columns.

columns: - caption: In + Out var: type: expr refs: - type: oid ref: 1.3.6.1.2.1.2.2.1.10 - type: oid ref: 1.3.6.1.2.1.2.2.1.16 expression: "+"

Possible expressions:

  • + sum
  • - subtraction
  • * multiplication
  • / division
  • % percent calculation
Lookup Column

In SNMP, values in one table often refer to values in another table.

For example, the ipNetToMediaIfIndex column 1.3.6.1.2.1.4.22.1.1 of the ipNetToMediaTable table contains the ifIndex of the interface on which the entry is effective.

To display the interface name instead of the raw index, use a lookup reference to ifDescr 1.3.6.1.2.1.2.2.1.2.

columns: - caption: Interface name var: type: lookup ref: 1.3.6.1.2.1.4.22.1.1 lookup: 1.3.6.1.2.1.2.2.1.2

Mapped Column

Use a mapped column when an SNMP table column returns numeric codes that should be displayed as readable text.

A Value Map translates the numeric value into a label, such as Up, Down, Testing, or a vendor-specific state.

columns: - caption: Operational status var: type: map ref: 1.3.6.1.2.1.2.2.1.8 lookup: type: map name: statusUpDown

Joining Tables

You can display columns from different SNMP tables if the row indexing in both tables is consistent. This usually means that the second table extends the first table.

Examples include:

  • ifTable 1.3.6.1.2.1.2.2
  • ifXTable 1.3.6.1.2.1.31.1.1

In the example below, the view displays:

  • ifDescr 1.3.6.1.2.1.2.2.1.2 from ifTable
  • ifName 1.3.6.1.2.1.31.1.1.1.1 from ifXTable

name: Join Example type: grid columns: - caption: ifDescr var: type: oid ref: 1.3.6.1.2.1.2.2.1.2 - caption: ifName var: type: lookup ref: index lookup: 1.3.6.1.2.1.31.1.1.1.1

Value Mappings

A Value Map defines how numeric SNMP values are translated into human-readable text.

Many SNMP devices return numeric status codes instead of meaningful labels. For example, an interface, UPS, printer, sensor, or power module may return values such as 1, 2, or 3. The Value Map provides the corresponding display text, so tables and forms can show readable state names instead of raw numbers.

Optionally, you can assign a color to each mapped value. When a color is specified, NetCrunch shows a colored icon before the display text. This makes states easier to distinguish visually, especially in tables with many rows.

Use Value Maps whenever an SNMP numeric value has a known textual representation.

Typical use cases:

  • Interface status values
  • UPS operating states
  • Printer states
  • Hardware sensor states
  • Power supply states
  • Vendor-specific status codes

For example, the predefined map statusUpDown converts numeric values such as 1 and 2 into readable states like Up and Down.

Value Map in a Table View Column

Use type: map for the variable and specify the map name in the lookup section.

columns: - caption: Operational status var: type: map ref: 1.3.6.1.2.1.2.2.1.8 lookup: type: map name: statusUpDown

Value Map in a Form View Field

The same mapping mechanism can be used in form fields.

fields: - caption: State var: type: map ref: 1.3.6.1.4.1.318.1.1.1.4.1.1.0 lookup: type: map name: apcUPSCurrentState

When to Use Value Maps

Use a Value Map when the raw SNMP value is technically correct but not useful for the operator.

Without a Value Map, the user sees this:

1 2 3

With a Value Map, the user sees this:

Up Down Testing

This improves readability and reduces the need to remember vendor-specific numeric codes.

Data Format

You can format values to make them easier to read.

String Format

You can add a unit or additional text to the value.

format: type: str format: $1 Unit

Scaling

You can multiply the value if necessary.

var: type: oid ref: 1.3.6.1.2.1.2.2.1.16 dataType: int scale: 0.001 precision: 2

Use the precision attribute to limit the number of decimal places.

Conversions

You can configure automatic unit conversion.

For example, if the value is returned in bytes:

format: type: convert format: units: Digital from: B

The displayed value is automatically converted to KB, MB, GB, or another suitable unit.

Possible input units:

  • bytes: B, KB, MB, GB
  • bits: b, Kb, Mb, Gb
SNMP Time

Use the time format to convert SNMP TimeTicks, which are hundredths of a second, into a readable elapsed time.

fields: - caption: Uptime var: type: oid ref: 1.3.6.1.2.1.1.3.0 dataType: time10msec format: type: time format: elapsed

Summary

Custom SNMP Views let you turn raw SNMP data into practical operator views.

Use:

  • form views for selected SNMP variables
  • grid views for SNMP tables
  • concat variables to combine values
  • expr variables to calculate values
  • lookup variables to resolve references between tables
  • map variables and Value Maps to translate numeric codes into readable states
  • format, scale, and precision to improve value presentation

Correctly designed SNMP Views reduce low-level MIB browsing and make vendor-specific device data easier to understand.

custom snmp viewssnmp formattingsnmp formssnmp lookupsnmp tablessnmp viewsvalue mappingsvalue maps