# - UCD-SNMP-MIB
#   https://mibbrowser.online/mibdb_search.php?mib=UCD-SNMP-MIB
#   https://github.com/DanielleHuisman/observium-community-edition/blob/main/mibs/net-snmp/UCD-SNMP-MIB
# - UCD-DISKIO-MIB
#   https://mibbrowser.online/mibdb_search.php?mib=UCD-DISKIO-MIB
#   https://github.com/DanielleHuisman/observium-community-edition/blob/main/mibs/net-snmp/UCD-DISKIO-MIB

metrics:
  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.memoryTotal
      OID: 1.3.6.1.4.1.2021.4.5.0
      chart_meta:
        family: 'System/Memory/Physical/Total'
        description: The total amount of real/physical memory installed on this host
        unit: "By"
      scale_factor: 1024
  - MIB: UCD-SNMP-MIB
    symbol:
      name: memory.free
      OID: 1.3.6.1.4.1.2021.4.6.0
      chart_meta:
        family: 'System/Memory/Physical/Free'
        description: The amount of real/physical memory currently unused or available
        unit: "By"
      scale_factor: 1024
  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.memTotalSwap
      OID: 1.3.6.1.4.1.2021.4.3.0
      chart_meta:
        family: 'System/Memory/Swap/Total'
        description: The total amount of swap space configured for this host
        unit: "By"
      scale_factor: 1024
  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.memAvailSwap
      OID: 1.3.6.1.4.1.2021.4.4.0
      chart_meta:
        family: 'System/Memory/Swap/Available'
        description: The amount of swap space currently unused or available
        unit: "By"
      scale_factor: 1024
  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.memTotalFree
      OID: 1.3.6.1.4.1.2021.4.11.0
      chart_meta:
        family: 'System/Memory/Available/Total'
        description: The total amount of memory free or available for use on this host
        unit: "By"
      scale_factor: 1024
  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.memMinimumSwap
      OID: 1.3.6.1.4.1.2021.4.12.0
      chart_meta:
        family: 'System/Memory/Swap/Minimum'
        description: The minimum amount of swap space expected to be kept free or available during normal operation of this host
        unit: "By"
      scale_factor: 1024
  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.memShared
      OID: 1.3.6.1.4.1.2021.4.13.0
      chart_meta:
        family: 'System/Memory/Physical/Shared'
        description: The total amount of real or virtual memory currently allocated for use as shared memory
        unit: "By"
      scale_factor: 1024
  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.memBuffer
      OID: 1.3.6.1.4.1.2021.4.14.0
      chart_meta:
        family: 'System/Memory/Physical/Buffer'
        description: The total amount of real or virtual memory currently allocated for use as memory buffers
        unit: "By"
      scale_factor: 1024
  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.memCached
      OID: 1.3.6.1.4.1.2021.4.15.0
      chart_meta:
        family: 'System/Memory/Physical/Cached'
        description: The total amount of real or virtual memory currently allocated for use as cached memory
        unit: "By"
      scale_factor: 1024

  - MIB: UCD-SNMP-MIB
    table:
      OID: 1.3.6.1.4.1.2021.9
      name: dskTable
    symbols:
      - name: ucd.dskTotal
        OID: 1.3.6.1.4.1.2021.9.1.6
        chart_meta:
          family: 'System/Disk/Space/Total'
          description: Total size of the disk/partition
          unit: "By"
        scale_factor: 1024
      - name: ucd.dskAvail
        OID: 1.3.6.1.4.1.2021.9.1.7
        chart_meta:
          family: 'System/Disk/Space/Available'
          description: Available space on the disk
          unit: "By"
        scale_factor: 1024
      - name: ucd.dskUsed
        OID: 1.3.6.1.4.1.2021.9.1.8
        chart_meta:
          family: 'System/Disk/Space/Used'
          description: Used space on the disk
          unit: "By"
        scale_factor: 1024
      - name: ucd.dskPercent
        OID: 1.3.6.1.4.1.2021.9.1.9
        chart_meta:
          family: 'System/Disk/Usage'
          description: Percentage of space used on disk
          unit: "%"
      - name: ucd.dskPercentNode
        OID: 1.3.6.1.4.1.2021.9.1.10
        chart_meta:
          family: 'System/Disk/Inode/Usage'
          description: Percentage of inodes used on disk
          unit: "%"
      - name: ucd.dskErrorFlag
        OID: 1.3.6.1.4.1.2021.9.1.100
        chart_meta:
          family: 'System/Disk/Error/Status'
          description: Flag signaling that the disk or partition is under the minimum required space configured for it
          unit: "{status}"
        mapping:
          0: no_error
          1: error
    metric_tags:
      - tag: ucd_dsk_path
        symbol:
          OID: 1.3.6.1.4.1.2021.9.1.2
          name: ucd.dskPath
      - tag: ucd_dsk_device
        symbol:
          OID: 1.3.6.1.4.1.2021.9.1.3
          name: ucd.dskDevice

  - MIB: UCD-DISKIO-MIB
    table:
      OID: 1.3.6.1.4.1.2021.13.15.1.1
      name: diskIOTable
    symbols:
      - name: ucd.diskIOReads
        OID: 1.3.6.1.4.1.2021.13.15.1.1.5
        chart_meta:
          family: 'System/Disk/IOPS/Read'
          description: The number of read accesses from this device since boot
          unit: "{read}/s"
      - name: ucd.diskIOWrites
        OID: 1.3.6.1.4.1.2021.13.15.1.1.6
        chart_meta:
          family: 'System/Disk/IOPS/Write'
          description: The number of write accesses to this device since boot
          unit: "{write}/s"
      - name: ucd.diskIOLA1
        OID: 1.3.6.1.4.1.2021.13.15.1.1.9
        chart_meta:
          family: 'System/Disk/LoadAverage/1Min'
          description: The 1 minute average load of disk (%)
          unit: "%"
      - name: ucd.diskIOLA5
        OID: 1.3.6.1.4.1.2021.13.15.1.1.10
        chart_meta:
          family: 'System/Disk/LoadAverage/5Min'
          description: The 5 minute average load of disk (%)
          unit: "%"
      - name: ucd.diskIOLA15
        OID: 1.3.6.1.4.1.2021.13.15.1.1.11
        chart_meta:
          family: 'System/Disk/LoadAverage/15Min'
          description: The 15 minute average load of disk (%)
          unit: "%"
      - name: ucd.diskIONReadX
        OID: 1.3.6.1.4.1.2021.13.15.1.1.12
        chart_meta:
          family: 'System/Disk/IO/Read'
          description: The number of bytes read from this device since boot
          unit: "By/s"
      - name: ucd.diskIONWrittenX
        OID: 1.3.6.1.4.1.2021.13.15.1.1.13
        chart_meta:
          family: 'System/Disk/IO/Write'
          description: The number of bytes written to this device since boot
          unit: "By/s"
    metric_tags:
      - tag: ucd_disk_io_device
        symbol:
          name: ucd.diskIODevice
          OID: 1.3.6.1.4.1.2021.13.15.1.1.2

  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.ssIORawSent
      OID: 1.3.6.1.4.1.2021.11.57.0
      chart_meta:
        family: 'System/Disk/Total/IO/Write'
        description: Amount of data written to disk or other block device
        unit: "By/s"
      scale_factor: 512

  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.ssIORawReceived
      OID: 1.3.6.1.4.1.2021.11.58.0
      chart_meta:
        family: 'System/Disk/Total/IO/Read'
        description: Amount of data read from disk or other block device
        unit: "By/s"
      scale_factor: 512

  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.ssRawInterrupts
      OID: 1.3.6.1.4.1.2021.11.59.0
      chart_meta:
        family: 'System/CPU/Interrupts'
        description: Number of interrupts processed
        unit: "{interrupt}/s"

  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.ssRawContexts
      OID: 1.3.6.1.4.1.2021.11.60.0
      chart_meta:
        family: 'System/CPU/ContextSwitches'
        description: Number of context switches
        unit: "{switch}/s"

  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.ssRawSwapIn
      OID: 1.3.6.1.4.1.2021.11.62.0
      chart_meta:
        family: 'System/Memory/Swap/IO/In'
        description: Amount of memory swapped in from disk
        unit: "By/s"
      scale_factor: 512

  - MIB: UCD-SNMP-MIB
    symbol:
      name: ucd.ssRawSwapOut
      OID: 1.3.6.1.4.1.2021.11.63.0
      chart_meta:
        family: 'System/Memory/Swap/IO/Out'
        description: Amount of memory swapped out to disk
        unit: "By/s"
      scale_factor: 512

  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.cpuLoad1m
      OID: 1.3.6.1.4.1.2021.10.1.5.1
      scale_factor: 0.01
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.cpuLoad5m
      OID: 1.3.6.1.4.1.2021.10.1.5.2
      scale_factor: 0.01
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.cpuLoad15m
      OID: 1.3.6.1.4.1.2021.10.1.5.3
      scale_factor: 0.01

  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.ssCpuRawUser
      OID: 1.3.6.1.4.1.2021.11.50.0
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.ssCpuRawNice
      OID: 1.3.6.1.4.1.2021.11.51.0
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.ssCpuRawSystem
      OID: 1.3.6.1.4.1.2021.11.52.0
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.ssCpuRawIdle
      OID: 1.3.6.1.4.1.2021.11.53.0
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.ssCpuRawWait
      OID: 1.3.6.1.4.1.2021.11.54.0
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.ssCpuRawKernel
      OID: 1.3.6.1.4.1.2021.11.55.0
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.ssCpuRawInterrupt
      OID: 1.3.6.1.4.1.2021.11.56.0
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.ssCpuRawSoftIRQ
      OID: 1.3.6.1.4.1.2021.11.61.0
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.ssCpuRawSteal
      OID: 1.3.6.1.4.1.2021.11.64.0
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.ssCpuRawGuest
      OID: 1.3.6.1.4.1.2021.11.65.0
  - MIB: UCD-SNMP-MIB
    symbol:
      name: _ucd.ssCpuRawGuestNice
      OID: 1.3.6.1.4.1.2021.11.66.0

virtual_metrics:
  - name: ucd.cpu_usage
    chart_meta:
      description: CPU usage breakdown
      family: "System/CPU/Usage"
      unit: "%"
      type: stacked
    sources:
      - metric: _ucd.ssCpuRawUser
        as: user
      - metric: _ucd.ssCpuRawNice
        as: nice
      - metric: _ucd.ssCpuRawSystem
        as: system
      - metric: _ucd.ssCpuRawKernel
        as: kernel
      - metric: _ucd.ssCpuRawWait
        as: iowait
      - metric: _ucd.ssCpuRawInterrupt
        as: irq
      - metric: _ucd.ssCpuRawSoftIRQ
        as: softirq
      - metric: _ucd.ssCpuRawSteal
        as: steal
      - metric: _ucd.ssCpuRawGuest
        as: guest
      - metric: _ucd.ssCpuRawGuestNice
        as: guest_nice

  - name: ucd.cpuLoad
    chart_meta:
      description: Load average
      family: "System/LoadAverage"
      unit: "{load_average}"
    sources:
      - metric: _ucd.cpuLoad1m
        as: "1m"
      - metric: _ucd.cpuLoad5m
        as: "5m"
      - metric: _ucd.cpuLoad15m
        as: "15m"
