Zabbixエージェント2プロトコルはコード、サイズ、データ モデルに基づいています。
タイプ | サイズ | コメント |
---|---|---|
バイト | 4 | ペイロードタイプ。現在はJSON形式のみがサポートされています。 |
タイプ | サイズ | コメント |
---|---|---|
バイト | 4 | 現在のペイロードのサイズ(バイト単位) |
タイプ | サイズ | コメント |
---|---|---|
バイト | サイズフィールドで定義される | JSON形式のデータ |
これらのパラメータはすべてのリクエスト/レスポンスに存在します。
名前 | タイプ | コメント |
---|---|---|
id | uint32 | リクエストの場合 - リクエストとレスポンスを関連付けるために使用される増分識別子。リクエスト方向(エージェントからプラグイン、またはプラグインからエージェント)内で一意です。 レスポンスの場合 - 対応するリクエストのID |
type | uint32 | リクエストタイプ |
プラグインからエージェントのログファイルにログメッセージを書き込むために送信されるリクエスト
direction | plugin → agent |
response | no |
ログリクエスト固有のパラメータ:
Name | Type | Comments |
---|---|---|
severity | uint32 | メッセージの重要度(ログレベル) |
message | string | ログに記録するメッセージ |
例:
エージェント起動フェーズ中に、プラグインを登録するためのメトリクスを取得するためにエージェントから送信されるリクエスト
direction | agent → plugin |
response | yes |
登録リクエスト固有のパラメータ:
Name | Type | Comments |
---|---|---|
version | string | プロトコルバージョン <major>.<minor> |
例:
登録リクエストに対するプラグインのレスポンス
direction | plugin → agent |
response | n/a |
登録レスポンスに固有のパラメータ:
Name | Type | Comments |
---|---|---|
name | string | プラグイン名 |
metrics | 文字列の配列 (オプション) | プラグインで使用される説明付きのメトリクス。RegisterMetrics() を返します。エラーが返された場合は省略されます。 |
interfaces | uint32 (オプション) | プラグインでサポートされているインターフェースのビットマスク。エラーが返された場合は省略されます。 |
error | string (オプション) | プラグインを起動できない場合に返されるエラーメッセージ。メトリクスが返された場合は省略されます。 |
例:
{"id":2,"type":3,"metrics":["external.test", "External exporter Test."], "interfaces": 4}
または
{"id":2,"type":3,"error":"error message"}
ランナーインターフェースの Start 関数を実行するためのリクエスト
direction | agent → plugin |
response | no |
このリクエストには特定のパラメーターはなく、共通データパラメーターのみが含まれます。
Example:
プラグインをシャットダウンするためにエージェントから送信されるリクエスト
direction | agent → plugin |
response | no |
このリクエストには特定のパラメータはなく、共通データパラメータのみが含まれます。
例:
A request to execute the Export function of the Exporter interface.
direction | agent → plugin |
response | no |
Parameters specific to export requests:
Name | Type | Comments |
---|---|---|
key | string | The plugin key. |
parameters | array of strings (optional) | The parameters for Export function. |
Example:
Response from the Export function of the Exporter interface.
direction | plugin → agent |
response | n/a |
Parameters specific to export responses:
Name | Type | Comments |
---|---|---|
value | string (optional) | Response value from the Export function. Absent, if error is returned. |
error | string (optional) | Error message if the Export function has not been executed successfully. Absent, if value is returned. |
Examples:
or
Configurator インターフェースの Configure 機能を実行するためのリクエスト
direction | agent → plugin |
response | n/a |
Configure リクエスト固有のパラメーター:
名前 | タイプ | コメント |
---|---|---|
global_options | JSON オブジェクト | グローバルエージェント構成オプションを含む JSON オブジェクト |
private_options | JSON オブジェクト (オプション) | プライベートプラグイン構成オプション (指定されている場合) を含む JSON オブジェクト |
例:
Configurator インターフェースの Validate 関数を実行するためのリクエスト
direction | agent → plugin |
response | yes |
Validate リクエスト固有のパラメーター:
Name | Type | Comments |
---|---|---|
private_options | JSON オブジェクト (オプション) | プライベートプラグイン設定オプション (指定されている場合) を含む JSON オブジェクト |
例:
Response from Validate function of Configurator interface.
direction | plugin → agent |
response | n/a |
Parameters specific to Validate responses:
Name | Type | Comments |
---|---|---|
error | string (optional) | An error message returned if the Validate function is not executed successfully. Absent if executed successfully. |
Example:
or