This is a translation of the original English documentation page. Help us make it better.

1 アイテムの作成

概要

ZabbixのWebインターフェースでアイテムを作成するには、以下の手順で行います:

  • 設定ホスト を選択
  • ホストの行の アイテム をクリック
  • 画面右上の アイテムの作成 をクリック
  • フォーム内のアイテムのパラメータを入力

また、既存のアイテムを開き、複製 ボタンを押し、別の名前で保存することでもアイテムを作成することができます。

設定

アイテムタブには、一般的なアイテムの属性が表示されます。

必須入力項目には、赤いアスタリスクが表示されています。

パラメータ 説明
名前 アイテムの名前を設定します。
タイプ アイテムのタイプです。それぞれのアイテムタイプセクションを参照してください。
キー アイテムキーです(2048文字まで)。
サポートされているアイテムキーは、それぞれのセクションに記載されています。
キーは、1つのホスト内で一意である必要があります。
キータイプが「Zabbixエージェント」、「Zabbixエージェント(アクティブ)」、「シンプルチェック」の場合、ZabbixエージェントかZabbixサーバーがキーの値をサポートしている必要があります。
正しいキーのフォーマットも参照してください。
データ型 Type of data as stored in the database after performing conversions, if any.
Numeric (unsigned) - 64bit unsigned integer
Numeric (float) - 64bit floating point number
This type will allow precision of approximately 15 digits and range from approximately -1.79E+308 to 1.79E+308 (with exception of PostgreSQL 11 and earlier versions).
Receiving values in scientific notation is also supported. E.g. 1.23E+7, 1e308, 1.1E-4.
Character - short text data
Log - long text data with optional log related properties (timestamp, source, severity, logeventid)
Text - long text data. See also text data limits.
For item keys that return data only in one specific format, matching type of information is selected automatically.
ホストインターフェース Select the host interface. This field is available when editing an item on the host level.
単位 If a unit symbol is set, Zabbix will add post processing to the received value and display it with the set unit postfix.
By default, if the raw value exceeds 1000, it is divided by 1000 and displayed accordingly. For example, if you set bps and receive a value of 881764, it will be displayed as 881.76 Kbps.
The JEDEC memory standard is used for processing B (byte), Bps (bytes per second) units, which are divided by 1024. Thus, if units are set to B or Bps Zabbix will display:
1 as 1B/1Bps
1024 as 1KB/1KBps
1536 as 1.5KB/1.5KBps
Special processing is used if the following time-related units are used:
unixtime - translated to "yyyy.mm.dd hh:mm:ss". To translate correctly, the received value must be a Numeric (unsigned) type of information.
uptime - translated to "hh:mm:ss" or "N days, hh:mm:ss"
For example, if you receive the value as 881764 (seconds), it will be displayed as "10 days, 04:56:04"
s - translated to "yyy mmm ddd hhh mmm sss ms"; parameter is treated as number of seconds.
For example, if you receive the value as 881764 (seconds), it will be displayed as "10d 4h 56m"
Only 3 upper major units are shown, like "1m 15d 5h" or "2h 4m 46s". If there are no days to display, only two levels are displayed - "1m 5h" (no minutes, seconds or milliseconds are shown). Will be translated to "< 1 ms" if the value is less than 0.001.
Note that if a unit is prefixed with !, then no unit prefixes/processing is applied to item values. See unit conversion.
監視間隔 Retrieve a new value for this item every N seconds. Maximum allowed update interval is 86400 seconds (1 day).
Time suffixes are supported, e.g. 30s, 1m, 2h, 1d.
User macros are supported.
A single macro has to fill the whole field. Multiple macros in a field or macros mixed with text are not supported.
Note: The update interval can only be set to '0' if custom intervals exist with a non-zero value. If set to '0', and a custom interval (flexible or scheduled) exists with a non-zero value, the item will be polled during the custom interval duration.
Note that the first item poll after the item became active or after update interval change might occur earlier than the configured value.
An existing passive item can be polled for value immediately by pushing the Execute now button.
監視間隔のカスタマイズ You can create custom rules for checking the item:
Flexible - create an exception to the Update interval (interval with different frequency)
Scheduling - create a custom polling schedule.
For detailed information see Custom intervals.
Time suffixes are supported in the Interval field, e.g. 30s, 1m, 2h, 1d.
User macros are supported.
A single macro has to fill the whole field. Multiple macros in a field or macros mixed with text are not supported.
Scheduling is supported since Zabbix 3.0.0.
Note: Not available for Zabbix agent active items.
ヒストリの保存期間 Select either:
Do not keep history - item history is not stored. Useful for master items if only dependent items need to keep history.
This setting cannot be overridden by global housekeeper settings.
Storage period - specify the duration of keeping detailed history in the database (1 hour to 25 years). Older data will be removed by the housekeeper. Stored in seconds.
Time suffixes are supported, e.g. 2h, 1d. User macros are supported.
The Storage period value can be overridden globally in Administration → General → Housekeeper.
If a global overriding setting exists, a green info icon is displayed. If you position your mouse on it, a warning message is displayed, e.g. Overridden by global housekeeper settings (1d).
It is recommended to keep the recorded values for the smallest possible time to reduce the size of value history in the database. Instead of keeping a long history of values, you can keep longer data of trends.
See also History and trends.
トレンドの保存期間 Select either:
Do not keep trends - trends are not stored.
This setting cannot be overridden by global housekeeper settings.
Storage period - specify the duration of keeping aggregated (hourly min, max, avg, count) history in the database (1 day to 25 years). Older data will be removed by the housekeeper. Stored in seconds.
Time suffixes are supported, e.g. 24h, 1d. User macros are supported.
The Storage period value can be overridden globally in Administration → General → Housekeeper.
If a global overriding setting exists, a green info icon is displayed. If you position your mouse on it, a warning message is displayed, e.g. Overridden by global housekeeper settings (7d).
Note: Keeping trends is not available for non-numeric data - character, log and text.
See also History and trends.
値のマッピング Apply value mapping to this item. Value mapping does not change received values, it is for displaying data only.
It works with Numeric(unsigned), Numeric(float) and Character items.
For example, "Windows service states".
ログの時間の形式 Available for items of type Log only. Supported placeholders:
* y: Year (1970-2038)
* M: Month (01-12)
* d: Day (01-31)
* h: Hour (00-23)
* m: Minute (00-59)
* s: Second (00-59)
If left blank the timestamp will not be parsed.
For example, consider the following line from the Zabbix agent log file:
" 23480:20100328:154718.045 Zabbix agent started. Zabbix 1.8.2 (revision 11211)."
It begins with six character positions for PID, followed by date, time, and the rest of the line.
Log time format for this line would be "pppppp:yyyyMMdd:hhmmss".
Note that "p" and ":" chars are just placeholders and can be anything but "yMdhms".
ホストインベントリフィールドの自動設定 You can select a host inventory field that the value of item will populate. This will work if automatic inventory population is enabled for the host.
This field is not available if Type of information is set to 'Log'.
説明 Enter an item description.
有効 Mark the checkbox to enable the item so it will be processed.
最新データ Click on the link to view the latest data for the item.
This link is only available when editing an already existing item.

