Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/os/linux?at=release/7.0
Linux by Zabbix agent
Overview
This is an official Linux template. It requires Zabbix agent 7.0 or newer.
Notes on filesystem (FS) discovery:
- The ext4/3/2 FS reserves space for privileged usage, typically set at 5% by default.
- BTRFS allocates a default of 10% of the volume for its own needs.
- To mitigate potential disasters, FS usage triggers are based on the maximum available space.
- Utilization formula:
pused = 100 - 100 * (available / total - free + available)
- Utilization formula:
- The FS utilization chart, derived from graph prototypes, reflects FS reserved space as the difference between used and available space from the total volume.
Requirements
Zabbix version: 7.0 and higher.
Tested versions
This template has been tested on:
- Linux OS
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
Install Zabbix agent on Linux OS following Zabbix documentation.
Macros used
Name | Description | Default |
---|---|---|
{$AGENT.TIMEOUT} | Timeout after which agent is considered unavailable. Works only for agents reachable from Zabbix server/proxy (passive mode). |
3m |
{$CPU.UTIL.CRIT} | Critical threshold of CPU utilization expressed in %. |
90 |
{$LOAD_AVG_PER_CPU.MAX.WARN} | The CPU load per core is considered sustainable. If necessary, it can be tuned. |
1.5 |
{$VFS.FS.FSNAME.NOT_MATCHES} | Used for filesystem discovery. Can be overridden on the host or linked template level. |
^(/dev|/sys|/run|/proc|.+/shm$) |
{$VFS.FS.FSNAME.MATCHES} | Used for filesystem discovery. Can be overridden on the host or linked template level. |
.+ |
{$VFS.FS.FSTYPE.MATCHES} | Used for filesystem discovery. Can be overridden on the host or linked template level. |
Macro too long. Please see the template. |
{$VFS.FS.FSTYPE.NOT_MATCHES} | Used for filesystem discovery. Can be overridden on the host or linked template level. |
^\s$ |
{$VFS.FS.INODE.PFREE.MIN.CRIT} | The critical threshold of the filesystem metadata utilization. |
10 |
{$VFS.FS.INODE.PFREE.MIN.WARN} | The warning threshold of the filesystem metadata utilization. |
20 |
{$VFS.FS.PUSED.MAX.CRIT} | The critical threshold of the filesystem utilization. |
90 |
{$VFS.FS.PUSED.MAX.WARN} | The warning threshold of the filesystem utilization. |
80 |
{$MEMORY.UTIL.MAX} | Used as a threshold in the memory utilization trigger. |
90 |
{$MEMORY.AVAILABLE.MIN} | Used as a threshold in the available memory trigger. |
20M |
{$SWAP.PFREE.MIN.WARN} | The warning threshold of the minimum free swap. |
50 |
{$VFS.DEV.READ.AWAIT.WARN} | The average response time (in ms) of disk read before the trigger fires. |
20 |
{$VFS.DEV.WRITE.AWAIT.WARN} | The average response time (in ms) of disk write before the trigger fires. |
20 |
{$VFS.DEV.DEVNAME.NOT_MATCHES} | Used for block device discovery. Can be overridden on the host or linked template level. |
Macro too long. Please see the template. |
{$VFS.DEV.DEVNAME.MATCHES} | Used for block device discovery. Can be overridden on the host or linked template level. |
.+ |
{$IF.ERRORS.WARN} | Warning threshold of error packet rate. Can be used with interface name as context. |
2 |
{$IFCONTROL} | Link status trigger will be fired only for interfaces where the context macro equals "1". |
1 |
{$NET.IF.IFNAME.MATCHES} | Used for network interface discovery. Can be overridden on the host or linked template level. |
^.*$ |
{$NET.IF.IFNAME.NOT_MATCHES} | Filters out |
Macro too long. Please see the template. |
{$IF.UTIL.MAX} | Used as a threshold in the interface utilization trigger. |
90 |
{$SYSTEM.FUZZYTIME.MAX} | The upper threshold for difference of system time. |
60s |
{$SYSTEM.FUZZYTIME.MIN} | The lower threshold for difference of system time. Used in recovery expression to avoid trigger flapping. |
10s |
{$KERNEL.MAXPROC.MIN} | 1024 |
|
{$KERNEL.MAXFILES.MIN} | 256 |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
Version of Zabbix agent running | Zabbix agent | agent.version Preprocessing
|
|
Host name of Zabbix agent running | Zabbix agent | agent.hostname Preprocessing
|
|
Zabbix agent ping | The agent always returns "1" for this item. May be used in combination with |
Zabbix agent | agent.ping |
Zabbix agent availability | Used for monitoring the availability status of the agent. |
Zabbix internal | zabbix[host,agent,available] |
Number of CPUs | Zabbix agent | system.cpu.num Preprocessing
|
|
Load average (1m avg) | Calculated as the system CPU load divided by the number of CPU cores. |
Zabbix agent | system.cpu.load[all,avg1] |
Load average (5m avg) | Calculated as the system CPU load divided by the number of CPU cores. |
Zabbix agent | system.cpu.load[all,avg5] |
Load average (15m avg) | Calculated as the system CPU load divided by the number of CPU cores. |
Zabbix agent | system.cpu.load[all,avg15] |
CPU utilization | CPU utilization expressed in %. |
Dependent item | system.cpu.util Preprocessing
|
CPU idle time | Time the CPU has spent doing nothing. |
Zabbix agent | system.cpu.util[,idle] |
CPU system time | Time the CPU has spent running the kernel and its processes. |
Zabbix agent | system.cpu.util[,system] |
CPU user time | Time the CPU has spent running users' processes that are not niced. |
Zabbix agent | system.cpu.util[,user] |
CPU nice time | Time the CPU has spent running users' processes that have been niced. |
Zabbix agent | system.cpu.util[,nice] |
CPU iowait time | Time the CPU has been waiting for I/O to complete. |
Zabbix agent | system.cpu.util[,iowait] |
CPU steal time | The amount of "stolen" CPU from this virtual machine by the hypervisor for other tasks, such as running another virtual machine. |
Zabbix agent | system.cpu.util[,steal] |
CPU interrupt time | Time the CPU has spent servicing hardware interrupts. |
Zabbix agent | system.cpu.util[,interrupt] |
CPU softirq time | Time the CPU has been servicing software interrupts. |
Zabbix agent | system.cpu.util[,softirq] |
CPU guest time | Time spent on running a virtual CPU for a guest operating system. |
Zabbix agent | system.cpu.util[,guest] |
CPU guest nice time | Time spent on running a niced guest (a virtual CPU for guest operating systems under the control of the Linux kernel). |
Zabbix agent | system.cpu.util[,guest_nice] |
Context switches per second | The combined rate at which all processors on the computer are switched from one thread to another. |
Zabbix agent | system.cpu.switches Preprocessing
|
Interrupts per second | Number of interrupts processed. |
Zabbix agent | system.cpu.intr Preprocessing
|
Get filesystems | The |
Zabbix agent | vfs.fs.get |
Memory utilization | The percentage of used memory is calculated as |
Dependent item | vm.memory.utilization Preprocessing
|
Available memory in % | The available memory as percentage of the total. See also Appendixes in Zabbix Documentation about parameters of the |
Zabbix agent | vm.memory.size[pavailable] |
Total memory | Total memory expressed in bytes. |
Zabbix agent | vm.memory.size[total] |
Available memory | The available memory: - in Linux = free + buffers + cache; - on other platforms calculation may vary. See also Appendixes in Zabbix Documentation about parameters of the |
Zabbix agent | vm.memory.size[available] |
Total swap space | The total space of the swap volume/file expressed in bytes. |
Zabbix agent | system.swap.size[,total] |
Free swap space | The free space of the swap volume/file expressed in bytes. |
Zabbix agent | system.swap.size[,free] |
Free swap space in % | The free space of the swap volume/file expressed in %. |
Zabbix agent | system.swap.size[,pfree] |
System uptime | The system uptime expressed in the following format: "N days, hh:mm:ss". |
Zabbix agent | system.uptime |
System boot time | Zabbix agent | system.boottime Preprocessing
|
|
System local time | The local system time of the host. |
Zabbix agent | system.localtime |
System name | The host name of the system. |
Zabbix agent | system.hostname Preprocessing
|
System description | The information as normally returned by |
Zabbix agent | system.uname Preprocessing
|
Number of logged in users | The number of users who are currently logged in. |
Zabbix agent | system.users.num |
Maximum number of open file descriptors | May be increased by using the |
Zabbix agent | kernel.maxfiles Preprocessing
|
Maximum number of processes | May be increased by using the |
Zabbix agent | kernel.maxproc Preprocessing
|
Number of processes | Zabbix agent | proc.num | |
Number of running processes | Zabbix agent | proc.num[,,run] | |
Checksum of /etc/passwd | Zabbix agent | vfs.file.cksum[/etc/passwd,sha256] Preprocessing
|
|
Operating system | Zabbix agent | system.sw.os Preprocessing
|
|
Operating system architecture | The architecture of the operating system. |
Zabbix agent | system.sw.arch Preprocessing
|
Number of installed packages | Zabbix agent | system.sw.packages.get Preprocessing
|
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Zabbix agent is not available | For passive agents only, host availability is used with |
max(/Linux by Zabbix agent/zabbix[host,agent,available],{$AGENT.TIMEOUT})=0 |
Average | Manual close: Yes |
Load average is too high | The load average per CPU is too high. The system may be slow to respond. |
min(/Linux by Zabbix agent/system.cpu.load[all,avg1],5m)/last(/Linux by Zabbix agent/system.cpu.num)>{$LOAD_AVG_PER_CPU.MAX.WARN} and last(/Linux by Zabbix agent/system.cpu.load[all,avg5])>0 and last(/Linux by Zabbix agent/system.cpu.load[all,avg15])>0 |
Average | |
High CPU utilization | CPU utilization is too high. The system might be slow to respond. |
min(/Linux by Zabbix agent/system.cpu.util,5m)>{$CPU.UTIL.CRIT} |
Warning | Depends on:
|
High memory utilization | The system is running out of free memory. |
min(/Linux by Zabbix agent/vm.memory.utilization,5m)>{$MEMORY.UTIL.MAX} |
Average | Depends on:
|
Lack of available memory | The system is running out of memory. |
max(/Linux by Zabbix agent/vm.memory.size[available],5m)<{$MEMORY.AVAILABLE.MIN} and last(/Linux by Zabbix agent/vm.memory.size[total])>0 |
Average | |
High swap space usage | If there is no swap configured, this trigger is ignored. |
max(/Linux by Zabbix agent/system.swap.size[,pfree],5m)<{$SWAP.PFREE.MIN.WARN} and last(/Linux by Zabbix agent/system.swap.size[,total])>0 |
Warning | Depends on:
|
{HOST.NAME} has been restarted | The host uptime is less than 10 minutes. |
last(/Linux by Zabbix agent/system.uptime)<10m |
Warning | Manual close: Yes |
System time is out of sync | The host's system time is different from Zabbix server time. |
fuzzytime(/Linux by Zabbix agent/system.localtime,{$SYSTEM.FUZZYTIME.MAX})=0 |
Warning | Manual close: Yes |
System name has changed | The name of the system has changed. Acknowledge to close the problem manually. |
change(/Linux by Zabbix agent/system.hostname) and length(last(/Linux by Zabbix agent/system.hostname))>0 |
Info | Manual close: Yes |
Configured max number of open filedescriptors is too low | last(/Linux by Zabbix agent/kernel.maxfiles)<{$KERNEL.MAXFILES.MIN} |
Info | ||
Configured max number of processes is too low | last(/Linux by Zabbix agent/kernel.maxproc)<{$KERNEL.MAXPROC.MIN} |
Info | Depends on:
|
|
Getting closer to process limit | last(/Linux by Zabbix agent/proc.num)/last(/Linux by Zabbix agent/kernel.maxproc)*100>80 |
Warning | ||
/etc/passwd has been changed | last(/Linux by Zabbix agent/vfs.file.cksum[/etc/passwd,sha256],#1)<>last(/Linux by Zabbix agent/vfs.file.cksum[/etc/passwd,sha256],#2) |
Info | Manual close: Yes Depends on:
|
|
Operating system description has changed | The description of the operating system has changed. Possible reasons are that the system has been updated or replaced. Acknowledge to close the problem manually. |
change(/Linux by Zabbix agent/system.sw.os) and length(last(/Linux by Zabbix agent/system.sw.os))>0 |
Info | Manual close: Yes Depends on:
|
Number of installed packages has been changed | change(/Linux by Zabbix agent/system.sw.packages.get)<>0 |
Warning | Manual close: Yes |
LLD rule Mounted filesystem discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Mounted filesystem discovery | The discovery of mounted filesystems with different types. |
Dependent item | vfs.fs.dependent.discovery Preprocessing
|
Item prototypes for Mounted filesystem discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
FS [{#FSNAME}]: Get data | Intermediate data of |
Dependent item | vfs.fs.dependent[{#FSNAME},data] Preprocessing
|
FS [{#FSNAME}]: Option: Read-only | The filesystem is mounted as read-only. It is available only for Zabbix agents 6.4 and higher. |
Dependent item | vfs.fs.dependent[{#FSNAME},readonly] Preprocessing
|
FS [{#FSNAME}]: Space: Used | Used storage expressed in bytes. |
Dependent item | vfs.fs.dependent.size[{#FSNAME},used] Preprocessing
|
FS [{#FSNAME}]: Space: Total | Total space expressed in bytes. |
Dependent item | vfs.fs.dependent.size[{#FSNAME},total] Preprocessing
|
FS [{#FSNAME}]: Space: Used, in % | Calculated as the percentage of currently used space compared to the maximum available space. |
Dependent item | vfs.fs.dependent.size[{#FSNAME},pused] Preprocessing
|
FS [{#FSNAME}]: Space: Available | Available storage space expressed in bytes. |
Dependent item | vfs.fs.dependent.size[{#FSNAME},free] Preprocessing
|
FS [{#FSNAME}]: Inodes: Free, in % | Free metadata space expressed in %. |
Dependent item | vfs.fs.dependent.inode[{#FSNAME},pfree] Preprocessing
|
Trigger prototypes for Mounted filesystem discovery
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
FS [{#FSNAME}]: Filesystem has become read-only | The filesystem has become read-only, possibly due to an I/O error. Available only for Zabbix agents 6.4 and higher. |
last(/Linux by Zabbix agent/vfs.fs.dependent[{#FSNAME},readonly],#2)=0 and last(/Linux by Zabbix agent/vfs.fs.dependent[{#FSNAME},readonly])=1 |
Average | Manual close: Yes |
FS [{#FSNAME}]: Space is critically low | The volume's space usage exceeds the |
min(/Linux by Zabbix agent/vfs.fs.dependent.size[{#FSNAME},pused],5m)>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} |
Average | Manual close: Yes |
FS [{#FSNAME}]: Space is low | The volume's space usage exceeds the |
min(/Linux by Zabbix agent/vfs.fs.dependent.size[{#FSNAME},pused],5m)>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} |
Warning | Manual close: Yes Depends on:
|
FS [{#FSNAME}]: Running out of free inodes | Disk writing may fail if index nodes are exhausted, leading to error messages like "No space left on device" or "Disk is full", despite available free space. |
min(/Linux by Zabbix agent/vfs.fs.dependent.inode[{#FSNAME},pfree],5m)<{$VFS.FS.INODE.PFREE.MIN.CRIT:"{#FSNAME}"} |
Average | |
FS [{#FSNAME}]: Running out of free inodes | Disk writing may fail if index nodes are exhausted, leading to error messages like "No space left on device" or "Disk is full", despite available free space. |
min(/Linux by Zabbix agent/vfs.fs.dependent.inode[{#FSNAME},pfree],5m)<{$VFS.FS.INODE.PFREE.MIN.WARN:"{#FSNAME}"} |
Warning | Depends on:
|
LLD rule Block devices discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Block devices discovery | Zabbix agent | vfs.dev.discovery Preprocessing
|
Item prototypes for Block devices discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
{#DEVNAME}: Get stats | The contents of get |
Zabbix agent | vfs.file.contents[/sys/block/{#DEVNAME}/stat] Preprocessing
|
{#DEVNAME}: Disk read rate | r/s (read operations per second) - the number (after merges) of read requests completed per second for the device. |
Dependent item | vfs.dev.read.rate[{#DEVNAME}] Preprocessing
|
{#DEVNAME}: Disk write rate | w/s (write operations per second) - the number (after merges) of write requests completed per second for the device. |
Dependent item | vfs.dev.write.rate[{#DEVNAME}] Preprocessing
|
{#DEVNAME}: Disk read time (rate) | The rate of total read time counter; used in |
Dependent item | vfs.dev.read.time.rate[{#DEVNAME}] Preprocessing
|
{#DEVNAME}: Disk write time (rate) | The rate of total write time counter; used in |
Dependent item | vfs.dev.write.time.rate[{#DEVNAME}] Preprocessing
|
{#DEVNAME}: Disk read request avg waiting time (r_await) | This formula contains two Boolean expressions that evaluate to 1 or 0 in order to set the calculated metric to zero and to avoid the exception - division by zero. |
Calculated | vfs.dev.read.await[{#DEVNAME}] |
{#DEVNAME}: Disk write request avg waiting time (w_await) | This formula contains two Boolean expressions that evaluate to 1 or 0 in order to set the calculated metric to zero and to avoid the exception - division by zero. |
Calculated | vfs.dev.write.await[{#DEVNAME}] |
{#DEVNAME}: Disk average queue size (avgqu-sz) | The current average disk queue; the number of requests outstanding on the disk while the performance data is being collected. |
Dependent item | vfs.dev.queue_size[{#DEVNAME}] Preprocessing
|
{#DEVNAME}: Disk utilization | The percentage of elapsed time during which the selected disk drive was busy while servicing read or write requests. |
Dependent item | vfs.dev.util[{#DEVNAME}] Preprocessing
|
Trigger prototypes for Block devices discovery
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
{#DEVNAME}: Disk read/write request responses are too high | This trigger might indicate the disk |
min(/Linux by Zabbix agent/vfs.dev.read.await[{#DEVNAME}],15m) > {$VFS.DEV.READ.AWAIT.WARN:"{#DEVNAME}"} or min(/Linux by Zabbix agent/vfs.dev.write.await[{#DEVNAME}],15m) > {$VFS.DEV.WRITE.AWAIT.WARN:"{#DEVNAME}"} |
Warning | Manual close: Yes |
LLD rule Network interface discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Network interface discovery | The discovery of network interfaces. |
Zabbix agent | net.if.discovery |
Item prototypes for Network interface discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Interface {#IFNAME}: Bits received | Zabbix agent | net.if.in["{#IFNAME}"] Preprocessing
|
|
Interface {#IFNAME}: Bits sent | Zabbix agent | net.if.out["{#IFNAME}"] Preprocessing
|
|
Interface {#IFNAME}: Outbound packets with errors | Zabbix agent | net.if.out["{#IFNAME}",errors] Preprocessing
|
|
Interface {#IFNAME}: Inbound packets with errors | Zabbix agent | net.if.in["{#IFNAME}",errors] Preprocessing
|
|
Interface {#IFNAME}: Outbound packets discarded | Zabbix agent | net.if.out["{#IFNAME}",dropped] Preprocessing
|
|
Interface {#IFNAME}: Inbound packets discarded | Zabbix agent | net.if.in["{#IFNAME}",dropped] Preprocessing
|
|
Interface {#IFNAME}: Operational status | Reference: https://www.kernel.org/doc/Documentation/networking/operstates.txt |
Zabbix agent | vfs.file.contents["/sys/class/net/{#IFNAME}/operstate"] Preprocessing
|
Interface {#IFNAME}: Interface type | It indicates the interface protocol type as a decimal value. See Reference: https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-net |
Zabbix agent | vfs.file.contents["/sys/class/net/{#IFNAME}/type"] Preprocessing
|
Interface {#IFNAME}: Speed | It indicates the latest or current speed value of the interface. The value is an integer representing the link speed expressed in bits/sec. This attribute is only valid for the interfaces that implement the ethtool Reference: https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-net |
Zabbix agent | vfs.file.contents["/sys/class/net/{#IFNAME}/speed"] Preprocessing
|
Trigger prototypes for Network interface discovery
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Interface {#IFNAME}: High bandwidth usage | The utilization of the network interface is close to its estimated maximum bandwidth. |
(avg(/Linux by Zabbix agent/net.if.in["{#IFNAME}"],15m)>({$IF.UTIL.MAX:"{#IFNAME}"}/100)*last(/Linux by Zabbix agent/vfs.file.contents["/sys/class/net/{#IFNAME}/speed"]) or avg(/Linux by Zabbix agent/net.if.out["{#IFNAME}"],15m)>({$IF.UTIL.MAX:"{#IFNAME}"}/100)*last(/Linux by Zabbix agent/vfs.file.contents["/sys/class/net/{#IFNAME}/speed"])) and last(/Linux by Zabbix agent/vfs.file.contents["/sys/class/net/{#IFNAME}/speed"])>0 |
Warning | Manual close: Yes Depends on:
|
Interface {#IFNAME}: High error rate | It recovers when it is below 80% of the |
min(/Linux by Zabbix agent/net.if.in["{#IFNAME}",errors],5m)>{$IF.ERRORS.WARN:"{#IFNAME}"} or min(/Linux by Zabbix agent/net.if.out["{#IFNAME}",errors],5m)>{$IF.ERRORS.WARN:"{#IFNAME}"} |
Warning | Manual close: Yes Depends on:
|
Interface {#IFNAME}: Link down | This trigger expression works as follows: |
{$IFCONTROL:"{#IFNAME}"}=1 and last(/Linux by Zabbix agent/vfs.file.contents["/sys/class/net/{#IFNAME}/operstate"])=2 and (last(/Linux by Zabbix agent/vfs.file.contents["/sys/class/net/{#IFNAME}/operstate"],#1)<>last(/Linux by Zabbix agent/vfs.file.contents["/sys/class/net/{#IFNAME}/operstate"],#2)) |
Average | Manual close: Yes |
Interface {#IFNAME}: Ethernet has changed to lower speed than it was before | This Ethernet connection has transitioned down from its known maximum speed. This might be a sign of autonegotiation issues. Acknowledge to close the problem manually. |
change(/Linux by Zabbix agent/vfs.file.contents["/sys/class/net/{#IFNAME}/speed"])<0 and last(/Linux by Zabbix agent/vfs.file.contents["/sys/class/net/{#IFNAME}/speed"])>0 and (last(/Linux by Zabbix agent/vfs.file.contents["/sys/class/net/{#IFNAME}/type"])=6 or last(/Linux by Zabbix agent/vfs.file.contents["/sys/class/net/{#IFNAME}/type"])=1) and (last(/Linux by Zabbix agent/vfs.file.contents["/sys/class/net/{#IFNAME}/operstate"])<>2) |
Info | Manual close: Yes Depends on:
|
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums