-
Notifications
You must be signed in to change notification settings - Fork 24
Tutorial: Writing a custom yaml file for SNMP
This page will walk through creating a yaml file used for polling a custom set of oids. Ktranslate ships with a built in set of these at https://github.com/kentik/ktranslate/tree/main/config/profiles/kentik_snmp.
As a base, we will be using Palo Alto Network's PAN-COMMON-MIB.
Each yaml file has three top level sections: extends
, sysobjectid
, and metrics
.
extends
lists the other yaml files which this file inherits. List only the file name. A runtime error will occur if a listed file is not found. For example:
extends:
- system-mib.yml
- if-mib.yml
Will add in all mibs found in system-mib.yml
and if-mib.yml
sysobjectid
lists which system object ids will be matched to this profile. They can be specified either exactly:
sysobjectid: 1.3.6.1.4.1.9.1.111
As a list:
sysobjectid:
- 1.3.6.1.4.1.9.1.111
- 1.3.6.1.4.1.9.1.170
Or using a wildcard:
sysobjectid: 1.3.6.1.4.1.25461.*
Wildcards will match all oids with the value before the *
as a prefix.
metrics
define the actual oids to poll. The simplest section here lists oids one by one with a name:
metrics:
- MIB: PAN-COMMON-MIB
symbol:
OID: 1.3.6.1.4.1.25461.2.1.2.3.1.0
name: panSessionUtilization
- MIB: PAN-COMMON-MIB
symbol:
OID: 1.3.6.1.4.1.25461.2.1.2.3.2.0
name: panSessionMax
Ktranslate will poll each of these oids and create metrics called kentik.snmp.panSessionUtilization
and kentik.snmp.panSessionMax