extends:
  - _system-base.yaml
  - _std-if-mib.yaml

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.11863.1.* # TP-Link switch
        - 1.3.6.1.4.1.11863.5.* # TP-Link products

metadata:
  device:
    fields:
      vendor:
        value: "TP-Link"

# TPLINK-SYSMONITOR-MIB
# https://mibbrowser.online/mibdb_search.php?mib=TPLINK-SYSMONITOR-MIB
# https://github.com/DanielleHuisman/observium-community-edition/blob/main/mibs/tplink/TPLINK-SYSMONITOR-MIB

metrics:
  - MIB: TPLINK-SYSMONITOR-MIB
    table:
      name: tpSysMonitorCpuTable
      OID: 1.3.6.1.4.1.11863.6.4.1.1.1
    symbols:
      - name: cpu.usage
        OID: 1.3.6.1.4.1.11863.6.4.1.1.1.1.2 # tpSysMonitorCpu5Seconds
        chart_meta:
          description: The current CPU utilization
          family: 'System/CPU/Usage'
          unit: "%"
    metric_tags:
      - tag: cpu_index
        index: 1 # tpSysMonitorCpuUnitNumber

  - MIB: TPLINK-SYSMONITOR-MIB
    table:
      name: tpSysMonitorMemoryTable
      OID: 1.3.6.1.4.1.11863.6.4.1.2.1
    symbols:
      - name: memory.usage
        OID: 1.3.6.1.4.1.11863.6.4.1.2.1.1.2
        chart_meta:
          description: Memory utilization
          family: 'System/Memory/Usage'
          unit: "%"
    metric_tags:
      - tag: mem_index
        index: 1 # tpSysMonitorMemoryUnitNumber
