1日の秒数を表すために「86400」などの大きな数値を使用するのは、手間かつエラーが発生しやすくなります。これがZabbixトリガー式とアイテムキーを単純化するためにいくつかの適切な単位記号(または接尾辞)を使用できる理由です。
例えば秒数の「86400」の代わりに「1d」とできます。接尾辞は乗数として機能します。
時間では以下のサフィックスを使うことができます
時間のサフィックスは整数のみをサポートします(「1h」はOK。「1,5h」や「1.5h」はNG。代わりに「90m」を使用してください)
時間のサフィックスは次で使用可能です。
ha_set_failover_delay= delay
ランタイムコントロールオプションメモリサイズのサフィックスは次で使用可能です。
メモリサイズのサフィックスは以下を使用できます。
単位記号は、フロントエンドのデータを人間が読みやすい形式で表現するためにも使用されます。
Zabbixサーバーとフロントエンドの両方で、これらのシンボルがサポートされています。
アイテムの値にBが使用されるとフロントエンドに表示されるBpsは二進数です。それ以外の場合は十進数で表示されます。
さらに、フロントエンドは次の表示もサポートします。
いくつかの適切な接尾辞を使用することにより、理解と維持が容易なトリガー式を記述できます。 たとえば次の式は
last(/host/system.uptime[])<86400s
avg(/host/system.cpu.load,600s)<10
last(/host/vm.memory.size[available])<20971520
次のように変更できます
last(/host/system.uptime[])<1d
avg(/host/system.cpu.load,10m)<10
last(/host/vm.memory.size[available])<20M
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
, !%
.