extends:
  - _std-entity-sensor-mib.yaml
  - _std-host-resources-mib-feat-base.yaml
  - _std-if-mib.yaml
  - _std-ucd-mib.yaml
  - _opengear.yaml

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.25049.1.*     # Open Gear Console Managers
        - 1.3.6.1.4.1.25049.1.10    # CM41xx series Console Managers
        - 1.3.6.1.4.1.25049.1.11    # CM71xx series Console Managers

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

metrics:
  - MIB: OG-STATUSv2-MIB
    table:
      name: ogSerialPortTable
      OID: 1.3.6.1.4.1.25049.17.2
    symbols:
      - name: ogSerialPortRxBytes
        OID: 1.3.6.1.4.1.25049.17.2.1.10
        chart_meta:
          family: 'Network/SerialPort/Traffic/In'
          description: Number of bytes received on the serial port
          unit: "By/s"
      - name: ogSerialPortTxBytes
        OID: 1.3.6.1.4.1.25049.17.2.1.11
        chart_meta:
          family: 'Network/SerialPort/Traffic/Out'
          description: Number of bytes transmitted on the serial port
          unit: "By/s"
    metric_tags:
      - tag: og_serial_port_index
        index: 1  # ogSerialPortIndex
      - tag: og_serial_port_label
        symbol:
          name: ogSerialPortLabel
          OID: 1.3.6.1.4.1.25049.17.2.1.2
      - tag: _og_serial_port_speed
        symbol:
          name: ogSerialPortSpeed
          OID: 1.3.6.1.4.1.25049.17.2.1.3
      - tag: _og_serial_port_data_bits
        symbol:
          name: ogSerialPortDataBits
          OID: 1.3.6.1.4.1.25049.17.2.1.4
      - tag: _og_serial_port_parity
        symbol:
          name: ogSerialPortParity
          OID: 1.3.6.1.4.1.25049.17.2.1.5
        mapping:
          1: none
          2: odd
          3: even
          4: mark
          5: space
      - tag: _og_serial_port_stop_bits
        symbol:
          name: ogSerialPortStopBits
          OID: 1.3.6.1.4.1.25049.17.2.1.6
        mapping:
          1: one
          2: two
          3: one_and_a_half
      - tag: _og_serial_port_flow_control
        symbol:
          name: ogSerialPortFlowControl
          OID: 1.3.6.1.4.1.25049.17.2.1.7
        mapping:
          1: none
          2: hardware
          3: software
      - tag: _og_serial_port_mode
        symbol:
          name: ogSerialPortMode
          OID: 1.3.6.1.4.1.25049.17.2.1.8
        mapping:
          1: none
          2: console
          3: sdt
          4: terminal
          5: bridge
      - tag: _og_serial_port_log_level
        symbol:
          name: ogSerialPortLogLevel
          OID: 1.3.6.1.4.1.25049.17.2.1.9
        mapping:
          1: disabled
          2: connect
          3: input_and_output
          4: input_only
          5: output_only
      - tag: _og_serial_port_dcd
        symbol:
          name: ogSerialPortDCD
          OID: 1.3.6.1.4.1.25049.17.2.1.16
        mapping:
          1: on
          2: off
      - tag: _og_serial_port_dtr
        symbol:
          name: ogSerialPortDTR
          OID: 1.3.6.1.4.1.25049.17.2.1.17
        mapping:
          1: on
          2: off
      - tag: _og_serial_port_dsr
        symbol:
          name: ogSerialPortDSR
          OID: 1.3.6.1.4.1.25049.17.2.1.18
        mapping:
          1: on
          2: off
      - tag: _og_serial_port_cts
        symbol:
          name: ogSerialPortCTS
          OID: 1.3.6.1.4.1.25049.17.2.1.19
        mapping:
          1: on
          2: off
      - tag: _og_serial_port_rts
        symbol:
          name: ogSerialPortRTS
          OID: 1.3.6.1.4.1.25049.17.2.1.20
        mapping:
          1: on
          2: off

  - MIB: OG-STATUSv2-MIB
    table:
      name: ogCellModemTable
      OID: 1.3.6.1.4.1.25049.17.17
    symbols:
      - name: ogCellModemCounter
        OID: 1.3.6.1.4.1.25049.17.17.1.16
        chart_meta:
          family: 'Network/CellModem/Event'
          description: Number of cell modem events counted
          unit: "{event}/s"
      - OID: 1.3.6.1.4.1.25049.17.17.1.4
        name: ogCellModemEnabled
        chart_meta:
          family: 'Network/CellModem/Status/Enabled'
          description: Indicates whether the model is enabled
          unit: "{status}"
        mapping:
          1: enabled
          2: disabled
      - OID: 1.3.6.1.4.1.25049.17.17.1.5
        name: ogCellModemConnected
        chart_meta:
          family: 'Network/CellModem/Status/Connected'
          description: Indicates whether the model is connected
          unit: "{status}"
        mapping:
          1: connected
          2: disconnected
    metric_tags:
      - tag: og_cell_modem_index
        index: 1  # ogCellModemIndex
      - tag: og_cell_modem_vendor
        symbol:
          name: ogCellModemVendor
          OID: 1.3.6.1.4.1.25049.17.17.1.2
      - tag: og_cell_modem_model
        symbol:
          name: ogCellModemModel
          OID: 1.3.6.1.4.1.25049.17.17.1.3
