extends:
  - _std-host-resources-mib-feat-base.yaml
  - _std-if-mib.yaml
  - _std-ucd-mib.yaml
  - ibm.yaml

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.2.3.51.3

metadata:
  device:
    fields:
      type:
        value: "Server"

metric_tags:
  - tag: ibm_imm_machine_level_serial_number
    OID: 1.3.6.1.4.1.2.3.51.3.1.5.2.1.3.0
    symbol: machineLevelSerialNumber
  - tag: ibm_imm_machine_level_product_name
    OID: 1.3.6.1.4.1.2.3.51.3.1.5.2.1.5.0
    symbol: machineLevelProductName

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

metrics:
  - MIB: IMM-MIB
    symbol:
      name: ibm.imm.systemHealthStat
      OID: 1.3.6.1.4.1.2.3.51.3.1.4.1.0
      chart_meta:
        description: Indicates status of system health for the system in which the IMM resides
        family: 'System/Health/Status'
        unit: "{status}"
      mapping:
        0: onRecoverable
        2: critical
        4: nonCritical
        255: normal
  - MIB: IMM-MIB
    table:
      name: tempTable
      OID: 1.3.6.1.4.1.2.3.51.3.1.1.2
    symbols:
      - name: ibm.imm.tempReading
        OID: 1.3.6.1.4.1.2.3.51.3.1.1.2.1.3
        chart_meta:
          description: The measured temperature.
          family: 'Hardware/Sensor/Temperature/Value'
          unit: "Cel"
    metric_tags:
      - tag: ibm_imm_temp_index
        symbol:
          name: ibm.imm.tempIndex
          OID: 1.3.6.1.4.1.2.3.51.3.1.1.2.1.1
      - tag: ibm_imm_temp_descr
        symbol:
          name: ibm.imm.tempDescr
          OID: 1.3.6.1.4.1.2.3.51.3.1.1.2.1.2

  - MIB: IMM-MIB
    table:
      name: voltTable
      OID: 1.3.6.1.4.1.2.3.51.3.1.2.2
    symbols:
      - name: ibm.imm.voltReading
        OID: 1.3.6.1.4.1.2.3.51.3.1.2.2.1.3
        chart_meta:
          description: The measured voltage.
          family: 'Hardware/Sensor/Voltage/Value'
          unit: "V"
    metric_tags:
      - tag: ibm_imm_volt_index
        symbol:
          name: ibm.imm.voltIndex
          OID: 1.3.6.1.4.1.2.3.51.3.1.2.2.1.1
      - tag: ibm_imm_volt_descr
        symbol:
          name: ibm.imm.voltDescr
          OID: 1.3.6.1.4.1.2.3.51.3.1.2.2.1.2

  - MIB: IMM-MIB
    table:
      name: fanTable
      OID: 1.3.6.1.4.1.2.3.51.3.1.3.2
    symbols:
      - name: ibm.imm.fanSpeed
        OID: 1.3.6.1.4.1.2.3.51.3.1.3.2.1.3
        extract_value: '(\d+)%' # Example value : '74% of maximum'
        chart_meta:
          description: Fan speed expressed in percent of maximum RPM.
          family: 'Hardware/Fan/Speed'
          unit: "%"
    metric_tags:
      - tag: ibm_imm_fan_index
        symbol:
          name: ibm.imm.fanIndex
          OID: 1.3.6.1.4.1.2.3.51.3.1.3.2.1.1
      - tag: ibm_imm_fan_descr
        symbol:
          name: ibm.imm.fanDescr
          OID: 1.3.6.1.4.1.2.3.51.3.1.3.2.1.2
