# Example sysDescr:
# - device-name-3 263829375 Isilon OneFS v8.2.0.0
# - device-name-5 2316163007 Isilon OneFS v8.1.2.0
extends:
  - _system-base.yaml
  - _std-ip-mib.yaml
  - _std-tcp-mib.yaml
  - _std-udp-mib.yaml

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.12124.*

        # Looks like EMC Isilon devices might use the wrong sysObjectID `1.3.6.1.4.1.12325.1.1.2.1.1` (FreeBSD-FOKUS)
        # Few related discussions:
        # - https://thwack.solarwinds.com/product-forums/network-performance-monitor-npm/f/forum/66098/emc-isilon-showing-up-as-non-emc-device-after-upgrade/39511
        # - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0761173
        # - https://github.com/librenms/librenms/issues/6412
        # Long term solution:
        # Similar to librenms a possible solution is to have other ways to match devices like sysDescr text matching. See example:
        # https://github.com/librenms/librenms/pull/6416/files#diff-ec0470a0c495f1349b349f62b0dfdf14b928a5acb94f0de5f6c5a6e523f7817cR12-R16
        - 1.3.6.1.4.1.12325.1.1.2.1.1

metadata:
  device:
    fields:
      vendor:
        value: "Dell"
      type:
        value: "Storage"
      serial_number:
        symbol:
          OID: 1.3.6.1.4.1.12124.2.51.1.3.1
          name: chassisSerialNumber  # The chassis serial number.
      version:
        symbol:
          OID: 1.3.6.1.2.1.1.1.0
          name: sysDescr
          match_pattern: 'Isilon OneFS v(\S+)'
          match_value: '$1'
          # Examples:
          #  - device-name-3 263829375 Isilon OneFS v8.2.0.0
      product_name:
        value: 'Isilon OneFS'
      model:
        symbol:
          OID: 1.3.6.1.4.1.12124.2.51.1.4.1
          name: chassisModel  # The chassis model name.
          # source/hints:
          # - https://www.dell.com/support/kbdoc/fr-fr/000020536/isilon-how-to-find-serial-numbers-for-isilon-nodes?lang=en
          # - https://www.dell.com/community/Isilon/Querying-Isilon-Cluster-via-SNMP-For-Node-Model/td-p/7048622
      os_name:
        symbol:
          OID: 1.3.6.1.2.1.1.1.0
          name: sysDescr
          match_pattern: '\bOneFS\b'
          match_value: 'OneFS'
          # Examples:
          #  - device-name-3 263829375 Isilon OneFS v8.2.0.0
      os_version:
        # OneFS operating system version seems to be the same as the OneFS filestem version
        symbol:
          OID: 1.3.6.1.2.1.1.1.0
          name: sysDescr
          match_pattern: 'Isilon OneFS v(\S+)'
          match_value: '$1'
          # Examples:
          #  - device-name-3 263829375 Isilon OneFS v8.2.0.0

metric_tags:
  - tag: cluster_name
    OID: 1.3.6.1.4.1.12124.1.1.1.0
    symbol: clusterName
  - tag: node_name
    OID: 1.3.6.1.4.1.12124.2.1.1.0
    symbol: nodeName
  - tag: node_type
    OID: 1.3.6.1.4.1.12124.2.1.3.0
    symbol: nodeType

# - ISILON-MIB
#    https://mibbrowser.online/mibdb_search.php?mib=ISILON-MIB
#    https://github.com/librenms/librenms/blob/master/mibs/emc/ISILON-MIB

