extends:
  - _system-base.yaml

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.3711.24  # Sinetica Eagle-i

metadata:
  device:
    fields:
      vendor:
        value: "Panduit"

metric_tags:
  - tag: hawk_i2_inv_hw_revision
    OID: 1.3.6.1.4.1.3711.24.1.1.99.9.0
    symbol: invHwRevision
  - tag: hawk_i2_inv_fw_revision
    OID: 1.3.6.1.4.1.3711.24.1.1.99.10.0
    symbol: invFwRevision
  - tag: hawk_i2_inv_serial_num
    OID: 1.3.6.1.4.1.3711.24.1.1.99.11.0
    symbol: invSerialNum
  - tag: hawk_i2_ip_temp_scale_flag
    OID: 1.3.6.1.4.1.3711.24.1.1.1.2.1.0
    symbol: ipTempScaleFlag
    mapping:
      1: celsius
      2: fahrenheit
      3: kelvin

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

metrics:
  # - MIB: HAWK-I2-MIB
  #   table:
  #     name: ipTHATable
  #     OID: 1.3.6.1.4.1.3711.24.1.1.1.2.2
  #   symbols:
  #     - name: hawk.i2.ipTHAValue
  #       OID: 1.3.6.1.4.1.3711.24.1.1.1.2.2.1.7
  #       chart_meta:
  #         description: The current reading in the relevant measurement units
  #         family: 'Hardware/Sensor/Analog/Value'
  #         unit: 1
  #   metric_tags:
  #     - tag: hawk_i2_ip_tha_index
  #       index: 1
  #     - tag: _hawk_i2_ip_tha_name
  #       symbol:
  #         name: hawk.i2.ipTHAName
  #         OID: 1.3.6.1.4.1.3711.24.1.1.1.2.2.1.3
  #     - tag: _hawk_i2_ip_tha_locn
  #       symbol:
  #         name: hawk.i2.ipTHALocn
  #         OID: 1.3.6.1.4.1.3711.24.1.1.1.2.2.1.4
  # There is also scaling factor for this https://github.com/DanielleHuisman/observium-community-edition/blob/main/mibs/panduit/HAWK-I2-MIB#L477C9-L477C82

  - MIB: HAWK-I2-MIB
    table:
      name: ipContTable
      OID: 1.3.6.1.4.1.3711.24.1.1.1.3.1
    symbols:
      - OID: 1.3.6.1.4.1.3711.24.1.1.1.3.1.1.6
        name: hawk.i2.ipContNormState
        chart_meta:
          description: Normal state of the input contact
          family: 'Hardware/Input/Contact/State/Normal'
          unit: "{status}"
        mapping:
          1: open
          2: closed
      - OID: 1.3.6.1.4.1.3711.24.1.1.1.3.1.1.7
        name: hawk.i2.ipContCurrState
        chart_meta:
          description: Current state of the input contact
          family: 'Hardware/Input/Contact/State/Current'
          unit: "{status}"
        mapping:
          1: open
          2: closed
          3: armed
          4: triggered
    metric_tags:
      - tag: hawk_i2_ip_cont_index
        index: 1
      - tag: hawk_i2_ip_cont_name
        symbol:
          name: hawk.i2.ipContName
          OID: 1.3.6.1.4.1.3711.24.1.1.1.3.1.1.3
      - tag: _hawk_i2_ip_cont_locn
        symbol:
          name: hawk.i2.ipContLocn
          OID: 1.3.6.1.4.1.3711.24.1.1.1.3.1.1.4

  - MIB: HAWK-I2-MIB
    table:
      name: opTable
      OID: 1.3.6.1.4.1.3711.24.1.1.2.2
    symbols:
      - OID: 1.3.6.1.4.1.3711.24.1.1.2.2.1.5
        name: hawk.i2.opNormState
        chart_meta:
          description: Normal state of the output
          family: 'Hardware/Output/State/Normal'
          unit: "{status}"
        mapping:
          1: on
          2: off
      - OID: 1.3.6.1.4.1.3711.24.1.1.2.2.1.6
        name: hawk.i2.opCurrState
        chart_meta:
          description: Current state of the output
          family: 'Hardware/Output/State/Current'
          unit: "{status}"
        mapping:
          1: on
          2: off
      - OID: 1.3.6.1.4.1.3711.24.1.1.2.2.1.12
        name: hawk.i2.opControlState
        chart_meta:
          description: Control state of the output
          family: 'Hardware/Output/State/Control'
          unit: "{status}"
        mapping:
          1: activate
          2: deactivate
          3: logic
    metric_tags:
      - tag: hawk_i2_op_index
        index: 1
      - tag: hawk_i2_op_name
        symbol:
          name: hawk.i2.opName
          OID: 1.3.6.1.4.1.3711.24.1.1.2.2.1.3
      - tag: _hawk_i2_op_locn
        symbol:
          name: hawk.i2.opLocn
          OID: 1.3.6.1.4.1.3711.24.1.1.2.2.1.4

  - MIB: HAWK-I2-MIB
    table:
      name: pduMonTable
      OID: 1.3.6.1.4.1.3711.24.1.1.7.3.1
    symbols:
      - name: hawk.i2.pduRMSVoltsValue
        OID: 1.3.6.1.4.1.3711.24.1.1.7.3.1.1.3
        chart_meta:
          description: RMS Volts value
          family: 'Hardware/PDU/Voltage/Value'
          unit: "V"
      - name: hawk.i2.pduRMSAmpsValue
        OID: 1.3.6.1.4.1.3711.24.1.1.7.3.1.1.4
        scale_factor: 0.1
        chart_meta:
          description: RMS current value
          family: 'Hardware/PDU/Current/Value'
          unit: "A"
      - name: hawk.i2.pduTotalEnergyValue
        OID: 1.3.6.1.4.1.3711.24.1.1.7.3.1.1.5
        scale_factor: 100
        chart_meta:
          description: Total energy value
          family: 'Hardware/PDU/Energy/Total'
          unit: "Wh"
    metric_tags:
      - tag: hawk_i2_pdu_index
        index: 1
      - tag: hawk_i2_pdu_name
        table: pduTable
        symbol:
          name: hawk.i2.pduName
          OID: 1.3.6.1.4.1.3711.24.1.1.7.1.2.1.3
