extends:
  - _std-if-mib.yaml
  - _ubiquiti.yaml

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.41112 # Ubiquiti Networks, Inc.

metadata:
  device:
    fields:
      model:
        symbol:
          OID: 1.3.6.1.4.1.41112.1.6.3.3.0
          name: unifiApSystemModel
          match_pattern: '(.*)'
          match_value: 'UniFi $1'

# FROGFOOT-RESOURCES-MIB
# https://mibbrowser.online/mibdb_search.php?mib=FROGFOOT-RESOURCES-MIB
# https://github.com/DanielleHuisman/observium-community-edition/blob/main/mibs/ubiquiti/FROGFOOT-RESOURCES-MIB

# UBNT-UniFi-MIB
# https://mibbrowser.online/mibdb_search.php?mib=UBNT-UniFi-MIB
# https://github.com/DanielleHuisman/observium-community-edition/blob/main/mibs/ubiquiti/UBNT-UniFi-MIB

metrics:
  - MIB: FROGFOOT-RESOURCES-MIB
    symbol:
      OID: 1.3.6.1.4.1.10002.1.1.1.1.1.0
      name: memory.total
      scale_factor: 1024
      chart_meta:
        description: Total usable physical memory (in KB)
        family: 'System/Memory/Total'
        unit: "By"
  - MIB: FROGFOOT-RESOURCES-MIB
    symbol:
      OID: 1.3.6.1.4.1.10002.1.1.1.1.2.0
      name: memory.free
      scale_factor: 1024
      chart_meta:
        description: Available physical memory (in KB)
        family: 'System/Memory/Free'
        unit: "By"

  - MIB: UBNT-UniFi-MIB
    table:
      OID: 1.3.6.1.4.1.41112.1.6.1.1
      name: unifiRadioTable
    symbols:
      - OID: 1.3.6.1.4.1.41112.1.6.1.1.1.4
        name: ubiquiti.unifiRadioRxPackets
        chart_meta:
          description: Number of received packets on the radio
          family: 'Network/Wireless/Radio/Packet/In'
          unit: "{packet}/s"
      - OID: 1.3.6.1.4.1.41112.1.6.1.1.1.5
        name: ubiquiti.unifiRadioTxPackets
        chart_meta:
          description: Number of transmitted packets on the radio
          family: 'Network/Wireless/Radio/Packet/Out'
          unit: "{packet}/s"
      - OID: 1.3.6.1.4.1.41112.1.6.1.1.1.6
        name: ubiquiti.unifiRadioCuTotal
        chart_meta:
          description: Total channel utilization on the radio
          family: 'Network/Wireless/Radio/ChannelUtilization/Total'
          unit: "%"
      - OID: 1.3.6.1.4.1.41112.1.6.1.1.1.7
        name: ubiquiti.unifiRadioCuSelfRx
        chart_meta:
          description: Channel utilization for self received traffic on the radio
          family: 'Network/Wireless/Radio/ChannelUtilization/SelfReceive'
          unit: "%"
      - OID: 1.3.6.1.4.1.41112.1.6.1.1.1.8
        name: ubiquiti.unifiRadioCuSelfTx
        chart_meta:
          description: Channel utilization for self transmitted traffic on the radio
          family: 'Network/Wireless/Radio/ChannelUtilization/SelfTransmit'
          unit: "%"
      - OID: 1.3.6.1.4.1.41112.1.6.1.1.1.9
        name: ubiquiti.unifiRadioOtherBss
        chart_meta:
          description: Number of other basic service sets detected on the radio
          family: 'Network/Wireless/Radio/BSS/Other/Count'
          unit: "{bss}"
    metric_tags:
      - tag: ubiquiti_unifi_radio_index
        symbol:
          OID: 1.3.6.1.4.1.41112.1.6.1.1.1.1
          name: ubiquiti.unifiRadioIndex
      - tag: ubiquiti_unifi_radio_name
        symbol:
          OID: 1.3.6.1.4.1.41112.1.6.1.1.1.2
          name: ubiquiti.unifiRadioName
      - tag: ubiquiti_unifi_radio_radio
        symbol:
          OID: 1.3.6.1.4.1.41112.1.6.1.1.1.3
          name: ubiquiti.unifiRadioRadio
