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

metadata:
  device:
    fields:
      vendor:
        value: "Raritan"

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.13742.*         # Raritan Devices
        - 1.3.6.1.4.1.13742.3.2.10    # Raritan Dominion SXII DSX2-32

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

metrics:
  - MIB: RemoteKVMDevice-MIB
    symbol:
      name: memory.usage
      OID: 1.3.6.1.4.1.13742.3.1.1.0
      chart_meta:
        family: 'System/Memory/Usage'
        description: Memory usage
        unit: "%"
  - MIB: RemoteKVMDevice-MIB
    symbol:
      name: cpu.usage
      OID: 1.3.6.1.4.1.13742.3.1.2.0
      chart_meta:
        family: 'System/CPU/Usage'
        description: The current CPU utilization
        unit: "%"

  - MIB: RemoteKVMDevice-MIB
    table:
      name: systemPowerSupplyTable
      OID: 1.3.6.1.4.1.13742.3.1.3
    symbols:
      - OID: 1.3.6.1.4.1.13742.3.1.3.1.2
        name: raritan.remotekvm.systemPowerSupplyPowerOn
        chart_meta:
          family: 'Hardware/Power/Status'
          description: indicates whether the system power supply is on
          unit: "{status}"
        mapping:
          1: 'on'
          2: 'off'
    metric_tags:
      - tag: psu_index
        index: 1

  - MIB: RemoteKVMDevice-MIB
    table:
      name: portDataTable
      OID: 1.3.6.1.4.1.13742.3.1.4
    symbols:
      - OID: 1.3.6.1.4.1.13742.3.1.4.1.5
        name: raritan.remotekvm.portDataStatus
        chart_meta:
          family: 'Network/RemoteKVM/Port/Status'
          description: Port status and availability
          unit: "{status}"
        mapping:
          1: inactive
          2: available
          3: connected
          4: busy
    metric_tags:
      - tag: raritan_remotekvm_port_data_index
        index: 1
      - tag: raritan_remotekvm_port_data_name
        symbol:
          OID: 1.3.6.1.4.1.13742.3.1.4.1.3
          name: raritan.remotekvm.portDataName
      - tag: raritan_remotekvm_port_data_type
        symbol:
          OID: 1.3.6.1.4.1.13742.3.1.4.1.4
          name: raritan.remotekvm.portDataType

