extends:
  - _system-base.yaml
  - _std-if-mib.yaml

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.23867.1.2.*  # Silverpeak devices

metadata:
  device:
    fields:
      vendor:
        value: "Silverpeak"
      type:
        value: "SD-WAN"
      serial_number:
        symbol:
          MIB: SILVERPEAK-MGMT-MIB
          OID: 1.3.6.1.4.1.23867.3.1.1.1.6.0
          name: spsSystemSerial
      os_version:
        symbol:
          MIB: SILVERPEAK-MGMT-MIB
          OID: 1.3.6.1.4.1.23867.3.1.1.1.1.0
          name: spsSystemVersion
      product_name:
        symbol:
          MIB: SILVERPEAK-MGMT-MIB
          OID: 1.3.6.1.4.1.23867.3.1.1.1.2.0
          name: spsProductModel

# SILVERPEAK-MGMT-MIB
# https://mibbrowser.online/mibdb_search.php?mib=SILVERPEAK-MGMT-MIB
# https://github.com/DanielleHuisman/observium-community-edition/blob/main/mibs/silverpeak/SILVERPEAK-MGMT-MIB

metrics:
  - MIB: SILVERPEAK-MGMT-MIB
    symbol:
      OID: 1.3.6.1.4.1.23867.3.1.1.1.4.0
      name: silverpeak.mgmt.spsActiveAlarmCount
      chart_meta:
        description: The number of active alarm entries in the alarm table
        family: 'System/Alarm/Active'
        unit: "{alarm}"

  - MIB: SILVERPEAK-MGMT-MIB
    table:
      OID: 1.3.6.1.4.1.23867.3.1.1.2.1
      name: spsActiveAlarmTable
    symbols:
      - OID: 1.3.6.1.4.1.23867.3.1.1.2.1.1.3
        name: silverpeak.mgmt.spsActiveAlarmSeverity
        chart_meta:
          description: Severity level of the active alarm
          family: 'System/Alarm/Severity'
          unit: "{status}"
        mapping:
          0: info
          1: warning
          2: minor
          3: major
          4: critical
          5: cleared
          6: acknowledged
          7: unacknowledged
          8: indeterminate
      - OID: 1.3.6.1.4.1.23867.3.1.1.2.1.1.8
        name: silverpeak.mgmt.spsActiveAlarmAcked
        chart_meta:
          description: Acknowledgement status of the active alarm
          family: 'System/Alarm/Status/Acknowledged'
          unit: "{status}"
        mapping:
          0: no
          1: yes
      - OID: 1.3.6.1.4.1.23867.3.1.1.2.1.1.9
        name: silverpeak.mgmt.spsActiveAlarmActive
        chart_meta:
          description: Active status of the alarm
          family: 'System/Alarm/Status/Active'
          unit: "{status}"
        mapping:
          0: no
          1: yes
      - OID: 1.3.6.1.4.1.23867.3.1.1.2.1.1.10
        name: silverpeak.mgmt.spsActiveAlarmClearable
        chart_meta:
          description: Whether the alarm can be manually cleared
          family: 'System/Alarm/Status/Clearable'
          unit: "{status}"
        mapping:
          0: no
          1: yes
      - OID: 1.3.6.1.4.1.23867.3.1.1.2.1.1.12
        name: silverpeak.mgmt.spsActiveAlarmServiceAffect
        chart_meta:
          description: Whether the alarm affects service
          family: 'System/Alarm/Status/ServiceImpact'
          unit: "{status}"
        mapping:
          0: no
          1: yes
    metric_tags:
      - tag: silverpeak_mgmt_sps_active_alarm_index
        index: 1
      - tag: silverpeak_mgmt_sps_active_alarm_name
        symbol:
          OID: 1.3.6.1.4.1.23867.3.1.1.2.1.1.4
          name: silverpeak.mgmt.spsActiveAlarmName
      - tag: _silverpeak_mgmt_sps_active_alarm_descr
        symbol:
          OID: 1.3.6.1.4.1.23867.3.1.1.2.1.1.5
          name: silverpeak.mgmt.spsActiveAlarmDescr
      - tag: _silverpeak_mgmt_sps_active_alarm_source
        symbol:
          OID: 1.3.6.1.4.1.23867.3.1.1.2.1.1.6
          name: silverpeak.mgmt.spsActiveAlarmSource
      - tag: _silverpeak_mgmt_sps_active_alarm_type
        symbol:
          OID: 1.3.6.1.4.1.23867.3.1.1.2.1.1.7
          name: silverpeak.mgmt.spsActiveAlarmType