アイテムタイプ固有のフィールドは、アイテムタイプのページに記述されています。

ホストレベルで既存のテンプレートレベルの項目を編集する場合、多くのフィールドが読み取り専用になります。フォームのヘッダーにあるリンクを使って、テンプレートレベルに移動し、そこで編集することができます。テンプレートレベルでの変更は、そのテンプレートがリンクされているすべてのホストに対するアイテムが変更されることに注意してください。

タグタブでは、アイテムレベルのタグを定義することができます。

アイテムの値の保存前処理

保存前処理 タブでは、受け取った値に対して変換するルールを定義することができます。

テスト

ある項目をテストし、正しく設定されれば、実際の値を得ることができます。 テストは、アイテムが保存される前でも行うことができます。

テストは、ホストとテンプレートのアイテム、アイテムのプロトタイプ、およびローレベルディスカバリールールで利用できます。 アクティブなアイテムでは、テストは利用できません。

アイテムのテストは、以下のパッシブアイテムのタイプに対応しています。

  • Zabbixエージェント
  • SNMPエージェント (v1, v2, v3)
  • IPMIエージェント
  • SSHエージェント
  • Telnetエージェント
  • JMXエージェント
  • シンプルチェック (icmpping*vmware.*のアイテムは除く)
  • Zabbixインターナル
  • 計算アイテム
  • 外部チェック
  • データベースモニタ
  • HTTPエージェント
  • スクリプト

