extends:
  - _dell.yaml
  - _std-if-mib.yaml

selector:
  - sysobjectid:
      include:
        - 1.3.6.1.4.1.8741.1  # SonicWALL TZ 400

metadata:
  device:
    fields:
      type:
        value: "Firewall"
      serial_number:
        symbol:
          MIB: SONICWALL-COMMON-MIB
          OID: 1.3.6.1.4.1.8741.2.1.1.2.0
          name: snwlSysSerialNumber
      version:
        symbol:
          MIB: SONICWALL-COMMON-MIB
          OID: 1.3.6.1.4.1.8741.2.1.1.3.0
          name: snwlSysFirmwareVersion
      model:
        symbol:
          MIB: SONICWALL-COMMON-MIB
          OID: 1.3.6.1.4.1.8741.2.1.1.1.0
          name: snwlSysModel

# -  SONICWALL-FIREWALL-IP-STATISTICS-MIB
#   https://mibbrowser.online/mibdb_search.php?mib=SONICWALL-FIREWALL-IP-STATISTICS-MIB
#   https://github.com/librenms/librenms/blob/master/mibs/sonicwall/SONICWALL-FIREWALL-IP-STATISTICS-MIB

metrics:
  - MIB: SONICWALL-FIREWALL-IP-STATISTICS-MIB
    symbol:
      name: cpu.usage #  sonicCurrentCPUUtil
      OID: 1.3.6.1.4.1.8741.1.3.1.3.0
      chart_meta:
        family: 'System/CPU/Usage'
        description: The current CPU utilization
        unit: "%"
  - MIB: SONICWALL-FIREWALL-IP-STATISTICS-MIB
    symbol:
      name: memory.usage
      OID: 1.3.6.1.4.1.8741.1.3.1.4.0
      chart_meta:
        family: 'System/Memory/Usage'
        description: Instantaneous RAM Utilization in percent
        unit: "%"
  - MIB: SONICWALL-FIREWALL-IP-STATISTICS-MIB
    symbol:
      name: sonicMaxConnCacheEntries
      OID: 1.3.6.1.4.1.8741.1.3.1.1.0
      chart_meta:
        family: 'Security/Firewall/Connection/Cache/Maximum'
        description: Maximum number of connection cache entries allowed through the firewall
        unit: "{entry}"
  - MIB: SONICWALL-FIREWALL-IP-STATISTICS-MIB
    symbol:
      name: sonicCurrentConnCacheEntries
      OID: 1.3.6.1.4.1.8741.1.3.1.2.0
      chart_meta:
        family: 'Security/Firewall/Connection/Cache/Active'
        description: Number of active connection cache entries through the firewall
        unit: "{entry}"
  - MIB: SONICWALL-FIREWALL-IP-STATISTICS-MIB
    symbol:
      name: sonicNatTranslationCount
      OID: 1.3.6.1.4.1.8741.1.3.1.5.0
      chart_meta:
        family: 'Network/NAT/Translation/Active'
        description: Current number of dynamic NAT translations being performed
        unit: "{translation}"

  - MIB: SONICWALL-FIREWALL-IP-STATISTICS-MIB
    symbol:
      name: sonicDpiSslConnCountCur
      OID: 1.3.6.1.4.1.8741.1.3.5.1.0
      chart_meta:
        family: 'Security/DPI/SSL/Connection/Current'
        description: Current SSL-inspected connections through the firewall
        unit: "{connection}"
  - MIB: SONICWALL-FIREWALL-IP-STATISTICS-MIB
    symbol:
      name: sonicDpiSslConnCountHighWater
      OID: 1.3.6.1.4.1.8741.1.3.5.2.0
      chart_meta:
        family: 'Security/DPI/SSL/Connection/HighWater'
        description: Highwater SSL-inspected connections through the firewall
        unit: "{connection}"
  - MIB: SONICWALL-FIREWALL-IP-STATISTICS-MIB
    symbol:
      name: sonicDpiSslConnCountMax
      OID: 1.3.6.1.4.1.8741.1.3.5.3.0
      chart_meta:
        family: 'Security/DPI/SSL/Connection/Maximum'
        description: Maximum SSL-inspected connections through the firewall
        unit: "{connection}"

  - MIB: SONICWALL-FIREWALL-IP-STATISTICS-MIB
    table:
      name: sonicSAStatTable
      OID: 1.3.6.1.4.1.8741.1.3.2.1.1
    symbols:
      - name: sonicSAStatEncryptPktCount
        OID: 1.3.6.1.4.1.8741.1.3.2.1.1.1.8
        chart_meta:
          family: 'Network/VPN/IPSec/SA/Packet/Encrypted'
          description: Total encrypted packet count for this phase2 SA
          unit: "{packet}/s"
      - name: sonicSAStatEncryptByteCount
        OID: 1.3.6.1.4.1.8741.1.3.2.1.1.1.9
        chart_meta:
          family: 'Network/VPN/IPSec/SA/Data/Encrypted'
          description: Total encrypted byte count for this phase2 SA
          unit: "By/s"
      - name: sonicSAStatDecryptPktCount
        OID: 1.3.6.1.4.1.8741.1.3.2.1.1.1.10
        chart_meta:
          family: 'Network/VPN/IPSec/SA/Packet/Decrypted'
          description: Total decrypted packet count for this phase2 SA
          unit: "{packet}/s"
      - name: sonicSAStatDecryptByteCount
        OID: 1.3.6.1.4.1.8741.1.3.2.1.1.1.11
        chart_meta:
          family: 'Network/VPN/IPSec/SA/Data/Decrypted'
          description: Total decrypted byte count for this phase2 SA
          unit: "By/s"
      - name: sonicSAStatInFragPktCount
        OID: 1.3.6.1.4.1.8741.1.3.2.1.1.1.12
        chart_meta:
          family: 'Network/VPN/IPSec/SA/Packet/Fragment/In'
          description: Incoming Fragmented packet count for this phase2 SA
          unit: "{packet}/s"
      - name: sonicSAStatOutFragPktCount
        OID: 1.3.6.1.4.1.8741.1.3.2.1.1.1.13
        chart_meta:
          family: 'Network/IPSec/SA/Packet/Fragment/Out'
          description: Outgoing Fragmented packet count for this phase2 SA
          unit: "{packet}/s"
    metric_tags:
      - tag: sonic_sa_stat_user_name
        symbol:
          name: sonicSAStatUserName
          OID: 1.3.6.1.4.1.8741.1.3.2.1.1.1.14
