extends:
  - _system-base.yaml
  - _std-entity-sensor-mib.yaml
  - _std-if-mib.yaml
  - _std-ospf-mib.yaml
  - avaya.yaml

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.6889.1.45.103.8 # G450 Media Gateway
        - 1.3.6.1.4.1.6889.1.45.103.41 # G430 Media Gateway

metadata:
  device:
    fields:
      type:
        value: "Media Gateway"

metric_tags:
  - tag: avaya_cmg_hw_type
    OID: 1.3.6.1.4.1.6889.2.9.1.1.1.0
    symbol: cmgHWType
    mapping:
      1: media-gateway
      2: g350
      3: avaya_g250
      4: avaya_g250-bri
      5: avaya_g250-ds1
      6: avaya_g250-dcp
      7: avaya_g450
      8: avaya_g250-a14
      10: avaya_tgm550
      28: avaya_communication_manager_branch_editioni120
      29: avaya_communication_manager_branch_editioni40-analog
      30: avaya_communication_manager_branch_editioni40-bri
      31: avaya_communication_manager_branch_editioni40-ds1
      32: avaya_communication_manager_branch_editioni40-dcp
      33: avaya_trm480
      34: avaya_communication_manager_branch_editioni40-a14
      35: avaya_communication_manager_branch_edition_g450
      37: avaya_communication_manager_branch_edition_g430
      41: avaya_g430
  - tag: avaya_cmg_model_number
    OID: 1.3.6.1.4.1.6889.2.9.1.1.2.0
    symbol: cmgModelNumber
  - tag: avaya_cmg_serial_number
    OID: 1.3.6.1.4.1.6889.2.9.1.1.4.0
    symbol: cmgSerialNumber
  - tag: avaya_cmg_active_controller_address
    OID: 1.3.6.1.4.1.6889.2.9.1.3.2.0
    symbol: cmgActiveControllerAddress

