Having to use some large numbers, for example '86400' to represent the number of seconds in one day, is both difficult and error-prone. This is why you can use some appropriate unit symbols (or suffixes) to simplify Zabbix trigger expressions and item keys.
Instead of '86400' for the number of seconds you can simply enter '1d'. Suffixes function as multipliers.
For time you can use:
Time suffixes support only integer numbers (so '1h' is supported, '1,5h' or '1.5h' are not; use '90m' instead).
Time suffixes are supported in:
ha_set_failover_delay=delay
runtime control optionMemory size suffixes are supported in:
For memory size you can use:
Suffixes can also be used to display numeric item values in a human-readable format.
To enable this, use one of the following suffixes in the Units field when configuring an item:
The following additional rules apply to how these suffixes are interpreted and displayed:
When Units are used, the following multiplier suffixes are automatically applied to item values:
By using some appropriate suffixes you can write trigger expressions that are easier to understand and maintain, for example these expressions:
last(/host/system.uptime)<86400s
avg(/host/system.cpu.load,600s)<10
last(/host/vm.memory.size[available])<20971520
could be changed to:
last(/host/system.uptime)<1d
avg(/host/system.cpu.load,10m)<10
last(/host/vm.memory.size[available])<20M
Item values can also be converted, for example:
1 B → 1 B
1024 B → 1 KB
1536 B → 1.5 KB
881764 B → 881.76 KB
0.0000155 s → 0.016ms
3470400 s → 1M 10d 4h
2606400 s → 1M 4h
2592000 s → 1M
2592001 s → 1M
17764 uptime → 04:56:04
86400 uptime → 1 day, 00:00:00
881764 uptime → 10 days, 04:56:04
32417764 uptime → 375 days, 04:56:04
881764 unixtime → 1970-01-11 04:56:04 AM
17764 Hz → 17.76 KHz
86400 Hz → 86.4 KHz
881764 Hz → 881.76 KHz
32417764 Hz → 32.42 MHz
By default, specifying a unit for an item results in a multiplier prefix being added - for example, an incoming value '2048' with unit 'B' would be displayed as '2KB' by the frontend (for more details, see Units in item configuration).
To prevent a unit from conversion, use the !
prefix, for example, !B
. To better understand how the conversion works with and without the exclamation mark, see the following examples of values and units:
1024 !B → 1024 B
1024 B → 1 KB
61 !s → 61 s
61 s → 1m 1s
0 !uptime → 0 uptime
0 uptime → 00:00:00
0 !! → 0 !
0 ! → 0
Before Zabbix 4.0, there was a hardcoded unit stoplist consisting of ms
, rpm
, RPM
, %
. This stoplist has been deprecated, thus the correct way to prevent converting such units is !ms
, !rpm
, !RPM
, !%
.