# Linux memory SNMP ## Overview For Zabbix version: 6.2 and higher ## Setup Refer to the vendor documentation. ## Zabbix configuration No specific Zabbix configuration is required. ### Macros used |Name|Description|Default| |----|-----------|-------| |{$MEMORY.AVAILABLE.MIN} |

-

|`20M` | |{$MEMORY.UTIL.MAX} |

-

|`90` | |{$SWAP.PFREE.MIN.WARN} |

-

|`50` | ## Template links There are no template links in this template. ## Discovery rules ## Items collected |Group|Name|Description|Type|Key and additional info| |-----|----|-----------|----|---------------------| |Memory |Memory utilization |

Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.

|CALCULATED |vm.memory.util[snmp]

**Expression**:

`(last(//vm.memory.total[memTotalReal.0])-(last(//vm.memory.free[memAvailReal.0])+last(//vm.memory.buffers[memBuffer.0])+last(//vm.memory.cached[memCached.0])))/last(//vm.memory.total[memTotalReal.0])*100` | |Memory |Free memory |

MIB: UCD-SNMP-MIB

|SNMP |vm.memory.free[memAvailReal.0]

**Preprocessing**:

- MULTIPLIER: `1024`

| |Memory |Memory (buffers) |

MIB: UCD-SNMP-MIB

Memory used by kernel buffers (Buffers in /proc/meminfo)

|SNMP |vm.memory.buffers[memBuffer.0]

**Preprocessing**:

- MULTIPLIER: `1024`

| |Memory |Memory (cached) |

MIB: UCD-SNMP-MIB

Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)

|SNMP |vm.memory.cached[memCached.0]

**Preprocessing**:

- MULTIPLIER: `1024`

| |Memory |Total memory |

MIB: UCD-SNMP-MIB

Total memory in Bytes

|SNMP |vm.memory.total[memTotalReal.0]

**Preprocessing**:

- MULTIPLIER: `1024`

| |Memory |Available memory |

Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.

|CALCULATED |vm.memory.available[snmp]

**Expression**:

`last(//vm.memory.free[memAvailReal.0])+last(//vm.memory.buffers[memBuffer.0])+last(//vm.memory.cached[memCached.0])` | |Memory |Total swap space |

MIB: UCD-SNMP-MIB

The total amount of swap space configured for this host.

|SNMP |system.swap.total[memTotalSwap.0]

**Preprocessing**:

- MULTIPLIER: `1024`

| |Memory |Free swap space |

MIB: UCD-SNMP-MIB

The amount of swap space currently unused or available.

|SNMP |system.swap.free[memAvailSwap.0]

**Preprocessing**:

- MULTIPLIER: `1024`

| |Memory |Free swap space in % |

The free space of swap volume/file in percent.

|CALCULATED |system.swap.pfree[snmp]

**Expression**:

`last(//system.swap.free[memAvailSwap.0])/last(//system.swap.total[memTotalSwap.0])*100` | ## Triggers |Name|Description|Expression|Severity|Dependencies and additional info| |----|-----------|----|----|----| |High memory utilization (>{$MEMORY.UTIL.MAX}% for 5m) |

The system is running out of free memory.

|`min(/Linux memory SNMP/vm.memory.util[snmp],5m)>{$MEMORY.UTIL.MAX}` |AVERAGE |

**Depends on**:

- Lack of available memory (<{$MEMORY.AVAILABLE.MIN} of {ITEM.VALUE2})

| |Lack of available memory (<{$MEMORY.AVAILABLE.MIN} of {ITEM.VALUE2}) |

-

|`max(/Linux memory SNMP/vm.memory.available[snmp],5m)<{$MEMORY.AVAILABLE.MIN} and last(/Linux memory SNMP/vm.memory.total[memTotalReal.0])>0` |AVERAGE | | |High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free) |

This trigger is ignored, if there is no swap configured

|`max(/Linux memory SNMP/system.swap.pfree[snmp],5m)<{$SWAP.PFREE.MIN.WARN} and last(/Linux memory SNMP/system.swap.total[memTotalSwap.0])>0` |WARNING |

**Depends on**:

- High memory utilization (>{$MEMORY.UTIL.MAX}% for 5m)

- Lack of available memory (<{$MEMORY.AVAILABLE.MIN} of {ITEM.VALUE2})

| ## Feedback Please report any issues with the template at https://support.zabbix.com ## Known Issues - Description: Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP. # Linux block devices SNMP ## Overview For Zabbix version: 6.2 and higher ## Setup Refer to the vendor documentation. ## Zabbix configuration No specific Zabbix configuration is required. ### Macros used |Name|Description|Default| |----|-----------|-------| |{$VFS.DEV.DEVNAME.MATCHES} |

