Itemオブジェクト
次のオブジェクトは、itemAPIに直接関連しています。
アイテム
Webアイテムは、Zabbix APIを介して直接作成、更新、削除することはできません。
アイテムオブジェクトには、次のプロパティがあります。
| Property | Type | Description |
|---|---|---|
| itemid | ID | アイテムのID。 Property behavior: - read-only - required for update operations |
| delay | string | アイテムの更新間隔。 秒、または接尾辞付きの時間単位(例: 30s、1m、2h、1d)を指定できます。さらに、1つ以上のcustom intervalsを任意で指定でき、各値はセミコロンで区切ります。カスタム間隔には、柔軟間隔とスケジュール間隔を組み合わせることができます。 ユーザーマクロを指定できます。使用する場合、値は単一のマクロでなければなりません。複数のマクロや、マクロとテキストを混在させることはできません。柔軟間隔は、スラッシュで区切った2つのマクロとして記述できます(例: {$FLEX_INTERVAL}/{$FLEX_PERIOD})。例: 1h;wd1-5h9-18;{$Macro1}/1-7,00:00-24:00;0/6-7,12:00-24:00;{$Macro2}/{$Macro3}Property behavior: - required if type is set to "Zabbix agent" (0), "Simple check" (3), "Zabbix internal" (5), "External check" (10), "Database monitor" (11), "IPMI agent" (12), "SSH agent" (13), "TELNET agent" (14), "Calculated" (15), "JMX agent" (16), "HTTP agent" (19), "SNMP agent" (20), "Script" (21), "Browser" (22), or if type is set to "Zabbix agent (active)" (7) and key_ does not contain "mqtt.get" |
| hostid | ID | アイテムが属するホストまたはテンプレートのID。 Property behavior: - constant - required for create operations |
| interfaceid | ID | アイテムのホストインターフェースのID。 Property behavior: - required if item belongs to host and type is set to "Zabbix agent", "IPMI agent", "JMX agent", "SNMP trap", or "SNMP agent"- supported if item belongs to host and type is set to "Simple check", "External check", "SSH agent", "TELNET agent", or "HTTP agent"- read-only for discovered objects |
| key_ | string | アイテムキー。 Property behavior: - required for create operations - read-only for inherited objects or discovered objects |
| name | string | アイテムの名前。 ユーザーマクロをサポートします。 Property behavior: - required for create operations - read-only for inherited objects or discovered objects |
| name_resolved | string | ユーザーマクロを展開したアイテム名。 Property behavior: - read-only |
| type | integer | アイテムのタイプ。 Possible values: 0 - Zabbix エージェント; 2 - Zabbix trapper; 3 - Simple check; 5 - Zabbix internal; 7 - Zabbix エージェント (active); 9 - Web item; 10 - External check; 11 - Database monitor; 12 - IPMI エージェント; 13 - SSH エージェント; 14 - TELNET エージェント; 15 - Calculated; 16 - JMX エージェント; 17 - SNMP trap; 18 - Dependent item; 19 - HTTP エージェント; 20 - SNMP エージェント; 21 - Script; 22 - Browser. Property behavior: - required for create operations - read-only for inherited objects or discovered objects |
| url | string | URL文字列。 ユーザーマクロ、{HOST.IP}、{HOST.CONN}、{HOST.DNS}、{HOST.HOST}、{HOST.NAME}、{HOST.PORT}、{ITEM.ID}、{ITEM.KEY}をサポートします。 Property behavior: - required if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| value_type | integer | アイテムの情報タイプ。 Possible values: 0 - numeric float; 1 - character; 2 - log; 3 - numeric unsigned; 4 - text; 5 - binary; 6 - JSON. Property behavior: - required for create operations - read-only for inherited objects or discovered objects |
| allow_traps | integer | trapperアイテムと同様に値の取り込みを許可します。 0 - (default) 受信データの受け入れを許可しない; 1 - 受信データの受け入れを許可する。 Property behavior: - supported if type is set to "HTTP agent"- read-only for discovered objects |
| authtype | integer | 認証方式。 Possible values if type is set to "SSH agent":0 - (default) password; 1 - public key. Possible values if type is set to "HTTP agent":0 - (default) none; 1 - basic; 2 - NTLM; 3 - Kerberos; 4 - Digest. Property behavior: - supported if type is set to "SSH agent" or "HTTP agent"- read-only for inherited objects (if type is set to "HTTP agent") or discovered objects |
| description | string | アイテムの説明。 Property behavior: - read-only for discovered objects |
| error | string | アイテム値の更新に問題がある場合のエラーテキスト。 Property behavior: - read-only |
| flags | integer | アイテムのOrigin。 Possible values: 0 - a plain item; 4 - an item converted from prototype. Property behavior: - read-only |
| follow_redirects | integer | データ取得時にレスポンスのリダイレクトを追跡するかどうか。 Possible values: 0 - Do not follow redirects; 1 - (default) Follow redirects. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| headers | array | HTTPリクエスト実行時に送信されるheadersの配列。 Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| history | string | 履歴データを保存する期間の時間単位。 ユーザーマクロも指定できます。 Default: 31d. Property behavior: - read-only for discovered objects |
| http_proxy | string | HTTP(S)プロキシ接続文字列。 Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| inventory_link | integer | アイテムによって設定されるホストインベントリフィールドのID。 対応するホストインベントリフィールドとそのIDの一覧については、host inventory pageを参照してください。 Default: 0. Property behavior: - supported if value_type is set to "numeric float", "character", "numeric unsigned", or "text"- read-only for discovered objects |
| ipmi_sensor | string | IPMIセンサー。 Property behavior: - required if type is set to "IPMI agent" and key_ is not set to "ipmi.get"- supported if type is set to "IPMI agent"- read-only for inherited objects or discovered objects |
| jmx_endpoint | string | JMXエージェントのカスタム接続文字列。 Default value: service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi Property behavior: - supported if type is set to "JMX agent"- read-only for discovered objects |
| lastclock | timestamp | アイテム値が最後に更新された時刻。 By default, only values that fall within the last 24 hours are displayed. You can extend this time period by changing the value of Max history display period parameter in the Administration > General menu section. Property behavior: - read-only |
| lastns | integer | アイテム値が最後に更新されたナノ秒。 By default, only values that fall within the last 24 hours are displayed. You can extend this time period by changing the value of Max history display period parameter in the Administration > General menu section. Property behavior: - read-only |
| lastvalue | string | アイテムの最新値。 By default, only values that fall within the last 24 hours are displayed. You can extend this time period by changing the value of Max history display period parameter in the Administration > General menu section. Property behavior: - read-only |
| logtimefmt | string | ログエントリ内の時刻の形式。 Property behavior: - supported if value_type is set to "log"- read-only for inherited objects or discovered objects |
| master_itemid | ID | マスターアイテムのID。 Property behavior: - required if type is set to "Dependent item"- read-only for inherited objects or discovered objects |
| output_format | integer | レスポンスをJSONに変換するかどうか。 0 - (default) 生データとして保存; 1 - JSONに変換。 Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| params | string | アイテムのタイプに応じた追加パラメータ: - SSHエージェントおよびTELNETエージェントアイテムで実行されるスクリプト; - データベース監視アイテムのSQLクエリ; - 計算アイテムの数式; - スクリプトおよびブラウザーアイテムのスクリプト。 Property behavior: - required if type is set to "Database monitor", "SSH agent", "TELNET agent", "Calculated", "Script", or "Browser"- read-only for inherited objects (if type is set to "Script" or "Browser") or discovered objects |
| parameters | object/array | type が "Script" または "Browser" の場合の追加パラメータ。name と value プロパティを持つオブジェクトの配列で、name は一意でなければなりません。Property behavior: - supported if type is set to "Script" or "Browser"- read-only for inherited objects or discovered objects |
| password | string | 認証用パスワード。 Property behavior: - required if type is set to "JMX agent" and username is set- supported if type is set to "Simple check", "SSH agent", "TELNET agent", "Database monitor", or "HTTP agent"- read-only for inherited objects (if type is set to "HTTP agent") or discovered objects |
| post_type | integer | posts プロパティに保存されるPOSTデータ本文のタイプ。Possible values: 0 - (default) Raw data; 2 - JSON data; 3 - XML data. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| posts | string | HTTP(S)リクエスト本文データ。 Property behavior: - required if type is set to "HTTP agent" and post_type is set to "JSON data" or "XML data"- supported if type is set to "HTTP agent" and post_type is set to "Raw data"- read-only for inherited objects or discovered objects |
| prevvalue | string | アイテムの前回値。 By default, only values that fall within the last 24 hours are displayed. You can extend this time period by changing the value of Max history display period parameter in the Administration > General menu section. Property behavior: - read-only |
| privatekey | string | 秘密鍵ファイル名。 Property behavior: - required if type is set to "SSH agent" and authtype is set to "public key"- read-only for discovered objects |
| publickey | string | 公開鍵ファイル名。 Property behavior: - required if type is set to "SSH agent" and authtype is set to "public key"- read-only for discovered objects |
| query_fields | array | HTTPリクエスト実行時に送信されるquery fieldsの配列。 Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| request_method | integer | リクエストメソッドのタイプ。 Possible values: 0 - (default) GET; 1 - POST; 2 - PUT; 3 - HEAD. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| retrieve_mode | integer | 保存するレスポンスの部分。 Possible values if request_method is set to "GET", "POST", or "PUT":0 - (default) Body; 1 - Headers; 2 - Both body and headers will be stored. Possible values if request_method is set to "HEAD":1 - Headers. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| snmp_oid | string | SNMP OID。 Property behavior: - required if type is set to "SNMP agent"- read-only for inherited objects or discovered objects |
| ssl_cert_file | string | 公開SSL鍵ファイルのパス。 Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| ssl_key_file | string | 秘密SSL鍵ファイルのパス。 Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| ssl_key_password | string | SSL鍵ファイルのパスワード。 Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| state | integer | アイテムの状態。 Possible values: 0 - (default) normal; 1 - not supported. Property behavior: - read-only |
| status | integer | アイテムのステータス。 Possible values: 0 - (default) enabled item; 1 - disabled item. |
| status_codes | string | 必要なHTTPステータスコードの範囲。カンマ区切りで指定します。 カンマ区切りリストの一部としてユーザーマクロもサポートします。 Example: 200,200-{$M},{$M},200-400 Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| templateid | ID | 親テンプレートアイテムのID。 Hint: アイテムが属するテンプレートを指定するには、 hostid プロパティを使用します。Property behavior: - read-only |
| timeout | string | アイテムデータ取得リクエストのタイムアウト。 秒、または接尾辞付きの時間単位(例: 30s、1m)を指定できます。ユーザーマクロも指定できます。 Possible values range: 1-600s. Default: "" - use proxy/global settings. Property behavior: - supported if type is set to "Zabbix agent" (0), "Simple check" (3) and key_ does not start with "vmware." and "icmpping", "Zabbix agent (active)" (7), "External check" (10), "Database monitor" (11), "SSH agent" (13), "TELNET agent" (14), "HTTP agent" (19), "SNMP agent" (20) and snmp_oid starts with "walk[" or "get[", "Script" (21), "Browser" (22)- read-only for inherited and discovered objects |
| trapper_hosts | string | 許可されたホスト。 Property behavior: - readonly for discovered objects - supported if type is set to "Zabbix trapper", or if type is set to "HTTP agent" and allow_traps is set to "Allow to accept incoming data".If the property is omitted, it is automatically set to the {$TRAPPER.ALLOWED_HOSTS} user macro (default value). By default, {$TRAPPER.ALLOWED_HOSTS} is 127.0.0.1,::1.If the property is set to an empty string, incoming connections will be denied from all hosts. |
| trends | string | トレンドデータを保存する期間の時間単位。 ユーザーマクロも指定できます。 Default: 365d. Property behavior: - supported if value_type is set to "numeric float" or "numeric unsigned"- read-only for discovered objects |
| units | string | 値の単位。 Property behavior: - supported if value_type is set to "numeric float" or "numeric unsigned"- read-only for inherited objects or discovered objects |
| username | string | 認証用ユーザー名。 Property behavior: - required if type is set to "SSH agent", "TELNET agent", or if type is set to "JMX agent" and password is set- supported if type is set to "Simple check", "Database monitor", or "HTTP agent"- read-only for inherited objects (if type is set to "HTTP agent") or discovered objects |
| uuid | string | 一意の汎用識別子。インポートしたアイテムを既存のものに関連付けるために使用します。指定されていない場合は自動生成されます。 Property behavior: - supported if the item belongs to a template |
| valuemapid | ID | 関連付けられた値マップのID。 Property behavior: - supported if value_type is set to "numeric float", "character", or "numeric unsigned"- read-only for inherited objects or discovered objects |
| verify_host | integer | 接続先ホスト名がホストの証明書内のものと一致するかどうかを検証するかどうか。 Possible values: 0 - (default) Do not validate; 1 - Validate. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
| verify_peer | integer | ホストの証明書が正当かどうかを検証するかどうか。 Possible values: 0 - (default) Do not validate; 1 - Validate. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects or discovered objects |
HTTPヘッダー
ヘッダーオブジェクトには、以下のプロパティがあります。
HTTPクエリフィールド
クエリフィールドオブジェクトは、URLパラメータを指定するために使用される名前と値を定義します。 このオブジェクトには、以下のプロパティがあります。
アイテムタグ
アイテムタグオブジェクトには、以下のプロパティがあります。
| プロパティ | 型 | 説明 |
|---|---|---|
| tag | string | アイテムタグ名。 プロパティの動作: - 必須 |
| value | string | アイテムタグの値。 プロパティの動作: - 読み取り専用。 |
| object | integer | タグの継承元オブジェクトのタイプ。 指定可能な値: 0 - テンプレート; 1 - ホスト。 プロパティの動作: - 読み取り専用。 |
| objectid | ID | タグの継承元オブジェクトのID。 プロパティの動作: - 読み取り専用。 |
アイテムの前処理
アイテムの前処理オブジェクトには、以下のプロパティがあります。
| Property | Type | Description |
|---|---|---|
| type | integer | 前処理オプションのタイプ。 指定可能な値: 1 - カスタム乗数; 2 - 右トリム; 3 - 左トリム; 4 - トリム; 5 - 正規表現; 6 - 真偽値から10進数; 7 - 8進数から10進数; 8 - 16進数から10進数; 9 - 単純変化; 10 - 秒あたりの変化; 11 - XML XPath; 12 - JSONPath; 13 - 範囲内; 14 - 正規表現に一致; 15 - 正規表現に一致しない; 16 - JSON内のエラーをチェック; 17 - XML内のエラーをチェック; 18 - 正規表現を使用してエラーをチェック; 19 - 未変更を破棄; 20 - ハートビート付きで未変更を破棄; 21 - JavaScript; 22 - Prometheusパターン; 23 - PrometheusからJSON; 24 - CSVからJSON; 25 - 置換; 26 - 未サポートをチェック; 27 - XMLからJSON; 28 - SNMP walk値; 29 - SNMP walkからJSON; 30 - SNMP get値。 Property behavior: - required |
| params | string | 前処理オプションで使用される追加パラメータ。 複数のパラメータは改行文字 (\n) で区切ります。 type が "Check unsupported" に設定されている場合、パラメータは <scope>[\n<pattern>] 構文に従います。ここで、pattern は正規表現、scope は以下のいずれかです:-1 - 任意のエラーに一致; \ 0 - エラーメッセージが pattern に一致するかをチェック; \ 1 - エラーメッセージが pattern に一致しないかをチェック。 Property behavior: - type が "Custom multiplier" (1), "Right trim" (2), "Left trim" (3), "Trim" (4), "Regular expression" (5), "XML XPath" (11), "JSONPath" (12), "In range" (13), "Matches regular expression" (14), "Does not match regular expression" (15), "Check for error in JSON" (16), "Check for error in XML" (17), "Check for error using regular expression" (18), "Discard unchanged with heartbeat" (20), "JavaScript" (21), "Prometheus pattern" (22), "Prometheus to JSON" (23), "CSV to JSON" (24), "Replace" (25), Check unsupported (26), "SNMP walk value" (28), "SNMP walk to JSON" (29), または "SNMP get value" (30) に設定されている場合は required |
| error_handler | integer | 前処理ステップが失敗した場合に使用されるアクションタイプ。 指定可能な値: 0 - エラーメッセージはZabbix serverによって設定される; 1 - 値を破棄; 2 - カスタム値を設定; 3 - カスタムエラーメッセージを設定。 type が "Check unsupported" に設定されている場合の指定可能な値:1 - 値を破棄; 2 - カスタム値を設定; 3 - カスタムエラーメッセージを設定。 Property behavior: - type が "Custom multiplier" (1), "Regular expression" (5), "Boolean to decimal" (6), "Octal to decimal" (7), "Hexadecimal to decimal" (8), "Simple change" (9), "Change per second" (10), "XML XPath" (11), "JSONPath" (12), "In range" (13), "Matches regular expression" (14), "Does not match regular expression" (15), "Check for error in JSON" (16), "Check for error in XML" (17), "Check for error using regular expression" (18), "Prometheus pattern" (22), "Prometheus to JSON" (23), "CSV to JSON" (24), "Check unsupported" (26), "XML to JSON" (27), "SNMP walk value" (28), "SNMP walk to JSON" (29), または "SNMP get value" (30) に設定されている場合は required |
| error_handler_params | string | エラーハンドラーのパラメータ。 Property behavior: - error_handler が "Set custom value" または "Set custom error message" に設定されている場合は required |
以下のパラメータおよびエラーハンドラーが、各前処理タイプでサポートされています。
| Preprocessing type | Name | Parameter 1 | Parameter 2 | Parameter 3 | Supported error handlers |
|---|---|---|---|---|---|
| 1 | カスタム乗数 | number1, 6 | 0, 1, 2, 3 | ||
| 2 | 右トリム | 文字のリスト2 | |||
| 3 | 左トリム | 文字のリスト2 | |||
| 4 | トリム | 文字のリスト2 | |||
| 5 | 正規表現 | pattern3 | output2 | 0, 1, 2, 3 | |
| 6 | 真偽値から10進数 | 0, 1, 2, 3 | |||
| 7 | 8進数から10進数 | 0, 1, 2, 3 | |||
| 8 | 16進数から10進数 | 0, 1, 2, 3 | |||
| 9 | 単純変化 | 0, 1, 2, 3 | |||
| 10 | 秒あたりの変化 | 0, 1, 2, 3 | |||
| 11 | XML XPath | path4 | 0, 1, 2, 3 | ||
| 12 | JSONPath | path4 | 0, 1, 2, 3 | ||
| 13 | 範囲内 | min1, 6 | max1, 6 | 0, 1, 2, 3 | |
| 14 | 正規表現に一致 | pattern3 | 0, 1, 2, 3 | ||
| 15 | 正規表現に一致しない | pattern3 | 0, 1, 2, 3 | ||
| 16 | JSON内のエラーをチェック | path4 | 0, 1, 2, 3 | ||
| 17 | XML内のエラーをチェック | path4 | 0, 1, 2, 3 | ||
| 18 | 正規表現を使用してエラーをチェック | pattern3 | output2 | 0, 1, 2, 3 | |
| 19 | 未変更を破棄 | ||||
| 20 | ハートビート付きで未変更を破棄 | seconds5, 6 | |||
| 21 | JavaScript | script2 | |||
| 22 | Prometheusパターン | pattern6, 7 | value, label, function |
output8, 9 | 0, 1, 2, 3 |
| 23 | PrometheusからJSON | pattern6, 7 | 0, 1, 2, 3 | ||
| 24 | CSVからJSON | character2 | character2 | 0,1 | 0, 1, 2, 3 |
| 25 | 置換 | search string2 | replacement2 | ||
| 26 | 未サポートをチェック | scope1 | pattern3, 6 | 1, 2, 3 | |
| 27 | XMLからJSON | 0, 1, 2, 3 | |||
| 28 | SNMP walk値 | OID2 | 形式: 0 - 変更なし 1 - Hex-STRING から UTF-8 2 - Hex-STRING から MAC 3 - BITS から整数 |
0, 1, 2, 3 | |
| 29 | SNMP walkからJSON10 | フィールド名2 | OIDプレフィックス2 | 形式: 0 - 変更なし 1 - Hex-STRING から UTF-8 2 - Hex-STRING から MAC 3 - BITS から整数 |
0, 1, 2, 3 |
| 30 | SNMP get値 | 形式: 1 - Hex-STRING から UTF-8 2 - Hex-STRING から MAC 3 - BITS から整数 |
0, 1, 2, 3 | ||
1 浮動小数点数 (整数は暗黙的に浮動小数点値に変換されます)
2 文字列
3 正規表現
4 JSONPath または XML XPath
5 正の整数 (時間サフィックスをサポート。例: 30s, 1m, 2h, 1d)
6 ユーザーマクロ
7 次の構文に従うPrometheusパターン: <metric name>{<label name>="<label value>", ...} == <value>。
Prometheusパターンの各構成要素 (メトリクス、ラベル名、ラベル値、メトリクス値) にはユーザーマクロを使用できます。
8 次の構文に従うPrometheus出力: 2番目のパラメータとして label が選択されている場合は <label name> (ユーザーマクロ可)。
9 2番目のパラメータとして function が選択されている場合の集計関数のいずれか: sum, min, max, avg, count。
10 改行文字で区切られた複数の "Field name,OID prefix,Format records" レコードをサポートします。