metrics:
  - MIB: AVAYA-ENTITY-MIB
    table:
      name: avEntPhyChFruTable
      OID: 1.3.6.1.4.1.6889.2.1.99.5.1
    symbols:
      - OID: 1.3.6.1.4.1.6889.2.1.99.5.1.1.2
        name: avaya.avEntPhyChFruFault
        chart_meta:
          description: Description of FRU fault
          family: 'Hardware/FRU/Fault/Status'
          unit: "{status}"
        mapping:
          1: none
          2: mulfunction
          3: ac_fault
          4: malfunction_and_ac_fault
          5: single_fan_fault
          6: multiple_fan_fault
          7: bad_expansion_cable
          255: unknown
      - OID: 1.3.6.1.4.1.6889.2.1.99.5.1.1.1
        name: avaya.avEntPhyChFruOperStat
        chart_meta:
          description: Operational status of the chassis FRU unit
          family: 'Hardware/FRU/Operational/Status'
          unit: "{status}"
        mapping:
          1: ok
          2: fault
          3: not_present
          255: unknown
    metric_tags:
      - index: 1
        tag: avaya_ent_physical_index

  - MIB: G700-MG-MIB
    symbol:
      name: avaya.cmgRemoteSig802Priority
      OID: 1.3.6.1.4.1.6889.2.9.1.2.2.3.0
      chart_meta:
        description: 802.1 priority for signaling traffic on the H.248 link received from the controller
        family: 'Voice/H248/SignalPriority/Remote'
        unit: "1"

  - MIB: G700-MG-MIB
    symbol:
      name: avaya.cmgLocalSig802Priority
      OID: 1.3.6.1.4.1.6889.2.9.1.2.2.5.0
      chart_meta:
        description: 802.1 priority for signaling traffic on the H.248 link locally administered
        family: 'Voice/H248/SignalPriority/Local'
        unit: "1"

  - MIB: G700-MG-MIB
    symbol:
      name: avaya.cmgH248LinkErrorCode
      OID: 1.3.6.1.4.1.6889.2.9.1.3.4.0
      chart_meta:
        description: Most recently received H.248 error code affecting the link between media gateway and controller
        family: 'Voice/H248/Link/Error/Status'
        unit: "{status}"
      mapping:
        0: No error
        400: Syntax error in message
        403: Syntax error in TransactionRequest
        406: Version not supported
        410: Incorrect identifier
        411: The transaction refers to an unknown ContextId
        412: No ContextIDs available
        421: Unknown action or illegal combination of actions
        422: Syntax error in action
        430: Unknown TerminationID
        431: No TerminationID matched a wildcard
        432: Out of TerminationIDs or No TerminationID available
        433: TerminationID is already in a Context
        434: Max number of Terminations in a Context exceeded
        440: Unsupported or unknown package
        441: Missing remote or local descriptor
        442: Syntax error in command
        443: Unknown command
        444: Unsupported or unknown descriptor
        445: Unsupported property
        446: Unsupported or unknown parameter
        447: Descriptor not legal in this command
        448: Descriptor appears twice in a command
        450: No such property in this package
        451: No such event in this package
        452: No such signal in this package
        453: No such statistic in this package
        454: No such parameter value in this package
        455: Parameter illegal in this descriptor
        456: Parameter or property appears twice in this descriptor
        457: Missing parameter in signal or event
        471: Implied add for multiplex failure
        500: Internal software failure in the media gateway
        501: Not implemented
        502: Not ready
        503: Service unavailable
        504: Command received from unauthorized entity
        505: Transaction Request received before ServiceChange Reply received
        510: Insufficient resources
        512: Gateway unequipped to detect requested event
        513: Gateway unequipped to generate requested signal
        514: Gateway cannot send the specified announcement
        515: Unsupported media type
        517: Unsupported or invalid mode
        518: Event buffer full
        519: Out of space to store digit map
        520: Digit map undefined in MG
        521: Termination is 'Service Changing'
        526: Insufficient bandwidth
        529: Internal hardware failure in MG
        530: Temporary network failure
        531: Permanent network failure
        581: Does not exist
  - MIB: G700-MG-MIB
    table:
      name: cmgVoipEngineTable
      OID: 1.3.6.1.4.1.6889.2.9.1.4.5
    symbols:
      - name: avaya.cmgVoipTotalChannels
        OID: 1.3.6.1.4.1.6889.2.9.1.4.5.1.6
        chart_meta:
          description: Total number of channels available to the VoIP engine
          family: 'Voice/VoIPEngine/Channel/Total'
          unit: "{channel}"
      - name: avaya.cmgVoipChannelsInUse
        OID: 1.3.6.1.4.1.6889.2.9.1.4.5.1.7
        chart_meta:
          description: Number of channels currently in use at the VoIP engine
          family: 'Voice/VoIPEngine/Channel/InUse'
          unit: "{channel}"
      - name: avaya.cmgVoipAverageOccupancy
        OID: 1.3.6.1.4.1.6889.2.9.1.4.5.1.8
        chart_meta:
          description: Five-minute average occupancy of the VoIP engine
          family: 'Voice/VoIPEngine/Occupancy'
          unit: "%"
      - OID: 1.3.6.1.4.1.6889.2.9.1.4.5.1.9
        name: avaya.cmgVoipHyperactivity
        chart_meta:
          description: Indicates whether hyperactivity has been detected
          family: 'Voice/VoIPEngine/Hyperactivity/Status'
          unit: "{status}"
        mapping:
          1: normal
          2: hyperactive
          255: unknown
      - OID: 1.3.6.1.4.1.6889.2.9.1.4.5.1.10
        name: avaya.cmgVoipAdminState
        chart_meta:
          description: Maintenance busy-out state
          family: 'Voice/VoIPEngine/Admin/Status'
          unit: "{status}"
        mapping:
          1: busy-out
          2: release
          3: camp-on
          255: unknown
      - OID: 1.3.6.1.4.1.6889.2.9.1.4.5.1.12
        name: avaya.cmgVoipDspStatus
        chart_meta:
          description: Status of the DSP complex
          family: 'Voice/VoIPEngine/DSP/Status'
          unit: "{status}"
        mapping:
          1: idle
          2: in_use
          3: fault
    metric_tags:
      - symbol:
          name: avaya.cmgVoipCurrentIpAddress
          OID: 1.3.6.1.4.1.6889.2.9.1.4.5.1.4
        tag: avaya_cmg_voip_current_ip_address
  - MIB: G700-MG-MIB
    table:
      name: cmgVoipDSPCoreTable
      OID: 1.3.6.1.4.1.6889.2.9.1.4.6
    symbols:
      - name: avaya.cmgDSPCoreTotalChannels
        OID: 1.3.6.1.4.1.6889.2.9.1.4.6.1.2
        chart_meta:
          description: Total number of channels available to the DSP core
          family: 'Voice/VoIPEngine/DSPCore/Channel/Total'
          unit: "{channel}"
      - name: avaya.cmgDSPCoreChannelsInUse
        OID: 1.3.6.1.4.1.6889.2.9.1.4.6.1.3
        chart_meta:
          description: Number of channels currently in use at the DSP core
          family: 'Voice/VoIPEngine/DSPCore/Channel/InUse'
          unit: "{channel}"
      - OID: 1.3.6.1.4.1.6889.2.9.1.4.6.1.4
        name: avaya.cmgDSPCoreAdminState
        chart_meta:
          description: Maintenance busy-out state
          family: 'Voice/VoIPEngine/DSPCore/Admin/Status'
          unit: "{status}"
        mapping:
          1: busy-out
          2: release
          3: camp-on
          255: unknown
      - OID: 1.3.6.1.4.1.6889.2.9.1.4.6.1.5
        name: avaya.cmgDSPCoreStatus
        chart_meta:
          description: Status of the DSP core
          family: 'Voice/VoIPEngine/DSPCore/Operational/Status'
          unit: "{status}"
        mapping:
          1: idle
          2: in_use
          3: fault
      - OID: 1.3.6.1.4.1.6889.2.9.1.4.6.1.7
        name: avaya.cmgDSPCoreDemandTestResult
        chart_meta:
          description: Result of demand test
          family: 'Voice/VoIPEngine/DSPCore/Test/Result'
          unit: "{status}"
        mapping:
          1: error_code1
          2: error_code2
          3: error_code3
          4: error_code4
          5: error_code5
          6: error_code6
          7: not_responding
          255: pass
    metric_tags:
      - tag: avaya_cmg_dsp_core_id
        symbol:
          OID: 1.3.6.1.4.1.6889.2.9.1.4.6.1.1
          name: avaya.cmgDSPCoreCoreId
