Skip to content

Latest commit

 

History

History
65 lines (62 loc) · 2.43 KB

FORMAT.md

File metadata and controls

65 lines (62 loc) · 2.43 KB

Exporter file format

This is generated by the generator, so only those doing development should have to care about how this works.

module_name:
  auth:
    # There's various auth/version options here too. See the main README.
    community: public
  walk:
    # List of OID subtrees to walk.
    - 1.3.6.1.2.1.2
    - 1.3.6.1.2.1.31.1.1
  get:
    # List of OIDs to get directly.
    - 1.3.6.1.2.1.1.3
  metrics:      # List of metrics to extract.
     # A simple metric with no labels.
   - name:  sysUpTime
     oid:   1.3.6.1.2.1.1.3
     type:  gauge
     # See README.md type override for a list of valid types
     # Non-numeric types are represented as a gauge with value 1, and the rendered value
     # as a label value on that gauge.

     # A metric that's part of a table, and thus has labels.
   - name:  ifMtu
     oid:   1.3.6.1.2.1.2.2.1.4
     type:  gauge
     # A list of the table indexes and their types. All indexes become labels.
     indexes:
      - labelname: ifIndex
        type: gauge
      - labelname: someString
        type: OctetString
        fixed_size: 8   # Only possible for OctetString/DisplayString types.
                        # If only one length is possible this is it. Otherwise
                        # this will be 0 or missing.
      - labelname: someOtherString
        type: OctetString
        implied: true   # Only possible for OctetString/DisplayString types.
                        # Must be the last index. See RFC2578 section 7.7.
   - name:  ifSpeed
     oid:   1.3.6.1.2.1.2.2.1.5
     type:  gauge
     indexes:
      - labelname: ifDescr
        type: gauge
     # Lookups take original indexes, look them up in another part of the
     # oid tree and overwrite the given output label.
     lookups:
       - labels: [ifDescr]         # Input label name(s). Empty means delete the output label.
         oid: 1.3.6.1.2.1.2.2.1.2  # OID to look under.
         labelname: ifDescr        # Output label name.
         type: OctetString         # Type of output object.
     # Creates new metrics based on the regex and the metric value.
     regex_extracts:
       Temp: # A new metric will be created appending this to the metricName to become metricNameTemp.
         - regex: '(.*)' # Regex to extract a value from the returned SNMP walks's value.
           value: '$1' # Parsed as float64, defaults to $1.
     enum_values: # Enum for this metric. Only used with the enum types.
        0: true
        1: false