Skip to content

Component: SNMP Metrics

sbengo edited this page Mar 20, 2017 · 29 revisions

SNMP Metrics

This component allows the user define core metrics to be collected from the device.

View

Configured SNMP Metrics are shown as table. This will appear every time you navigate from menu.

SNMP Metric List

Add/Edit OID Conditions

  • Add: In the OID Conditions list click on new button New Button

  • Edit: Click on OID Condition edit's button Edit Button

The Create/Modify form will show up:

Create/Modify SNMP Metrics

Configuration Parameters

Config Parameter Description
ID Text String that uniquely identify the metric recommended use the MIB Name, should be unique in the database
FieldName Set the "field" name inside a Influx measurement, could be the same of id or not, should be unique inside the measurement where the metric will be sent.
IsTag If true data will be sent as a Influxdb "TAG". (default is false)
BaseOID Snmp OID for this metric ( could be the base OID when it belongs to a snmp indexed table), could not be set only if datasrctype is of type "String Eval".
DataSrcType Origin data type could be one of these:
  • (SNMP SMI Type) INTEGER
  • (SNMP SMI Type) Integer32
  • (SNMP SMI Type) Gauge32
  • (SNMP SMI Type) UInteger32
  • (SNMP SMI Type) Unsigned32
  • (SNMP SMI Type) Counter32
  • (SNMP SMI Type) Counter64
  • (SNMP SMI Type) TimeTicks
  • (SNMP SMI Type) OCTETSTRING
  • (SNMP SMI Type) IpAddress
  • (Cooked type) TIMETICKS [Compute TimeTicks to seconds]
  • (Cooked type) COUNTER32 [Compute increments for 32 bit counters]
  • (Cooked type) COUNTER64 [Compute increments for 64 bit counters]
  • (Cooked type) COUNTERXX [Compute increments only if it really increments -- as NON_NEGATIVE_DERIVATIVE does--]
  • (Cooked type) HWADDR [ Translate Hardware Address (MAC) from STRING]
  • (Cooked type) STRINGPARSER [ Compute values from Regex ]
  • (Cooked type) STRINGEVAL [evaluate data from other metrics]
ExtraData data needed to special data types as String Eval(evaluated expression needed) or String Parser(regex needed)
GetRate Only useful on counter types , if true value sent will be the computed difference and after divided by the number of elapsed seconds between snmp calls
Scale if set (as a floating point value) computed data will be scaled before sent.
Shift if set (as a floating point value) computed data will be shifted before sent.
Description any useful discretion to understand data gathered for this metric ( recommended place here units of the measurement).

Notes: The SnmpCollector Metric engine computes all its data and sent them as floating point values to the database, except for tags that will be sent as text strings

Examples

A.Creating new StringEval Metric

Let's create a SNMP Metric that computes the TotalOctets on each port. The formula follows as:

TotalOctets = (ifHCInOctets + ifHCOutOctets)

A.1 Add needed metrics to get our new string eval metric:

ID FieldName BaseOID DataSrcType ExtraData GetRate Scale Shift IsTag
ifHCInUcastPkts In.packets .1.3.6.1.2.1.31.1.1.1.7 COUNTER64 false 0 0 false
ifHCInOctets In.bytes .1.3.6.1.2.1.31.1.1.1.6 COUNTER64 false 0 0 false

A.2 Add TotalOctets metric:

ID FieldName BaseOID DataSrcType ExtraData GetRate Scale Shift IsTag
TotalOctets TotalOctets STRINGEVAL ifHCInOctets + ifHCOutOctets 0 0 false

A.3 Result

The SNMP Metric list must be like:

ID FieldName BaseOID DataSrcType ExtraData GetRate Scale Shift IsTag
ifHCInUcastPkts In.packets .1.3.6.1.2.1.31.1.1.1.7 COUNTER64 false 0 0 false
ifHCInOctets In.bytes .1.3.6.1.2.1.31.1.1.1.6 COUNTER64 false 0 0 false
TotalOctets TotalOctets STRINGEVAL ifHCInOctets + ifHCOutOctets 0 0 false

B. Creating new StringParser Metric

Some OIDs results are full strings that contains on some part of its texts the value that we wants to capture. In this example we will work with an Infoblox device and the following OID that gives us Fan1 RPM: .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3.28, with an output as: FAN 1: 8725 RPM

B.1 Define the regex that would capture the group:

We need to capture the RPM speed, so we define the capture group as: .*: *([0-9]*)* *RPM

B.2 Add new StringParser metric

ID FieldName BaseOID DataSrcType ExtraData GetRate Scale Shift IsTag
Infoblox_FanState1 fanState1 STRINGPARSER .*: *([0-9]*)* *RPM 0 0 false