アイテムをテストするには、アイテム設定画面の下部にある テスト ボタンをクリックします。テスト ボタンは、テストできない項目(アクティブチェックや除外されたシンプルチェックなど)については、無効になります。

アイテムテストフォームには、必要なホスト パラメータ (ホストアドレス、ポート、プロキシ名/プロキシなし)、およびアイテム固有の詳細(SNMPv2コミュニティやSNMPv3セキュリティ認証など)のフィールドがあります。これらのフィールドはコンテキストを認識します:

  • 値は、可能な限り事前に入力されています。
    エージェントが必要な項目については、ホストで選択されたエージェントインタフェースから情報を取得します。
  • テンプレートアイテムの値は、手動で入力する必要があります。
  • プレーンテキストのマクロ値は展開されます。
  • 値(または値の一部)がシークレットまたはVaultマクロであるフィールドは空であり
    手動で入力する必要があります。アイテムパラメータにシークレットマクロ値が含まれている場合、
    "アイテムにシークレット値を持つユーザー定義マクロが含まれています。
    これらのマクロの値は手動で入力してください。" という警告メッセージが表示されます。
  • フィールドは、アイテムの種類によって必要ない場合は無効になります。
    (たとえば、ホストアドレスのフィールドとプロキシのフィールドは、計算項目で無効になります)

アイテムをテストするには、値の取得をクリックします。値の取得に成功すると、フィールドに入力され、現在の値(存在する場合)が前の値フィールドに移動し、 同時に前の時間フィールド、すなわち2つの値の時間差(クリック数)を計算します。 そしてEOLシーケンスを検出し、"\n\r"を検出した場合、CRLFに置き換えようとします。

設定が正しくない場合は、考えられる原因を説明するエラーメッセージが表示されます。

ホストから正常に取得された値は、保存前処理 のテストに使用することも可能です。

フォームのボタン

フォームの下部にあるボタンで、いくつかの操作を行うことができます。

アイテムの追加。このボタンは新規のアイテムの時のみ使用できます。
アイテムのプロパティの更新。
現在のアイテムプロパティをベースにして別のアイテムを作成。
アイテムの値を取得。アイテムのタイプがパッシブなものだけ対応しています。(詳細参照)
注意 値の取得時には設定キャッシュは更新されません。つまり直近のアイテムの設定変更が反映されません。
値を取得できるかのテスト実行。
アイテムのヒストリとトレンドを削除。
アイテムの削除。
アイテムのプロパティ変更をキャンセル。

テキストデータの制限

テキストデータの制限は、データベースのバックエンドに依存します。
テキストデータをデータベースに格納する前に、データベースの定義と一致するように切り捨てられます。

DBMS 情報の種類
文字列 ログ テキスト
MySQL 255 文字 65536 バイト 65536 バイト
PostgreSQL 255 文字 65536 文字 65536 文字
Oracle 255 文字 65536 文字 65536 文字

単位変換

デフォルトでは、項目の単位を指定すると、乗数の接頭辞が追加されます。
例えば、入力値 '2048' に単位 'B' を指定した場合、'2KB' と表示されます。

単位を変換しないようにするには、!という接頭語を使用します。例えば !B のように。
感嘆符の有無にかかわらず,変換がどのように行われるかを理解するために,次の値と単位の例を参照してください。

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

Zabbix4.0以前は、ハードコードされたユニットストップリストがありました。
ms,rpm,RPM,%から構成されていました。このストップリストは廃止されました。
このような単位の変換を防ぐ正しい表記方法はms
, !rpm, !RPM, !% です。

カスタムスクリプトの制限

使用可能なカスタムスクリプトの長さは、使用するデータベースによって異なります。

DBMS 文字数の上限 バイト数の上限
MySQL 65535 65535
Oracle Database 2048 4000
PostgreSQL 65535 制限なし
SQLite (Zabbixプロキシ専用) 65535 制限なし

サポート対象外の項目

何らかの理由で値が取得できない項目は、サポート対象外になることがあります。 このような項目は、標準的な 監視間隔で再チェックされます。

サポート対象外のアイテムは、取得不可のステータスで報告されます。