metrics:
  # fan hardware
  - MIB: ISILON-MIB
    table:
      OID: 1.3.6.1.4.1.12124.2.53
      name: fanTable
    symbols:
      - OID: 1.3.6.1.4.1.12124.2.53.1.4
        name: fanSpeed
        chart_meta:
          description: The current speed of the fan in revolutions per minute
          family: 'Hardware/Fan/Speed'
          unit: "{revolution}/min"
    metric_tags:
      - tag: fan_number
        symbol:
          OID: 1.3.6.1.4.1.12124.2.53.1.1
          name: fanNumber
      - tag: fan_name
        symbol:
          OID: 1.3.6.1.4.1.12124.2.53.1.2
          name: fanName

  # cluster
  - MIB: ISILON-MIB
    symbol:
      OID: 1.3.6.1.4.1.12124.1.1.2.0
      name: clusterHealth
      chart_meta:
        description: The overall health of the cluster
        family: 'System/Cluster/Health/Status'
        unit: "{status}"
      mapping:
        0: ok
        1: attn
        2: down
        3: invalid

  - MIB: ISILON-MIB
    symbol:
      OID: 1.3.6.1.4.1.12124.1.2.1.1.0
      name: clusterIfsInBytes
      chart_meta:
        description: The cumulative number of bytes into /ifs
        family: 'Storage/FileSystem/Throughput/In'
        unit: "By/s"

  - MIB: ISILON-MIB
    symbol:
      OID: 1.3.6.1.4.1.12124.1.2.1.3.0
      name: clusterIfsOutBytes
      chart_meta:
        description: The cumulative number of bytes out of /ifs
        family: 'Storage/FileSystem/Throughput/Out'
        unit: "By/s"

  # file system
  - MIB: ISILON-MIB
    symbol:
      OID: 1.3.6.1.4.1.12124.1.3.2.0
      name: ifsUsedBytes
      chart_meta:
        description: The number of bytes used in the /ifs filesystem
        family: 'Storage/FileSystem/Used'
        unit: "By"
  - MIB: ISILON-MIB
    symbol:
      OID: 1.3.6.1.4.1.12124.1.3.1.0
      name: ifsTotalBytes
      chart_meta:
        description: The total cluster capacity of the /ifs filesystem in bytes
        family: 'Storage/FileSystem/Total'
        unit: "By"

  # node
  - MIB: ISILON-MIB
    symbol:
      OID: 1.3.6.1.4.1.12124.2.1.2.0
      name: nodeHealth
      chart_meta:
        description: The overall health of the node
        family: 'System/Node/Health/Status'
        unit: "{status}"
      mapping:
        0: ok
        1: attn
        2: down
        3: invalid

  - MIB: ISILON-MIB
    symbol:
      OID: 1.3.6.1.4.1.12124.2.2.1.1.0
      name: nodeIfsInBytes
      chart_meta:
        description: The number of bytes into /ifs through this node
        family: 'System/Node/Throughput/In'
        unit: "By/s"
  - MIB: ISILON-MIB
    symbol:
      OID: 1.3.6.1.4.1.12124.2.2.1.3.0
      name: nodeIfsOutBytes
      chart_meta:
        description: The number of bytes out of /ifs through this node
        family: 'System/Node/Throughput/Out'
        unit: "By/s"

  # disk
  - MIB: ISILON-MIB
    table:
      OID: 1.3.6.1.4.1.12124.2.52
      name: diskTable
    symbols:
      - OID: 1.3.6.1.4.1.12124.2.52.1.9
        name: diskSizeBytes
        chart_meta:
          description: The size of the disk in bytes
          family: 'Hardware/Disk/Size'
          unit: "By"
      - OID: 1.3.6.1.4.1.12124.2.52.1.5
        name: diskStatus
        chart_meta:
          description: The operational status of the disk
          family: 'Hardware/Disk/Status'
          unit: "{status}"
        mapping:
          # Commonly returned values include (but not limited to):
          # TODO: need some "other" for mappings
          HEALTHY: 1
          L3: 2
          DEAD: 3
          SMARTFAIL: 4
    metric_tags:
      - tag: disk_bay
        symbol:
          OID: 1.3.6.1.4.1.12124.2.52.1.1
          name: diskBay
      - tag: disk_logical_number
        symbol:
          OID: 1.3.6.1.4.1.12124.2.52.1.2
          name: diskLogicalNumber
      - tag: disk_chassis_number
        symbol:
          OID: 1.3.6.1.4.1.12124.2.52.1.3
          name: diskChassisNumber
      - tag: _disk_device_name
        symbol:
          OID: 1.3.6.1.4.1.12124.2.52.1.4
          name: diskDeviceName
      - tag: _disk_device_model
        symbol:
          OID: 1.3.6.1.4.1.12124.2.52.1.6
          name: diskDeviceModel
      - tag: _disk_serial_number
        symbol:
          OID: 1.3.6.1.4.1.12124.2.52.1.7
          name: diskSerialNumber

  # protocol
  - MIB: ISILON-MIB
    table:
      OID: 1.3.6.1.4.1.12124.2.2.10
      name: nodeProtocolPerfTable
    symbols:
      - OID: 1.3.6.1.4.1.12124.2.2.10.1.3
        name: protocolOpsPerSecond
        chart_meta:
          description: The number of operations per second for the last 5 second
          family: 'Storage/Protocol/Operations'
          unit: "{operation}/s"
      - OID: 1.3.6.1.4.1.12124.2.2.10.1.14
        name: latencyMin
        chart_meta:
          description: The minimum latency in microseconds for all operations for the protocol
          family: 'Storage/Protocol/Latency/Min'
          unit: "us"
      - OID: 1.3.6.1.4.1.12124.2.2.10.1.15
        name: latencyMax
        chart_meta:
          description: The maximum latency in microseconds for all operations for the protocol
          family: 'Storage/Protocol/Latency/Max'
          unit: "us"
      - OID: 1.3.6.1.4.1.12124.2.2.10.1.16
        name: latencyAverage
        chart_meta:
          description: The average latency in microseconds for all operations for the protocol
          family: 'Storage/Protocol/Latency/Average'
          unit: "us"
    metric_tags:
      - tag: protocol_name
        symbol:
          OID: 1.3.6.1.4.1.12124.2.2.10.1.1
          name: protocolName

  # quota
  - MIB: ISILON-MIB
    table:
      OID: 1.3.6.1.4.1.12124.1.12.1
      name: quotaTable
    symbols:
      - OID: 1.3.6.1.4.1.12124.1.12.1.1.7
        name: quotaHardThreshold
        chart_meta:
          description: The hard threshold in bytes
          family: 'Storage/Quota/Threshold/Hard'
          unit: "By"
      - OID: 1.3.6.1.4.1.12124.1.12.1.1.9
        name: quotaSoftThreshold
        chart_meta:
          description: The soft threshold in bytes
          family: 'Storage/Quota/Threshold/Soft'
          unit: "By"
      - OID: 1.3.6.1.4.1.12124.1.12.1.1.13
        name: quotaUsage
        chart_meta:
          description: The current quota usage in bytes
          family: 'Storage/Quota/Usage'
          unit: "By"
      - OID: 1.3.6.1.4.1.12124.1.12.1.1.11
        name: quotaAdvisoryThreshold
        chart_meta:
          description: The advisory threshold in bytes
          family: 'Storage/Quota/Threshold/Advisory'
          unit: "By"
    metric_tags:
      - tag: quota_domain_id
        symbol:
          OID: 1.3.6.1.4.1.12124.1.12.1.1.1
          name: quotaDomainID
      - tag: quota_type
        symbol:
          OID: 1.3.6.1.4.1.12124.1.12.1.1.2
          name: quotaType
      - tag: quota_id
        symbol:
          OID: 1.3.6.1.4.1.12124.1.12.1.1.3
          name: quotaID
