# Profile for Cisco Nexus devices

extends:
  - _system-base.yaml
  - _cisco-base.yaml

metadata:
  device:
    fields:
      type:
        value: "Switch"
      vendor:
        value: "Cisco"

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.9.1.1216 # ciscoN7KC7018IOS
        - 1.3.6.1.4.1.9.1.1217 # ciscoN7KC7010IOS
        - 1.3.6.1.4.1.9.1.1915 # ciscoN9KC9508
        - 1.3.6.1.4.1.9.1.1923 # ciscoN9KC93128TX
        - 1.3.6.1.4.1.9.1.1924 # ciscoN9KC9396TX
        - 1.3.6.1.4.1.9.1.1925 # ciscoN9KC9396PX
        - 1.3.6.1.4.1.9.12.3.1.3.*

metrics:
  - MIB: CISCO-ENTITY-SENSOR-MIB   # TODO: put in abstract profile
    table:
      OID: 1.3.6.1.4.1.9.9.91.1.1.1
      name: entSensorValueTable
    symbols:
      - OID: 1.3.6.1.4.1.9.9.91.1.1.1.1.4
        name: entSensorValue # Do not change this name — required by transformEntitySensorValue for matching and renaming logic
        chart_meta:
          description: Most recent measurement obtained by the agent for this sensor
          family: 'Hardware/Sensor/Value'
          unit: "1"
        transform: |
          {{- transformEntitySensorValue .Metric -}}
    metric_tags:
      - tag: sensor_index
        index: 1
      - tag: _ent_phys_descr
        MIB: ENTITY-MIB
        table: entPhysicalTable
        symbol:
          OID: 1.3.6.1.2.1.47.1.1.1.1.2
          name: entPhysicalDescr
      - tag: rm:sensor_type # needed for transform
        symbol:
          OID: 1.3.6.1.4.1.9.9.91.1.1.1.1.1
          name: entSensorType
      - tag: rm:sensor_scale # needed for transform
        symbol:
          OID: 1.3.6.1.4.1.9.9.91.1.1.1.1.2
          name: entSensorScale
      - tag: rm:sensor_precision # needed for transform
        symbol:
          OID: 1.3.6.1.4.1.9.9.91.1.1.1.1.3
          name: entSensorPrecision

  - MIB: CISCO-ENHANCED-MEMPOOL-MIB # Overrides generic cisco defaults from _cisco-cpu-memory.yaml
    table:
      OID: 1.3.6.1.4.1.9.9.221.1.1.1
      name: cempMemPoolTable
    symbols:
      - OID: 1.3.6.1.4.1.9.9.221.1.1.1.1.7
        name: memory.used
        chart_meta:
          description: Number of bytes from the memory pool that are currently in use by applications on the physical entity
          family: 'System/Memory/Pool/Used'
          unit: "By"
      - OID: 1.3.6.1.4.1.9.9.221.1.1.1.1.8
        name: memory.free
        chart_meta:
          description: Number of bytes from the memory pool that are currently unused on the physical entity
          family: 'System/Memory/Pool/Free'
          unit: "By"
    metric_tags:
      - tag: mem_index
        index: 1