This macro is used in block devices discovery. Can be overridden on the host or linked template level

|`.+` | |{$VFS.DEV.DEVNAME.NOT_MATCHES} |

This macro is used in block devices discovery. Can be overridden on the host or linked template level

|`^(loop[0-9]*|sd[a-z][0-9]+|nbd[0-9]+|sr[0-9]+|fd[0-9]+|dm-[0-9]+|ram[0-9]+|ploop[a-z0-9]+|md[0-9]*|hcp[0-9]*|zram[0-9]*)` | ## Template links There are no template links in this template. ## Discovery rules |Name|Description|Type|Key and additional info| |----|-----------|----|----| |Block devices discovery |

Block devices are discovered from UCD-DISKIO-MIB::diskIOTable (http://net-snmp.sourceforge.net/docs/mibs/ucdDiskIOMIB.html#diskIOTable)

|SNMP |vfs.dev.discovery[snmp]

**Filter**:

AND

- {#DEVNAME} MATCHES_REGEX `{$VFS.DEV.DEVNAME.MATCHES}`

- {#DEVNAME} NOT_MATCHES_REGEX `{$VFS.DEV.DEVNAME.NOT_MATCHES}`

| ## Items collected |Group|Name|Description|Type|Key and additional info| |-----|----|-----------|----|---------------------| |Storage |{#DEVNAME}: Disk read rate |

MIB: UCD-DISKIO-MIB

The number of read accesses from this device since boot.

|SNMP |vfs.dev.read.rate[diskIOReads.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

| |Storage |{#DEVNAME}: Disk write rate |

MIB: UCD-DISKIO-MIB

The number of write accesses from this device since boot.

|SNMP |vfs.dev.write.rate[diskIOWrites.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

| |Storage |{#DEVNAME}: Disk utilization |

MIB: UCD-DISKIO-MIB

The 1 minute average load of disk (%)

|SNMP |vfs.dev.util[diskIOLA1.{#SNMPINDEX}] | ## Triggers |Name|Description|Expression|Severity|Dependencies and additional info| |----|-----------|----|----|----| ## Feedback Please report any issues with the template at https://support.zabbix.com # Linux CPU SNMP ## Overview For Zabbix version: 6.2 and higher ## Setup Refer to the vendor documentation. ## Zabbix configuration No specific Zabbix configuration is required. ### Macros used |Name|Description|Default| |----|-----------|-------| |{$CPU.UTIL.CRIT} |

-

|`90` | |{$LOAD_AVG_PER_CPU.MAX.WARN} |

Load per CPU considered sustainable. Tune if needed.

|`1.5` | ## Template links There are no template links in this template. ## Discovery rules |Name|Description|Type|Key and additional info| |----|-----------|----|----| |CPU discovery |

This discovery will create set of per core CPU metrics from UCD-SNMP-MIB, using {#CPU.COUNT} in preprocessing. That's the only reason why LLD is used.

|DEPENDENT |cpu.discovery[snmp]

**Preprocessing**:

- JAVASCRIPT: `The text is too long. Please see the template.`

| ## Items collected |Group|Name|Description|Type|Key and additional info| |-----|----|-----------|----|---------------------| |CPU |Load average (1m avg) |

MIB: UCD-SNMP-MIB

|SNMP |system.cpu.load.avg1[laLoad.1] | |CPU |Load average (5m avg) |

MIB: UCD-SNMP-MIB

|SNMP |system.cpu.load.avg5[laLoad.2] | |CPU |Load average (15m avg) |

MIB: UCD-SNMP-MIB

|SNMP |system.cpu.load.avg15[laLoad.3] | |CPU |Number of CPUs |

MIB: HOST-RESOURCES-MIB

Count the number of CPU cores by counting number of cores discovered in hrProcessorTable using LLD

|SNMP |system.cpu.num[snmp]

**Preprocessing**:

- JAVASCRIPT: `//count the number of cores return JSON.parse(value).length; `

| |CPU |Interrupts per second |

-

|SNMP |system.cpu.intr[ssRawInterrupts.0]

**Preprocessing**:

- CHANGE_PER_SECOND

| |CPU |Context switches per second |

-

|SNMP |system.cpu.switches[ssRawContexts.0]

**Preprocessing**:

- CHANGE_PER_SECOND

| |CPU |CPU idle time |

MIB: UCD-SNMP-MIB

The time the CPU has spent doing nothing.

|SNMP |system.cpu.idle[ssCpuRawIdle.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `

| |CPU |CPU system time |

MIB: UCD-SNMP-MIB

The time the CPU has spent running the kernel and its processes.

|SNMP |system.cpu.system[ssCpuRawSystem.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `

| |CPU |CPU user time |

MIB: UCD-SNMP-MIB

The time the CPU has spent running users' processes that are not niced.

|SNMP |system.cpu.user[ssCpuRawUser.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `

| |CPU |CPU steal time |

MIB: UCD-SNMP-MIB

The amount of CPU 'stolen' from this virtual machine by the hypervisor for other tasks (such as running another virtual machine).

|SNMP |system.cpu.steal[ssCpuRawSteal.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `

| |CPU |CPU softirq time |

MIB: UCD-SNMP-MIB

The amount of time the CPU has been servicing software interrupts.

|SNMP |system.cpu.softirq[ssCpuRawSoftIRQ.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `

| |CPU |CPU nice time |

MIB: UCD-SNMP-MIB

The time the CPU has spent running users' processes that have been niced.

|SNMP |system.cpu.nice[ssCpuRawNice.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `

| |CPU |CPU iowait time |

MIB: UCD-SNMP-MIB

Amount of time the CPU has been waiting for I/O to complete.

|SNMP |system.cpu.iowait[ssCpuRawWait.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `

| |CPU |CPU interrupt time |

MIB: UCD-SNMP-MIB

The amount of time the CPU has been servicing hardware interrupts.

|SNMP |system.cpu.interrupt[ssCpuRawInterrupt.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `

| |CPU |CPU guest time |

MIB: UCD-SNMP-MIB

Guest time (time spent running a virtual CPU for a guest operating system)

|SNMP |system.cpu.guest[ssCpuRawGuest.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `

| |CPU |CPU guest nice time |

MIB: UCD-SNMP-MIB

Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)

|SNMP |system.cpu.guest_nice[ssCpuRawGuestNice.{#SNMPINDEX}]

**Preprocessing**:

- CHANGE_PER_SECOND

- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `

| |CPU |CPU utilization |

CPU utilization in %

|DEPENDENT |system.cpu.util[snmp,{#SNMPINDEX}]

**Preprocessing**:

- JAVASCRIPT: `//Calculate utilization return (100 - value) `

| ## Triggers |Name|Description|Expression|Severity|Dependencies and additional info| |----|-----------|----|----|----| |Load average is too high (per CPU load over {$LOAD_AVG_PER_CPU.MAX.WARN} for 5m) |

Per CPU load average is too high. Your system may be slow to respond.

|`min(/Linux CPU SNMP/system.cpu.load.avg1[laLoad.1],5m)/last(/Linux CPU SNMP/system.cpu.num[snmp])>{$LOAD_AVG_PER_CPU.MAX.WARN} and last(/Linux CPU SNMP/system.cpu.load.avg5[laLoad.2])>0 and last(/Linux CPU SNMP/system.cpu.load.avg15[laLoad.3])>0` |AVERAGE | | |High CPU utilization (over {$CPU.UTIL.CRIT}% for 5m) |

CPU utilization is too high. The system might be slow to respond.

|`min(/Linux CPU SNMP/system.cpu.util[snmp,{#SNMPINDEX}],5m)>{$CPU.UTIL.CRIT}` |WARNING | | ## Feedback Please report any issues with the template at https://support.zabbix.com # Linux filesystems SNMP ## Overview For Zabbix version: 6.2 and higher ## Setup Refer to the vendor documentation. ## Zabbix configuration No specific Zabbix configuration is required. ### Macros used |Name|Description|Default| |----|-----------|-------| |{$VFS.FS.FSNAME.MATCHES} |

This macro is used in filesystems discovery. Can be overridden on the host or linked template level

|`.+` | |{$VFS.FS.FSNAME.NOT_MATCHES} |

This macro is used in filesystems discovery. Can be overridden on the host or linked template level

|`^(/dev|/sys|/run|/proc|.+/shm$)` | |{$VFS.FS.FSTYPE.MATCHES} |

This macro is used in filesystems discovery. Can be overridden on the host or linked template level

|`.*(\.4|\.9|hrStorageFixedDisk|hrStorageFlashMemory)$` | |{$VFS.FS.FSTYPE.NOT_MATCHES} |

This macro is used in filesystems discovery. Can be overridden on the host or linked template level

|`^\s$` | |{$VFS.FS.INODE.PFREE.MIN.CRIT} |

-

|`10` | |{$VFS.FS.INODE.PFREE.MIN.WARN} |

-

|`20` | |{$VFS.FS.PUSED.MAX.CRIT} |

-

|`90` | |{$VFS.FS.PUSED.MAX.WARN} |

-

|`80` | ## Template links There are no template links in this template. ## Discovery rules |Name|Description|Type|Key and additional info| |----|-----------|----|----| |Mounted filesystem discovery |

HOST-RESOURCES-MIB::hrStorage discovery with storage filter

|SNMP |vfs.fs.discovery[snmp]

**Filter**:

AND

- {#FSTYPE} MATCHES_REGEX `{$VFS.FS.FSTYPE.MATCHES}`

- {#FSTYPE} NOT_MATCHES_REGEX `{$VFS.FS.FSTYPE.NOT_MATCHES}`

- {#FSNAME} MATCHES_REGEX `{$VFS.FS.FSNAME.MATCHES}`

- {#FSNAME} NOT_MATCHES_REGEX `{$VFS.FS.FSNAME.NOT_MATCHES}`

| ## Items collected |Group|Name|Description|Type|Key and additional info| |-----|----|-----------|----|---------------------| |Storage |{#FSNAME}: Used space |

MIB: HOST-RESOURCES-MIB

The amount of the storage represented by this entry that is allocated, in units of hrStorageAllocationUnits.

|SNMP |vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]

**Preprocessing**:

- MULTIPLIER: `{#ALLOC_UNITS}`

| |Storage |{#FSNAME}: Total space |

MIB: HOST-RESOURCES-MIB

The size of the storage represented by this entry, in units of hrStorageAllocationUnits.

This object is writable to allow remote configuration of the size of the storage area in those cases where such an operation makes sense and is possible on the underlying system.

For example, the amount of main storage allocated to a buffer pool might be modified or the amount of disk space allocated to virtual storage might be modified.

|SNMP |vfs.fs.total[hrStorageSize.{#SNMPINDEX}]

**Preprocessing**:

- MULTIPLIER: `{#ALLOC_UNITS}`

| |Storage |{#FSNAME}: Space utilization |

Space utilization in % for {#FSNAME}

|CALCULATED |vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}]

**Expression**:

`(last(//vfs.fs.used[hrStorageUsed.{#SNMPINDEX}])/last(//vfs.fs.total[hrStorageSize.{#SNMPINDEX}]))*100` | |Storage |{#FSNAME}: Free inodes in % |

MIB: UCD-SNMP-MIB

If having problems collecting this item make sure access to UCD-SNMP-MIB is allowed.

|SNMP |vfs.fs.inode.pfree[dskPercentNode.{#SNMPINDEX}]

**Preprocessing**:

- JAVASCRIPT: `return (100-value);`

| ## Triggers |Name|Description|Expression|Severity|Dependencies and additional info| |----|-----------|----|----|----| |{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%) |

Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.

Second condition should be one of the following:

- The disk free space is less than 5G.

- The disk will be full in less than 24 hours.

|`last(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and ((last(/Linux filesystems SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux filesystems SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d) ` |AVERAGE |

Manual close: YES

| |{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%) |

Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.

Second condition should be one of the following:

- The disk free space is less than 10G.

- The disk will be full in less than 24 hours.

|`last(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and ((last(/Linux filesystems SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux filesystems SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<10G or timeleft(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d) ` |WARNING |

Manual close: YES

**Depends on**:

- {#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)

| |{#FSNAME}: Running out of free inodes (free < {$VFS.FS.INODE.PFREE.MIN.CRIT:"{#FSNAME}"}%) |

It may become impossible to write to disk if there are no index nodes left.

As symptoms, 'No space left on device' or 'Disk is full' errors may be seen even though free space is available.

|`min(/Linux filesystems SNMP/vfs.fs.inode.pfree[dskPercentNode.{#SNMPINDEX}],5m)<{$VFS.FS.INODE.PFREE.MIN.CRIT:"{#FSNAME}"}` |AVERAGE | | |{#FSNAME}: Running out of free inodes (free < {$VFS.FS.INODE.PFREE.MIN.WARN:"{#FSNAME}"}%) |

It may become impossible to write to disk if there are no index nodes left.

As symptoms, 'No space left on device' or 'Disk is full' errors may be seen even though free space is available.

|`min(/Linux filesystems SNMP/vfs.fs.inode.pfree[dskPercentNode.{#SNMPINDEX}],5m)<{$VFS.FS.INODE.PFREE.MIN.WARN:"{#FSNAME}"}` |WARNING |

**Depends on**:

- {#FSNAME}: Running out of free inodes (free < {$VFS.FS.INODE.PFREE.MIN.CRIT:"{#FSNAME}"}%)

| ## Feedback Please report any issues with the template at https://support.zabbix.com