# Synology SNMP Exporter Configuration
# Comprehensive config for monitoring Synology NAS devices
# Includes: CPU, Memory, Load, Storage, Network, Disks, RAID, Temperature

auths:
  snmpv3:
    version: 3
    security_level: authPriv
    auth_protocol: MD5
    username: snmp-exporter
    password: "REDACTED_PASSWORD"
    priv_protocol: DES
    priv_password: "REDACTED_PASSWORD"

modules:
  synology:
    walk:
      # Standard MIBs
      - 1.3.6.1.2.1.1             # System info (sysDescr, sysUpTime, etc.)
      - 1.3.6.1.2.1.2             # Interfaces
      - 1.3.6.1.2.1.25.2          # hrStorage (disk/memory usage)
      - 1.3.6.1.2.1.25.3.3        # hrProcessorLoad
      - 1.3.6.1.2.1.31.1.1        # ifXTable (64-bit counters)

      # UCD-SNMP-MIB (CPU, Memory, Load)
      - 1.3.6.1.4.1.2021.4        # Memory stats
      - 1.3.6.1.4.1.2021.10       # Load average
      - 1.3.6.1.4.1.2021.11       # CPU stats

      # Synology-specific MIBs
      - 1.3.6.1.4.1.6574.1        # System status, temp, power, fans, model
      - 1.3.6.1.4.1.6574.2        # Disk information
      - 1.3.6.1.4.1.6574.3        # RAID status
      - 1.3.6.1.4.1.6574.4        # UPS status
      - 1.3.6.1.4.1.6574.5        # Disk SMART info
      - 1.3.6.1.4.1.6574.6        # Service users
      - 1.3.6.1.4.1.6574.101      # Storage IO
      - 1.3.6.1.4.1.6574.102      # Space IO
      - 1.3.6.1.4.1.6574.104      # GPU info (if available)

    metrics:
      # ============================================
      # SYSTEM INFO
      # ============================================
      - name: sysDescr
        oid: 1.3.6.1.2.1.1.1
        type: DisplayString
        help: System description

      - name: sysUpTime
        oid: 1.3.6.1.2.1.1.3
        type: gauge
        help: System uptime in hundredths of a second

      - name: sysName
        oid: 1.3.6.1.2.1.1.5
        type: DisplayString
        help: System name

      # ============================================
      # CPU METRICS (UCD-SNMP-MIB)
      # ============================================
      - name: ssCpuRawUser
        oid: 1.3.6.1.4.1.2021.11.50
        type: counter
        help: Raw CPU user time

      - name: ssCpuRawNice
        oid: 1.3.6.1.4.1.2021.11.51
        type: counter
        help: Raw CPU nice time

      - name: ssCpuRawSystem
        oid: 1.3.6.1.4.1.2021.11.52
        type: counter
        help: Raw CPU system time

      - name: ssCpuRawIdle
        oid: 1.3.6.1.4.1.2021.11.53
        type: counter
        help: Raw CPU idle time

      - name: ssCpuRawWait
        oid: 1.3.6.1.4.1.2021.11.54
        type: counter
        help: Raw CPU wait time

      - name: ssCpuRawKernel
        oid: 1.3.6.1.4.1.2021.11.55
        type: counter
        help: Raw CPU kernel time

      - name: ssCpuRawInterrupt
        oid: 1.3.6.1.4.1.2021.11.56
        type: counter
        help: Raw CPU interrupt time

      # ============================================
      # MEMORY METRICS (UCD-SNMP-MIB)
      # ============================================
      - name: memTotalSwap
        oid: 1.3.6.1.4.1.2021.4.3
        type: gauge
        help: Total swap size in KB

      - name: memAvailSwap
        oid: 1.3.6.1.4.1.2021.4.4
        type: gauge
        help: Available swap in KB

      - name: memTotalReal
        oid: 1.3.6.1.4.1.2021.4.5
        type: gauge
        help: Total RAM in KB

      - name: memAvailReal
        oid: 1.3.6.1.4.1.2021.4.6
        type: gauge
        help: Available RAM in KB

      - name: memTotalFree
        oid: 1.3.6.1.4.1.2021.4.11
        type: gauge
        help: Total free memory in KB

      - name: memShared
        oid: 1.3.6.1.4.1.2021.4.13
        type: gauge
        help: Shared memory in KB

      - name: memBuffer
        oid: 1.3.6.1.4.1.2021.4.14
        type: gauge
        help: Buffer memory in KB

      - name: memCached
        oid: 1.3.6.1.4.1.2021.4.15
        type: gauge
        help: Cached memory in KB

      # ============================================
      # LOAD AVERAGE (UCD-SNMP-MIB)
      # ============================================
      - name: laLoad
        oid: 1.3.6.1.4.1.2021.10.1.3
        type: DisplayString
        help: Load average (1, 5, 15 min)
        indexes:
          - labelname: laIndex
            type: gauge
        lookups:
          - labels: [laIndex]
            labelname: laNames
            oid: 1.3.6.1.4.1.2021.10.1.2
            type: DisplayString

      # ============================================
      # HOST RESOURCES - STORAGE
      # ============================================
      - name: hrStorageDescr
        oid: 1.3.6.1.2.1.25.2.3.1.3
        type: DisplayString
        help: Storage description
        indexes:
          - labelname: hrStorageIndex
            type: gauge

      - name: hrStorageAllocationUnits
        oid: 1.3.6.1.2.1.25.2.3.1.4
        type: gauge
        help: Storage allocation unit size in bytes
        indexes:
          - labelname: hrStorageIndex
            type: gauge
        lookups:
          - labels: [hrStorageIndex]
            labelname: hrStorageDescr
            oid: 1.3.6.1.2.1.25.2.3.1.3
            type: DisplayString

      - name: hrStorageSize
        oid: 1.3.6.1.2.1.25.2.3.1.5
        type: gauge
        help: Storage size in allocation units
        indexes:
          - labelname: hrStorageIndex
            type: gauge
        lookups:
          - labels: [hrStorageIndex]
            labelname: hrStorageDescr
            oid: 1.3.6.1.2.1.25.2.3.1.3
            type: DisplayString

      - name: hrStorageUsed
        oid: 1.3.6.1.2.1.25.2.3.1.6
        type: gauge
        help: Storage used in allocation units
        indexes:
          - labelname: hrStorageIndex
            type: gauge
        lookups:
          - labels: [hrStorageIndex]
            labelname: hrStorageDescr
            oid: 1.3.6.1.2.1.25.2.3.1.3
            type: DisplayString

      # ============================================
      # NETWORK INTERFACES
      # ============================================
      - name: ifNumber
        oid: 1.3.6.1.2.1.2.1
        type: gauge
        help: Number of network interfaces

      - name: ifDescr
        oid: 1.3.6.1.2.1.2.2.1.2
        type: DisplayString
        help: Interface description
        indexes:
          - labelname: ifIndex
            type: gauge

      - name: ifOperStatus
        oid: 1.3.6.1.2.1.2.2.1.8
        type: gauge
        help: Interface operational status (1=up, 2=down)
        indexes:
          - labelname: ifIndex
            type: gauge
        lookups:
          - labels: [ifIndex]
            labelname: ifDescr
            oid: 1.3.6.1.2.1.2.2.1.2
            type: DisplayString
        enum_values:
          1: up
          2: down
          3: testing

      - name: ifHCInOctets
        oid: 1.3.6.1.2.1.31.1.1.1.6
        type: counter
        help: Total bytes received (64-bit)
        indexes:
          - labelname: ifIndex
            type: gauge
        lookups:
          - labels: [ifIndex]
            labelname: ifDescr
            oid: 1.3.6.1.2.1.2.2.1.2
            type: DisplayString

      - name: ifHCOutOctets
        oid: 1.3.6.1.2.1.31.1.1.1.10
        type: counter
        help: Total bytes transmitted (64-bit)
        indexes:
          - labelname: ifIndex
            type: gauge
        lookups:
          - labels: [ifIndex]
            labelname: ifDescr
            oid: 1.3.6.1.2.1.2.2.1.2
            type: DisplayString

      # ============================================
      # SYNOLOGY SYSTEM STATUS
      # ============================================
      - name: systemStatus
        oid: 1.3.6.1.4.1.6574.1.1
        type: gauge
        help: System status (1=Normal, 2=Failed)

      - name: temperature
        oid: 1.3.6.1.4.1.6574.1.2
        type: gauge
        help: System temperature in Celsius

      - name: powerStatus
        oid: 1.3.6.1.4.1.6574.1.3
        type: gauge
        help: Power status (1=Normal, 2=Failed)

      - name: systemFanStatus
        oid: 1.3.6.1.4.1.6574.1.4.1
        type: gauge
        help: System fan status (1=Normal, 2=Failed)

      - name: cpuFanStatus
        oid: 1.3.6.1.4.1.6574.1.4.2
        type: gauge
        help: CPU fan status (1=Normal, 2=Failed)

      - name: modelName
        oid: 1.3.6.1.4.1.6574.1.5.1
        type: DisplayString
        help: NAS model name

      - name: serialNumber
        oid: 1.3.6.1.4.1.6574.1.5.2
        type: DisplayString
        help: NAS serial number

      - name: version
        oid: 1.3.6.1.4.1.6574.1.5.3
        type: DisplayString
        help: DSM version

      - name: REDACTED_APP_PASSWORD
        oid: 1.3.6.1.4.1.6574.1.5.4
        type: gauge
        help: DSM upgrade available (1=available, 2=unavailable)

      # ============================================
      # SYNOLOGY DISK INFO
      # ============================================
      - name: diskID
        oid: 1.3.6.1.4.1.6574.2.1.1.2
        type: DisplayString
        help: Disk ID
        indexes:
          - labelname: diskIndex
            type: gauge

      - name: diskModel
        oid: 1.3.6.1.4.1.6574.2.1.1.3
        type: DisplayString
        help: Disk model
        indexes:
          - labelname: diskIndex
            type: gauge
        lookups:
          - labels: [diskIndex]
            labelname: diskID
            oid: 1.3.6.1.4.1.6574.2.1.1.2
            type: DisplayString

      - name: diskType
        oid: 1.3.6.1.4.1.6574.2.1.1.4
        type: DisplayString
        help: Disk type (SATA, SSD, etc.)
        indexes:
          - labelname: diskIndex
            type: gauge
        lookups:
          - labels: [diskIndex]
            labelname: diskID
            oid: 1.3.6.1.4.1.6574.2.1.1.2
            type: DisplayString

      - name: diskStatus
        oid: 1.3.6.1.4.1.6574.2.1.1.5
        type: gauge
        help: Disk status (1=Normal, 2=Initialized, 3=NotInitialized, 4=SystemPartitionFailed, 5=Crashed)
        indexes:
          - labelname: diskIndex
            type: gauge
        lookups:
          - labels: [diskIndex]
            labelname: diskID
            oid: 1.3.6.1.4.1.6574.2.1.1.2
            type: DisplayString

      - name: diskTemperature
        oid: 1.3.6.1.4.1.6574.2.1.1.6
        type: gauge
        help: Disk temperature in Celsius
        indexes:
          - labelname: diskIndex
            type: gauge
        lookups:
          - labels: [diskIndex]
            labelname: diskID
            oid: 1.3.6.1.4.1.6574.2.1.1.2
            type: DisplayString

      # ============================================
      # SYNOLOGY RAID INFO
      # ============================================
      - name: raidName
        oid: 1.3.6.1.4.1.6574.3.1.1.2
        type: DisplayString
        help: RAID/Volume name
        indexes:
          - labelname: raidIndex
            type: gauge

      - name: raidStatus
        oid: 1.3.6.1.4.1.6574.3.1.1.3
        type: gauge
        help: RAID status (1=Normal, 2=Repairing, 3=Migrating, 4=Expanding, 5=Deleting, 6=Creating, 7=RaidSyncing, 8=RaidParityChecking, 9=RaidAssembling, 10=Canceling, 11=Degrade, 12=Crashed, 13=DataScrubbing, 14=RaidDeploying, 15=RaidUnDeploying, 16=RaidMountCache, 17=REDACTED_APP_PASSWORD, 18=RaidExpandingUnfinishedSHR, 19=RaidConvertSHRToPool, 20=RaidMigrateSHR1ToSHR2, 21=RaidUnknownStatus)
        indexes:
          - labelname: raidIndex
            type: gauge
        lookups:
          - labels: [raidIndex]
            labelname: raidName
            oid: 1.3.6.1.4.1.6574.3.1.1.2
            type: DisplayString

      - name: raidFreeSize
        oid: 1.3.6.1.4.1.6574.3.1.1.4
        type: gauge
        help: RAID free size in bytes
        indexes:
          - labelname: raidIndex
            type: gauge
        lookups:
          - labels: [raidIndex]
            labelname: raidName
            oid: 1.3.6.1.4.1.6574.3.1.1.2
            type: DisplayString

      - name: raidTotalSize
        oid: 1.3.6.1.4.1.6574.3.1.1.5
        type: gauge
        help: RAID total size in bytes
        indexes:
          - labelname: raidIndex
            type: gauge
        lookups:
          - labels: [raidIndex]
            labelname: raidName
            oid: 1.3.6.1.4.1.6574.3.1.1.2
            type: DisplayString

      # ============================================
      # SYNOLOGY UPS INFO (if connected)
      # ============================================
      - name: upsModel
        oid: 1.3.6.1.4.1.6574.4.1.1
        type: DisplayString
        help: UPS model name

      - name: upsSN
        oid: 1.3.6.1.4.1.6574.4.1.2
        type: DisplayString
        help: UPS serial number

      - name: upsStatus
        oid: 1.3.6.1.4.1.6574.4.1.3
        type: DisplayString
        help: UPS status

      - name: upsLoad
        oid: 1.3.6.1.4.1.6574.4.2.1
        type: gauge
        help: UPS load percentage

      - name: REDACTED_APP_PASSWORD
        oid: 1.3.6.1.4.1.6574.4.3.1.1
        type: gauge
        help: UPS battery charge percentage

      - name: upsBatteryChargeWarning
        oid: 1.3.6.1.4.1.6574.4.3.1.2
        type: gauge
        help: UPS battery charge warning level

      # ============================================
      # SYNOLOGY SERVICE USERS
      # ============================================
      - name: serviceName
        oid: 1.3.6.1.4.1.6574.6.1.1.2
        type: DisplayString
        help: Service name
        indexes:
          - labelname: REDACTED_APP_PASSWORD
            type: gauge

      - name: serviceUsers
        oid: 1.3.6.1.4.1.6574.6.1.1.3
        type: gauge
        help: Number of users connected to service
        indexes:
          - labelname: REDACTED_APP_PASSWORD
            type: gauge
        lookups:
          - labels: [serviceInfoIndex]
            labelname: serviceName
            oid: 1.3.6.1.4.1.6574.6.1.1.2
            type: DisplayString

      # ============================================
      # SYNOLOGY STORAGE IO
      # ============================================
      - name: storageIODevice
        oid: 1.3.6.1.4.1.6574.101.1.1.2
        type: DisplayString
        help: Storage IO device name
        indexes:
          - labelname: storageIOIndex
            type: gauge

      - name: storageIONReadX
        oid: 1.3.6.1.4.1.6574.101.1.1.12
        type: counter
        help: Total bytes read (64-bit)
        indexes:
          - labelname: storageIOIndex
            type: gauge
        lookups:
          - labels: [storageIOIndex]
            labelname: storageIODevice
            oid: 1.3.6.1.4.1.6574.101.1.1.2
            type: DisplayString

      - name: storageIONWrittenX
        oid: 1.3.6.1.4.1.6574.101.1.1.13
        type: counter
        help: Total bytes written (64-bit)
        indexes:
          - labelname: storageIOIndex
            type: gauge
        lookups:
          - labels: [storageIOIndex]
            labelname: storageIODevice
            oid: 1.3.6.1.4.1.6574.101.1.1.2
            type: DisplayString

      - name: storageIOLA
        oid: 1.3.6.1.4.1.6574.101.1.1.8
        type: gauge
        help: Storage IO load average
        indexes:
          - labelname: storageIOIndex
            type: gauge
        lookups:
          - labels: [storageIOIndex]
            labelname: storageIODevice
            oid: 1.3.6.1.4.1.6574.101.1.1.2
            type: DisplayString

      # ============================================
      # SYNOLOGY SPACE IO (Volume IO)
      # ============================================
      - name: spaceIODevice
        oid: 1.3.6.1.4.1.6574.102.1.1.2
        type: DisplayString
        help: Space/Volume IO device name
        indexes:
          - labelname: spaceIOIndex
            type: gauge

      - name: spaceIONReadX
        oid: 1.3.6.1.4.1.6574.102.1.1.12
        type: counter
        help: Volume bytes read (64-bit)
        indexes:
          - labelname: spaceIOIndex
            type: gauge
        lookups:
          - labels: [spaceIOIndex]
            labelname: spaceIODevice
            oid: 1.3.6.1.4.1.6574.102.1.1.2
            type: DisplayString

      - name: REDACTED_APP_PASSWORD
        oid: 1.3.6.1.4.1.6574.102.1.1.13
        type: counter
        help: Volume bytes written (64-bit)
        indexes:
          - labelname: spaceIOIndex
            type: gauge
        lookups:
          - labels: [spaceIOIndex]
            labelname: spaceIODevice
            oid: 1.3.6.1.4.1.6574.102.1.1.2
            type: DisplayString

      - name: spaceIOLA
        oid: 1.3.6.1.4.1.6574.102.1.1.8
        type: gauge
        help: Volume IO load average
        indexes:
          - labelname: spaceIOIndex
            type: gauge
        lookups:
          - labels: [spaceIOIndex]
            labelname: spaceIODevice
            oid: 1.3.6.1.4.1.6574.102.1.1.2
            type: DisplayString
