Problem
You have questions about various results calculated by the ktranslate
network monitoring agent.
Background
ktranslate
returns the raw data collected by SNMP polling in almost every instance with the following caveats:
- CPU utilization %
- Memory utilization %
- Interface utilization %
- Interface error %
- Various metrics with the
enum
orconversion
functions applied in their configuration
Solution
Metric Name: kentik.snmp.CPU
CPU is generally returned in a direct OID that provides a integer or float value representing percentage utilization. In rare cases, there is only a result for CPU idle, which is translated to CPU using this formula:
CPU = 100 - CPU Idle
Metric Name: kentik.snmp.MemoryUtilization
Unlike CPU, memory utilization is rarely presented as a direct OID value. To calculate the percent utilization, ktranslate uses this logic:
If Memory Used and Memory Free are available: Memory Utilization = ( Memory Used / (Memory Free + Memory Used) ) * 100
If Memory Total and Memory Free are available: Memory Utilization = ( (Memory Total - Memory Free) / Memory Total ) * 100
If Memory Total and Memory Used are available: Memory Utilization = ( Memory Used / Memory Total ) * 100
If Memory Total, Memory Buffer, and Memory Cache are available: Memory Utilization = ( ( Memory Total - (Memory Buffer + Memory Cache ) ) / Memory Total ) * 100
Metric Name: kentik.snmp.IfInUtilization
| kentik.snmp.IfOutUtilization
Interface utilization follows the industry standard approach of calculating the delta in bits and dividing by the product of the interface's configured speed and the time delta since the last collection was made.
For example, assuming 1 is the previous data point and 2 is the most recent:
( ( ifHCInOctets_2 - ifHCInOctets_1 ) * 8 * 100 ) / ( (sysUptime_2 - sysUptime_1) * ifSpeed )
Translated calculation
For the numerator:
Take the latest count of octets and subtract the value of the previous sample to get a delta.
Multiply the result by 8 to convert octets to bits.
Multiply the bits by 100 to set up the percentage calculation.
For the denominator:
Take the latest value of
sysUptime
and subtract the value of the previous sample to get a delta that shows the polling interval.Multiply the interval by the configured
ifSpeed
(which is reported in bits).Finally:
Divide the numerator by the denominator to find the utilization percent.
Source data
KTranslate, uses the value of either ifHCInOctets (receive) or ifHCOutOctets (transmit); replacing
ifSpeed
in the denominator with the value of ifHighSpeed as needed:ヒント
A common reason for seeing inaccurate interface utilization percentages is the configured interface speed on the device doesn't reflect the real interface speed. For instance, a 1GB MPLS circuit on a 10GB interface would show percentages at only 10% of the real utilization. To resolve this, consult your vendor's documentation on setting the interface bandwidth.
Metric Name: kentik.snmp.ifHCInOctets
| kentik.snmp.ifHCOutOctets
Interface throughput uses the value of either ifHCInOctets (receive) or ifHCOutOctets (transmit).
It's important to note exactly what you are looking for when querying for throughput.
1 octet = 1 byte
1 octet = 8 bits
The raw measurement in SNMP is counting octets, which in this context would be synonymous with bytes. You can easily calculate bytes directly through the reported metric without any conversion needed.
If you are looking for bits per second (bps), you need to both multiply the octets and convert the final number into a 'per second' rate.
Example
FROM Metric SELECTmax(kentik.snmp.ifHCInOctets) AS 'total_received_bytes',max(kentik.snmp.ifHCOutOctets) AS 'total_sent_bytes',rate(average(kentik.snmp.ifHCInOctets)*8, 1 SECOND) AS 'average_received_bps',rate(average(kentik.snmp.ifHCOutOctets)*8, 1 SECOND) AS 'average_sent_bps'FACET entity.name, if_interface_nameSINCE 1 WEEK AGOTIMESERIES
Metric Name: kentik.snmp.ifInErrorPercent
| kentik.snmp.ifOutErrorPercent
Interface error percentage uses the value of either ifInErrors (receive) or ifOutErrors (transmit), divided by either ifHCInUcastPkts (receive) or ifHCOutUcastPkts (transmit). In ktranslate, the formula looks like this:
( ifInErrors / ifHCInUcastPkts ) * 100or( ifOutErrors / ifHCOutUcastPkts ) * 100
Metric Name: Various
Other SNMP metrics are converted based on the existence of the enum
and conversion
functions in their respective SNMP profile.
Profile Setting | Usage |
---|---|
| Used to override the |
| Used to handle SNMP enumerations which convert the integer value of a dimensional metric into the enumerated value in an attribute decorated on the dimensional metric (using the same metric name suffix). A common example is the conversion of kentik.snmp.if_AdminStatus to the enumerated value of if_AdminStatus as either |
| Used to convert hexadecimal values into integer format. Options for current: |
| Used to convert hexadecimal values into 4-octet IPv4 strings. |
| Used to convert hexadecimal values into MAC address strings. |
| Used for enumeration of the upsBasicStateOutputState ASCII string in the |
| Places a regex match on the OID output to capture substrings; needs to be wrapped in quotes and have backslashes escaped. |
| Used to create a gauge metric with the value of |