extends:
  - servertech.yaml

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.1718.3  # Sentry 3rd Gen PDU

metadata:
  device:
    fields:
      type:
        value: "PDU"

metric_tags:
  - tag: servertech_sentry3_system_version
    OID: 1.3.6.1.4.1.1718.3.1.1.0
    symbol: systemVersion
  - tag: servertech_sentry3_system_nic_serial_number
    OID: 1.3.6.1.4.1.1718.3.1.2.0
    symbol: systemNICSerialNumber

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

metrics:
  - MIB: SENTRY3-MIB
    symbol:
      name: servertech.sentry3.systemTotalPower
      OID: 1.3.6.1.4.1.1718.3.1.6.0
      chart_meta:
        description: Total power consumption of the system
        family: 'PowerFlow/System/Total'
        unit: "W"
  - MIB: SENTRY3-MIB
    symbol:
      name: servertech.sentry3.systemConfigModifiedCount
      OID: 1.3.6.1.4.1.1718.3.1.15.0
      chart_meta:
        description: Count of system configuration modifications
        family: 'System/Configuration/Modified/Count'
        unit: "{modification}"

  - MIB: SENTRY3-MIB
    table:
      name: towerTable
      OID: 1.3.6.1.4.1.1718.3.2.1
    symbols:
      - name: servertech.sentry3.towerInfeedCount
        OID: 1.3.6.1.4.1.1718.3.2.1.1.5
        chart_meta:
          description: Number of tower infeeds
          family: 'PowerFlow/Tower/Infeed/Count'
          unit: "{infeed}"
      - name: servertech.sentry3.towerVACapacity
        OID: 1.3.6.1.4.1.1718.3.2.1.1.9
        chart_meta:
          description: Tower VA capacity
          family: 'PowerFlow/Tower/Capacity/Apparent'
          unit: "VA"
      - name: servertech.sentry3.towerVACapacityUsed
        OID: 1.3.6.1.4.1.1718.3.2.1.1.10
        chart_meta:
          description: Used tower VA capacity
          family: 'PowerFlow/Tower/Used/Apparent'
          unit: "VA"
      - name: servertech.sentry3.towerActivePower
        OID: 1.3.6.1.4.1.1718.3.2.1.1.11
        chart_meta:
          description: Tower active power
          family: 'PowerFlow/Tower/Active'
          unit: "W"
      - name: servertech.sentry3.towerApparentPower
        OID: 1.3.6.1.4.1.1718.3.2.1.1.12
        chart_meta:
          description: Tower apparent power
          family: 'PowerFlow/Tower/Apparent'
          unit: "VA"
      - name: servertech.sentry3.towerPowerFactor
        OID: 1.3.6.1.4.1.1718.3.2.1.1.13
        chart_meta:
          description: Tower power factor
          family: 'PowerFlow/Tower/Factor'
          unit: "%"
      - name: servertech.sentry3.towerEnergy
        OID: 1.3.6.1.4.1.1718.3.2.1.1.14
        chart_meta:
          description: Tower energy consumption
          family: 'PowerFlow/Tower/Energy/Total'
          unit: "Wh"
      - name: servertech.sentry3.towerLineFrequency
        OID: 1.3.6.1.4.1.1718.3.2.1.1.15
        chart_meta:
          description: Tower line frequency
          family: 'PowerFlow/Tower/Frequency'
          unit: "Hz"
      - name: servertech.sentry3.towerStatus
        OID: 1.3.6.1.4.1.1718.3.2.1.1.4
        chart_meta:
          description: Tower operational status
          family: 'Hardware/Tower/Status'
          unit: "{status}"
        mapping:
          0: normal
          1: no_comm
          2: fan_fail
          3: over_temp
          4: nvm_fail
          5: out_of_balance
    metric_tags:
      - tag: servertech_sentry3_tower_id
        symbol:
          name: servertech.sentry3.towerID
          OID: 1.3.6.1.4.1.1718.3.2.1.1.2
      - tag: servertech_sentry3_tower_name
        symbol:
          name: servertech.sentry3.towerName
          OID: 1.3.6.1.4.1.1718.3.2.1.1.3
      - tag: _servertech_sentry3_tower_product_sn
        symbol:
          name: servertech.sentry3.towerProductSN
          OID: 1.3.6.1.4.1.1718.3.2.1.1.6
      - tag: _servertech_sentry3_tower_model_number
        symbol:
          name: servertech.sentry3.towerModelNumber
          OID: 1.3.6.1.4.1.1718.3.2.1.1.7

  - MIB: SENTRY3-MIB
    table:
      name: infeedTable
      OID: 1.3.6.1.4.1.1718.3.2.2
    symbols:
      - name: servertech.sentry3.infeedLoadValue
        OID: 1.3.6.1.4.1.1718.3.2.2.1.7
        chart_meta:
          description: Infeed load value
          family: 'PowerFlow/Infeed/Load/Value'
          unit: "W"
      - name: servertech.sentry3.infeedOutletCount
        OID: 1.3.6.1.4.1.1718.3.2.2.1.9
        chart_meta:
          description: Number of outlets on infeed
          family: 'PowerFlow/Infeed/Outlet/Count'
          unit: "{outlet}"
      - name: servertech.sentry3.infeedCapacity
        OID: 1.3.6.1.4.1.1718.3.2.2.1.10
        chart_meta:
          description: Infeed capacity
          family: 'PowerFlow/Infeed/Capacity'
          unit: "VA"
      - name: servertech.sentry3.infeedVoltage
        OID: 1.3.6.1.4.1.1718.3.2.2.1.11
        chart_meta:
          description: Infeed voltage
          family: 'PowerFlow/Infeed/Voltage'
          unit: "V"
      - name: servertech.sentry3.infeedPower
        OID: 1.3.6.1.4.1.1718.3.2.2.1.12
        chart_meta:
          description: Infeed power
          family: 'PowerFlow/Infeed/Active'
          unit: "W"
      - name: servertech.sentry3.infeedEnergy
        OID: 1.3.6.1.4.1.1718.3.2.2.1.16
        chart_meta:
          description: Infeed energy consumption
          family: 'PowerFlow/Infeed/Energy/Total'
          unit: "Wh"
      - name: servertech.sentry3.infeedPhaseVoltage
        OID: 1.3.6.1.4.1.1718.3.2.2.1.18
        chart_meta:
          description: Infeed phase voltage
          family: 'PowerFlow/Infeed/Phase/Voltage'
          unit: "V"
      - name: servertech.sentry3.infeedPhaseCurrent
        OID: 1.3.6.1.4.1.1718.3.2.2.1.19
        chart_meta:
          description: Infeed phase current
          family: 'PowerFlow/Infeed/Phase/Current'
          unit: "A"
      - name: servertech.sentry3.infeedCapacityUsed
        OID: 1.3.6.1.4.1.1718.3.2.2.1.20
        chart_meta:
          description: Used infeed capacity
          family: 'PowerFlow/Infeed/Used'
          unit: "VA"
      - name: servertech.sentry3.infeedStatus
        OID: 1.3.6.1.4.1.1718.3.2.2.1.5
        chart_meta:
          description: Infeed operational status
          family: 'Hardware/Infeed/Status'
          unit: "{status}"
        mapping:
          0: off
          1: on
          2: off_wait
          3: on_wait
          4: off_error
          5: on_error
          6: no_comm
          7: reading
          8: off_fuse
          9: on_fuse
      - name: servertech.sentry3.infeedLoadStatus
        OID: 1.3.6.1.4.1.1718.3.2.2.1.6
        chart_meta:
          description: Infeed load status
          family: 'Hardware/Infeed/Load/Status'
          unit: "{status}"
        mapping:
          0: normal
          1: not_on
          2: reading
          3: load_low
          4: load_high
          5: over_load
          6: read_error
          7: no_comm
      - name: servertech.sentry3.infeedReactance
        OID: 1.3.6.1.4.1.1718.3.2.2.1.17
        chart_meta:
          description: Infeed reactance type
          family: 'PowerFlow/Infeed/Reactance/Type'
          unit: "{status}"
        mapping:
          0: unknown
          1: capacitive
          2: inductive
          3: resistive
    metric_tags:
      - tag: servertech_sentry3_infeed_id
        symbol:
          name: servertech.sentry3.infeedID
          OID: 1.3.6.1.4.1.1718.3.2.2.1.2
      - tag: servertech_sentry3_infeed_name
        symbol:
          name: servertech.sentry3.infeedName
          OID: 1.3.6.1.4.1.1718.3.2.2.1.3
      - tag: _servertech_sentry3_infeed_line_id
        symbol:
          name: servertech.sentry3.infeedLineID
          OID: 1.3.6.1.4.1.1718.3.2.2.1.21
      - tag: _servertech_sentry3_infeed_line_to_line_id
        symbol:
          name: servertech.sentry3.infeedLineToLineID
          OID: 1.3.6.1.4.1.1718.3.2.2.1.22
      - tag: _servertech_sentry3_infeed_phase_id
        symbol:
          name: servertech.sentry3.infeedPhaseID
          OID: 1.3.6.1.4.1.1718.3.2.2.1.23

  - MIB: SENTRY3-MIB
    table:
      name: outletTable
      OID: 1.3.6.1.4.1.1718.3.2.3
    symbols:
      - name: servertech.sentry3.outletStatus
        OID: 1.3.6.1.4.1.1718.3.2.3.1.5
        chart_meta:
          description: Outlet operational status
          family: 'Hardware/Outlet/Status'
          unit: "{status}"
        mapping:
          0: off
          1: on
          2: off_wait
          3: on_wait
          4: off_error
          5: on_error
          6: no_comm
          7: reading
          8: off_fuse
          9: on_fuse
      - name: servertech.sentry3.outletControlState
        OID: 1.3.6.1.4.1.1718.3.2.3.1.10
        chart_meta:
          description: Outlet control state
          family: 'Hardware/Outlet/Control/State'
          unit: "{status}"
        mapping:
          0: idle_off
          1: idle_on
          2: wake_off
          3: wake_on
          4: off
          5: on
          6: locked_off
          7: locked_on
          8: reboot
          9: shutdown
          10: pend_on
          11: pend_off
          12: minimum_off
          13: minimum_on
          14: event_off
          15: event_on
          16: event_reboot
          17: event_shutdown
      - name: servertech.sentry3.outletWakeupState
        OID: 1.3.6.1.4.1.1718.3.2.3.1.19
        chart_meta:
          description: Outlet wakeup state configuration
          family: 'Hardware/Outlet/Wakeup/State'
          unit: "{status}"
        mapping:
          1: last
          2: off
          3: on
    metric_tags:
      - tag: servertech_sentry3_outlet_id
        symbol:
          name: servertech.sentry3.outletID
          OID: 1.3.6.1.4.1.1718.3.2.3.1.2
      - tag: servertech_sentry3_outlet_name
        symbol:
          name: servertech.sentry3.outletName
          OID: 1.3.6.1.4.1.1718.3.2.3.1.3

  - MIB: SENTRY3-MIB
    table:
      name: envMonTable
      OID: 1.3.6.1.4.1.1718.3.2.4
    symbols:
      - name: servertech.sentry3.envMonStatus
        OID: 1.3.6.1.4.1.1718.3.2.4.1.4
        chart_meta:
          description: Environmental monitor status
          family: 'Hardware/Sensor/Environmental/Status'
          unit: "{status}"
        mapping:
          0: normal
          1: no_comm
    metric_tags:
      - tag: servertech_sentry3_env_mon_id
        symbol:
          name: servertech.sentry3.envMonID
          OID: 1.3.6.1.4.1.1718.3.2.4.1.2
      - tag: servertech_sentry3_env_mon_name
        symbol:
          name: servertech.sentry3.envMonName
          OID: 1.3.6.1.4.1.1718.3.2.4.1.3

  - MIB: SENTRY3-MIB
    table:
      name: tempHumidSensorTable
      OID: 1.3.6.1.4.1.1718.3.2.5
    symbols:
      - name: servertech.sentry3.tempHumidSensorTempValue
        OID: 1.3.6.1.4.1.1718.3.2.5.1.6
        chart_meta:
          description: Temperature value from sensor
          family: 'Hardware/Sensor/Temperature/Value'
          unit: "Cel"
      - name: servertech.sentry3.tempHumidSensorHumidValue
        OID: 1.3.6.1.4.1.1718.3.2.5.1.10
        chart_meta:
          description: Humidity value from sensor
          family: 'Hardware/Sensor/Humidity/Value'
          unit: "%"
      - name: servertech.sentry3.tempHumidSensorStatus
        OID: 1.3.6.1.4.1.1718.3.2.5.1.4
        chart_meta:
          description: Temperature/humidity sensor communication status
          family: 'Hardware/Sensor/Communication/Status'
          unit: "{status}"
        mapping:
          0: found
          1: not_found
          2: lost
          3: no_comm
      - name: servertech.sentry3.tempHumidSensorTempStatus
        OID: 1.3.6.1.4.1.1718.3.2.5.1.5
        chart_meta:
          description: Temperature sensor status
          family: 'Hardware/Sensor/Temperature/Status'
          unit: "{status}"
        mapping:
          0: normal
          1: not_found
          2: reading
          3: temp_low
          4: temp_high
          5: read_error
          6: lost
          7: no_comm
      - name: servertech.sentry3.tempHumidSensorHumidStatus
        OID: 1.3.6.1.4.1.1718.3.2.5.1.9
        chart_meta:
          description: Humidity sensor status
          family: 'Hardware/Sensor/Humidity/Status'
          unit: "{status}"
        mapping:
          0: normal
          1: not_found
          2: reading
          3: humid_low
          4: humid_high
          5: read_error
          6: lost
          7: no_comm
    metric_tags:
      - tag: servertech_sentry3_temp_humid_sensor_id
        symbol:
          name: servertech.sentry3.tempHumidSensorID
          OID: 1.3.6.1.4.1.1718.3.2.5.1.2
      - tag: servertech_sentry3_temp_humid_sensor_name
        symbol:
          name: servertech.sentry3.tempHumidSensorName
          OID: 1.3.6.1.4.1.1718.3.2.5.1.3
      - tag: _servertech_sentry3_temp_humid_sensor_temp_scale
        symbol:
          OID: 1.3.6.1.4.1.1718.3.2.5.1.13
          name: servertech.sentry3.tempHumidSensorTempScale
        mapping:
          0: celsius
          1: fahrenheit
