extends:
  - _apc.yaml

metadata:
  device:
    fields:
      type:
        value: Sensor
      vendor:
        value: APC

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.5528.100.20.*

metrics:
  - MIB: NETBOTZV2-MIB
    table:
      OID: 1.3.6.1.4.1.5528.100.2.1
      name: enclosureTable
    symbols:
      - OID: 1.3.6.1.4.1.5528.100.2.1.1.2
        name: enclosureStatus
        chart_meta:
          description: The status of the enclosure
          family: 'Hardware/Enclosure/Status'
          unit: "{status}"
        mapping:
          0: disconnected
          1: error
          2: normal
      - OID: 1.3.6.1.4.1.5528.100.2.1.1.3
        name: enclosureErrorStatus
        chart_meta:
          description: The error status of the enclosure
          family: 'Hardware/Enclosure/Error/Status'
          unit: "{status}"
        mapping:
          0: normal
          1: info
          2: warning
          3: error
          4: critical
          5: failure
    metric_tags:
      - tag: netbotz_enclosure_index
        symbol:
          OID: 1.3.6.1.4.1.5528.100.2.1.1.7
          name: enclosureIndex
      - tag: netbotz_enclosure_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.2.1.1.1
          name: enclosureId
      - tag: netbotz_enclosure_label
        symbol:
          OID: 1.3.6.1.4.1.5528.100.2.1.1.4
          name: enclosureLabel

  - MIB: NETBOTZV2-MIB
    table:
      OID: 1.3.6.1.4.1.5528.100.3.1
      name: dinPortTable
    symbols:
      - OID: 1.3.6.1.4.1.5528.100.3.1.1.2
        name: dinPortStatus
        chart_meta:
          description: The error status of the sensor
          family: 'Hardware/Port/DIN/Status'
          unit: "{status}"
        mapping:
          0: disconnected
          1: error
          2: normal
    metric_tags:
      - tag: netbotz_din_port_index
        symbol:
          OID: 1.3.6.1.4.1.5528.100.3.1.1.9
          name: dinPortIndex
      - tag: netbotz_din_port_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.3.1.1.1
          name: dinPortId
  - MIB: NETBOTZV2-MIB
    table:
      OID: 1.3.6.1.4.1.5528.100.3.10
      name: otherPortTable
    symbols:
      - OID: 1.3.6.1.4.1.5528.100.3.10.1.2
        name: otherPortStatus
        chart_meta:
          description: The error status of the sensor
          family: 'Hardware/Port/Other/Status'
          unit: "{status}"
        mapping:
          0: disconnected
          1: error
          2: normal
    metric_tags:
      - tag: netbotz_other_port_index
        symbol:
          OID: 1.3.6.1.4.1.5528.100.3.10.1.5
          name: otherPortIndex
      - tag: netbotz_other_port_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.3.10.1.1
          name: otherPortId
      - tag: netbotz_other_port_label
        symbol:
          OID: 1.3.6.1.4.1.5528.100.3.10.1.3
          name: otherPortLabel
      - tag: netbotz_other_port_enc_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.3.10.1.4
          name: otherPortEncId
  - MIB: NETBOTZV2-MIB
    table:
      OID: 1.3.6.1.4.1.5528.100.4.1.1
      name: tempSensorTable
    symbols:
      - OID: 1.3.6.1.4.1.5528.100.4.1.1.1.8
        name: tempSensorValueInt
        chart_meta:
          description: The temperature measured by the sensor
          family: 'Hardware/Sensor/Temperature/Value'
          unit: "Cel"
      - OID: 1.3.6.1.4.1.5528.100.4.1.1.1.9
        name: tempSensorValueIntF
        chart_meta:
          description: The temperature measured by the sensor
          family: 'Hardware/Sensor/Temperature/Value'
          unit: "degF"
      - OID: 1.3.6.1.4.1.5528.100.4.1.1.1.3
        name: tempSensorErrorStatus
        chart_meta:
          description: The error status of the sensor
          family: 'Hardware/Sensor/Temperature/Status'
          unit: "{status}"
        mapping:
          0: normal
          1: info
          2: warning
          3: error
          4: critical
          5: failure
    metric_tags:
      - tag: netbotz_temp_sensor_index
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.1.1.10
          name: tempSensorIndex
      - tag: netbotz_temp_sensor_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.1.1.1
          name: tempSensorId
      - tag: netbotz_temp_sensor_label
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.1.1.4
          name: tempSensorLabel
      - tag: netbotz_temp_sensor_enc_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.1.1.5
          name: tempSensorEncId
  - MIB: NETBOTZV2-MIB
    table:
      OID: 1.3.6.1.4.1.5528.100.4.1.2
      name: humiSensorTable
    symbols:
      - OID: 1.3.6.1.4.1.5528.100.4.1.2.1.8
        name: humiSensorValueInt
        chart_meta:
          description: The relative humidity measured by the sensor
          family: 'Hardware/Sensor/Humidity/Value'
          unit: "%"
      - OID: 1.3.6.1.4.1.5528.100.4.1.2.1.3
        name: humiSensorErrorStatus
        chart_meta:
          description: The error status of the sensor
          family: 'Hardware/Sensor/Humidity/Status'
          unit: "{status}"
        mapping:
          0: normal
          1: info
          2: warning
          3: error
          4: critical
          5: failure
    metric_tags:
      - tag: netbotz_humi_sensor_index
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.2.1.9
          name: humiSensorIndex
      - tag: netbotz_humi_sensor_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.2.1.1
          name: humiSensorId
      - tag: netbotz_humi_sensor_label
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.2.1.4
          name: humiSensorLabel
      - tag: netbotz_humi_sensor_enc_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.2.1.5
          name: humiSensorEncId
  - MIB: NETBOTZ410-MIB
    table:
      OID: 1.3.6.1.4.1.5528.100.4.1.3
      name: dewPointSensorTable
    symbols:
      - OID: 1.3.6.1.4.1.5528.100.4.1.3.1.8
        name: dewPointSensorValueInt
        chart_meta:
          description: The dew point measured by the sensor
          family: 'Hardware/Sensor/DewPoint/Value'
          unit: "Cel"
      - OID: 1.3.6.1.4.1.5528.100.4.1.3.1.9
        name: dewPointSensorValueIntF
        chart_meta:
          description: The dew point measured by the sensor
          family: 'Hardware/Sensor/DewPoint/Value'
          unit: "degF"
      - OID: 1.3.6.1.4.1.5528.100.4.1.3.1.3
        name: dewPointSensorErrorStatus
        chart_meta:
          description: The error status of the sensor
          family: 'Hardware/Sensor/DewPoint/Status'
          unit: "{status}"
        mapping:
          0: normal
          1: info
          2: warning
          3: error
          4: critical
          5: failure
    metric_tags:
      - tag: netbotz_dew_point_sensor_index
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.3.1.10
          name: dewPointSensorIndex
      - tag: netbotz_dew_point_sensor_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.3.1.1
          name: dewPointSensorId
      - tag: netbotz_dew_point_sensor_label
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.3.1.4
          name: dewPointSensorLabel
      - tag: netbotz_dew_point_sensor_enc_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.1.3.1.5
          name: dewPointSensorEncId
  # - MIB: NETBOTZV2-MIB
  #   table:
  #     OID: 1.3.6.1.4.1.5528.100.4.1.10
  #     name: otherNumericSensorTable
  #   symbols:
  #     - OID: 1.3.6.1.4.1.5528.100.4.1.10.1.8
  #       name: otherNumericSensorValueInt
  #   metric_tags:
  #     - symbol:
  #         OID: 1.3.6.1.4.1.5528.100.4.1.10.1.12
  #         name: otherNumericSensorIndex
  #       tag: netbotz_other_numeric_sensor_index
  #       description: The index of the sensor
  #       unit: "{sensor}"
  #     - symbol:
  #         OID: 1.3.6.1.4.1.5528.100.4.1.10.1.1
  #         name: otherNumericSensorId
  #       tag: netbotz_other_numeric_sensor_id
  #       description: The unique id of the sensor
  #       unit: "{sensor}"
  #     - symbol:
  #         OID: 1.3.6.1.4.1.5528.100.4.1.10.1.4
  #         name: otherNumericSensorLabel
  #       tag: netbotz_other_numeric_sensor_label
  #       description: The unique label assigned to the sensor
  #       unit: "{sensor}"
  #     - symbol:
  #         OID: 1.3.6.1.4.1.5528.100.4.1.10.1.5
  #         name: otherNumericSensorEncId
  #       tag: netbotz_other_numeric_sensor_enc_id
  #       description: The id of the physical enclosure containing the sensor
  #       unit: "{enclosure}"
  #     - symbol:
  #         OID: 1.3.6.1.4.1.5528.100.4.1.10.1.9
  #         name: otherNumericSensorUnits
  #       tag: netbotz_other_numeric_sensor_units
  #       description: The unit of measure for the sensor value
  #       unit: "TBD"
  #     # TODO: Check out metric_tags with symbols having mappings and/or expressing states/statuses. Need to convert to metrics.
  #     - symbol:
  #         OID: 1.3.6.1.4.1.5528.100.4.1.10.1.3
  #         name: otherNumericSensorErrorStatus
  #       tag: netbotz_other_numeric_sensor_error_status
  #       mapping:
  #         0: normal
  #         1: info
  #         2: warning
  #         3: error
  #         4: critical
  #         5: failure
  #       description: The operational status of the sensor
  #       unit: "TBD"
  # TODO metric with units defined by the MIB not currently supported
  - MIB: NETBOTZV2-MIB
    table:
      OID: 1.3.6.1.4.1.5528.100.4.2.2
      name: doorSwitchSensorTable
    symbols:
      - OID: 1.3.6.1.4.1.5528.100.4.2.2.1.2
        name: doorSwitchSensorValue
        chart_meta:
          description: Whether the door is open or closed
          family: 'Hardware/Sensor/DoorSwitch/Position'
          unit: "{status}"
        mapping:
          -1: "null"
          0: open
          1: closed
      - OID: 1.3.6.1.4.1.5528.100.4.2.2.1.3
        name: doorSwitchSensorErrorStatus
        chart_meta:
          description: The error status of the sensor
          family: 'Hardware/Sensor/DoorSwitch/Status'
          unit: "{status}"
        mapping:
          0: normal
          1: info
          2: warning
          3: error
          4: critical
          5: failure
    metric_tags:
      - tag: netbotz_door_switch_sensor_index
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.2.2.1.8
          name: doorSwitchSensorIndex
      - tag: netbotz_door_switch_sensor_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.2.2.1.1
          name: doorSwitchSensorId
      - tag: netbotz_door_switch_sensor_label
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.2.2.1.4
          name: doorSwitchSensorLabel
      - tag: netbotz_door_switch_sensor_enc_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.2.2.1.5
          name: doorSwitchSensorEncId
      - tag: netbotz_door_switch_sensor_value_str
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.2.2.1.7
          name: doorSwitchSensorValueStr
  - MIB: NETBOTZV2-MIB
    table:
      OID: 1.3.6.1.4.1.5528.100.4.2.10
      name: otherStateSensorTable
    symbols:
      - OID: 1.3.6.1.4.1.5528.100.4.2.10.1.3
        name: otherStateSensorErrorStatus
        chart_meta:
          description: The error status of the sensor
          family: 'Hardware/Sensor/OtherState/Status'
          unit: "{status}"
        mapping:
          0: normal
          1: info
          2: warning
          3: error
          4: critical
          5: failure
    metric_tags:
      - tag: netbotz_other_state_sensor_label
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.2.10.1.4
          name: otherStateSensorLabel
      - tag: netbotz_other_state_sensor_enc_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.2.10.1.5
          name: otherStateSensorEncId
      - tag: netbotz_other_state_sensor_value_str
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.2.10.1.7
          name: otherStateSensorValueStr
      - tag: netbotz_other_state_sensor_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.4.2.10.1.1
          name: otherStateSensorId
  - MIB: NETBOTZV2-MIB
    table:
      OID: 1.3.6.1.4.1.5528.100.5.1
      name: errorCondTable
    symbols:
      - OID: 1.3.6.1.4.1.5528.100.5.1.1.2
        name: errorCondSeverity
        chart_meta:
          description: The relative severity of the error condition
          family: 'System/Alert/Severity'
          unit: "{status}"
        mapping:
          0: normal
          1: info
          2: warning
          3: error
          4: critical
          5: failure
      - OID: 1.3.6.1.4.1.5528.100.5.1.1.6
        name: errorCondResolved
        chart_meta:
          description: Whether the error condition was resolved
          family: 'System/Alert/Resolution/Status'
          unit: "{status}"
        mapping:
          0: no
          1: yes
          2: "null"
    metric_tags:
      - tag: netbotz_error_cond_index
        symbol:
          OID: 1.3.6.1.4.1.5528.100.5.1.1.12
          name: errorCondIndex
      - tag: netbotz_error_cond_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.5.1.1.1
          name: errorCondId
      - tag: netbotz_error_cond_type_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.5.1.1.3
          name: errorCondTypeId
      - tag: netbotz_error_cond_enc_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.5.1.1.9
          name: errorCondEncId
      - tag: netbotz_error_cond_sensor_id
        symbol:
          OID: 1.3.6.1.4.1.5528.100.5.1.1.11
          name: errorCondSensorId
