差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:technical_reference:02_annex_externalapi [2025/09/12 23:05] – [set create_module_policy_json] junichija:documentation:pandorafms:technical_reference:02_annex_externalapi [2026/02/04 08:11] (現在) – [bearer トークンによる認証] junichi
行 111: 行 111:
   * <wrap :en>**Users**</wrap>: For [[en:documentation:pandorafms:management_and_operation:11_managing_and_administration#ks1_1|manage PFMS users]].   * <wrap :en>**Users**</wrap>: For [[en:documentation:pandorafms:management_and_operation:11_managing_and_administration#ks1_1|manage PFMS users]].
   * <wrap :en>**PandoraITSM**</wrap>:  To manage the [[en:documentation:pandorafms:management_and_operation:04_inventory|inventory]] provided by [[en:documentation:10_pandora_itsm:20_pandora_itsm_pandorafms|Pandora ITSM]] to PFMS.   * <wrap :en>**PandoraITSM**</wrap>:  To manage the [[en:documentation:pandorafms:management_and_operation:04_inventory|inventory]] provided by [[en:documentation:10_pandora_itsm:20_pandora_itsm_pandorafms|Pandora ITSM]] to PFMS.
 +  * <wrap :en>**API Endpoints of SIEM (Security Information and Event Management)**</wrap>: To execute [[:en:documentation:pandorafms:cybersecurity:21_siem|actions and configurations in SIEM]].
 +  * <wrap :en>**MONITORING API Endpoints for add data modules**</wrap>: Starting with version 785, new endpoint for [[#ks1_8|adding module data to Pandora FMS]].
  
   * <wrap :ja>**認証(Authentication)**</wrap>: API アクセス トークンを管理します (最初のトークンは常に [[#ks1_3|Web コンソール経由で]] 生成します)。   * <wrap :ja>**認証(Authentication)**</wrap>: API アクセス トークンを管理します (最初のトークンは常に [[#ks1_3|Web コンソール経由で]] 生成します)。
行 119: 行 121:
   * <wrap :ja>**ユーザ(Users)**</wrap>: [[ja:documentation:pandorafms:management_and_operation:11_managing_and_administration#ks1_1|PFMS ユーザを管理します]]。   * <wrap :ja>**ユーザ(Users)**</wrap>: [[ja:documentation:pandorafms:management_and_operation:11_managing_and_administration#ks1_1|PFMS ユーザを管理します]]。
   * <wrap :en>**PandoraITSM**</wrap>: [[en:documentation:10_pandora_itsm:20_pandora_itsm_pandorafms|Pandora ITSM]] によって PFMS に提供される [[ja:documentation:pandorafms:management_and_operation:04_inventory|インベントリ]] を管理します。   * <wrap :en>**PandoraITSM**</wrap>: [[en:documentation:10_pandora_itsm:20_pandora_itsm_pandorafms|Pandora ITSM]] によって PFMS に提供される [[ja:documentation:pandorafms:management_and_operation:04_inventory|インベントリ]] を管理します。
 +  * <wrap :ja>**SIEM (セキュリティ情報イベント管理) の API エンドポイント**</wrap>: [[:ja:documentation:pandorafms:cybersecurity:21_siem|SIEM のアクションと設定]] を実行します。
 +  * <wrap :ja>**データモジュール追加用の監視 API エンドポイント**</wrap>: バージョン 785 以降、[[#ks1_8|Pandora FMS にモジュールデータを追加]] するための新しいエンドポイントが追加されました。
  
 <wrap #ks1_5 /> <wrap #ks1_5 />
行 197: 行 201:
 <WRAP center round tip 90%> <WRAP center round tip 90%>
  
-In this schema, the mandatory parameters have the property set to ''nullable: false''.+In this schema, the required parameters have the property set to ''nullable: false''.
  
 </WRAP> </WRAP>
行 227: 行 231:
  
 {{  wiki:pfms-api_2-ping.png  }} {{  wiki:pfms-api_2-ping.png  }}
 +
 +<wrap #ks1_8 />
 +
 +==== モジュールデータを追加するための API エンドポイント ====
 +
 +Starting with version 785, and as an alternative to [[:en:documentation:pandorafms:technical_reference:09_tentacle|the Tentacle protocol]], there is an option to send checks through PFMS API 2.0.
 +
 +バージョン 785 以降では、[[:ja:documentation:pandorafms:technical_reference:09_tentacle|Tentacle プロトコル]] の代替として、PFMS API 2.0 を介して監視データを送信するオプションがあります。
 +
 +All documentation may be checked using the [[#ks1_6|Documentation outline]], which describes the general and most important features here:
 +
 +すべてのドキュメントは、[[#ks1_6|ドキュメントの概要]] を使用して確認できます。ここでは、一般的な機能と最も重要な機能について説明します。
 +
 +  * The body consists of an array of agents with their corresponding modules.
 +  * If the agent does not exist, a new one will be created; if it already exists, it will be updated.
 +  * Each position in the array contains the same modules processed by the [[:en:documentation:pandorafms:introduction:02_architecture#data_server|Data Server]], respecting exactly the same fields. **Therefore, any field used in the Data Server may be used here.**
 +  * Data that may be sent in the API:
 +
 +  * 本体は、エージェントとそれに対応するモジュールの配列で構成されます。
 +  * エージェントが存在しない場合は新規に作成され、既に存在する場合は更新されます。
 +  * 配列内の各位置には、[[:ja:documentation:pandorafms:introduction:02_architecture#data_server|データサーバ]] で処理されるモジュールと同じモジュールが含まれ、同じフィールドが保持されます。**したがって、データサーバで使用されるフィールドはすべてここで使用できます。**
 +  * API で送信できるデータ:
 +
 +^  Command  ^  Description  ^
 +|  ''agent_data''  |Agent data, such as name, operating system ID, operating system version, update interval, address, and description.  |
 +|  ''module_data''  |Array of modules with their name, type, and data. You may also specify a dataList to add multiple data values at once.  |
 +|  ''inventory_data''  |Agent inventory data.  |
 +|  ''log_data''  |Agent log data.  |
 +|  ''trap_data''  |SNMP trap data from the agent.  |
 +|  ''events''  |Event in base64.  |
 +|  ''discovery_data''  |Agent discovery data in base64.  |
 +|  ''cmd_data''  |Agent command data.  |
 +
 +^  コマンド  ^  説明  ^
 +|  ''agent_data''  |名前、オペレーティングシステム ID、オペレーティングシステムのバージョン、更新間隔、アドレス、説明などのエージェントデータ。  |
 +|  ''module_data''  |モジュールの名前、タイプ、データを含む配列。dataList を指定して複数のデータ値を一度に追加することもできます。  |
 +|  ''inventory_data''  |エージェントインベントリデータ。  |
 +|  ''log_data''  |エージェントログデータ。  |
 +|  ''trap_data''  |エージェントからの SNMP トラップデータ。  |
 +|  ''events''  |base64 でのイベント。  |
 +|  ''discovery_data''  |base64 でのエージェント自動検出データ。  |
 +|  ''cmd_data''  |エージェントコマンドデータ。  |
  
 <wrap #ks2 /> <wrap #ks2 />
行 310: 行 356:
 === アクセス元による === === アクセス元による ===
  
-At the moment, security is based on an IP addresses list that will have [[:es:documentation:04_using:12_console_setup#general_setup|access to the tool]].+At the moment, security is based on an IP addresses list that will have [[:en:documentation:pandorafms:management_and_operation:12_console_setup#ks1_1|access to the tool]].
  
-現時点では、セキュリティは[[:ja:documentation:04_using:12_console_setup#一般設定|アクセスする IP アドレスリスト]]に基づいています。+現時点では、セキュリティは[[:ja:documentation:pandorafms:management_and_operation:12_console_setup#ks1_1|アクセスする IP アドレスリスト]]に基づいています。
  
 {{  :wiki:screnshot_of_api_acl_list_setup.png  }} {{  :wiki:screnshot_of_api_acl_list_setup.png  }}
行 397: 行 443:
 ==== API チェッカー ==== ==== API チェッカー ====
  
-Access from the Administration menu: **Admin tools** → **API checker**.+<WRAP left round box 50%>
  
-管理メニューの **管理ツール(Admin tools)** → **API チェッカー(API checker)** からアクセスします。+<wrap :en>**Management → {{:wiki:pfms-management-admin_tools-icon.svg?nolink&21x21}} Admin tools → API checker**</wrap> menu.
  
-{{  :wiki:pfms-admin_tools-api_checker.png  }}+</WRAP> 
 +\\ \\ \\ \\ \\ 
  
-{{  :wiki:pfms-admin_tools-api_checker-credentials.png  }}+<WRAP left round box 50%>
  
-<WRAP center round info 60%>+<wrap :ja>**管理(Management) → {{:wiki:pfms-management-admin_tools-icon.svg?nolink&21x21}} 管理ツール(Admin tools) → APIチェッカー(API checker)**</wrap> メニュー。
  
-**Version 768 or later**: You can authenticate with **API Token** by sending in the [[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers|HTTP headers]] a [[https://www.rfc-editor.org/rfc/rfc6750#page-3|bearer token]] generated by each user and for their own private and particular use. See "[[:en:documentation:04_using:11_managing_and_administration#user_edition_by_the_user_itself|Edit my user]]" for more details.+</WRAP> 
 +\\ \\ \\ \\ \\ 
  
-</WRAP>\\+{{  :wiki:pfms-admin_tools-api_checker_2.png  }}
  
-<WRAP center round info 60%>+  * <wrap :en>**Credentials**</wrap>:
  
-**バージョン 768 以降**: [[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers|HTTP ヘッダー]] で各ユーザによって個別に生成され [[https://www.rfc-editor.org/rfc/rfc6750#page-3|bearer トークン]] を送信することにより、**API トークン** で認証することができます。+  <wrap :ja>**資格情報**</wrap>: 
 + 
 +<WRAP center round info 90%> 
 + 
 +The <wrap :en>**API password**</wrap>, <wrap :en>**User**</wrap>, and <wrap :en>**Password**</wrap> fields are used to query using user credentials. Starting from PFMS version 768, it is recommended to authenticate using <wrap :en>**API Token**</wrap>, which is sent in the [[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers|HTTP headers]] as a //[[https://www.rfc-editor.org/rfc/rfc6750#page-3|bearer token]]// generated by each user for their own private and individual use. See “[[:en:documentation:pandorafms:management_and_operation:11_managing_and_administration#ks1_1_1|Edit my user]]” for more details.
  
 </WRAP> </WRAP>
  
-{{  :wiki:pfms-admin_tools-api_checker-call_parameters.png  }}+<WRAP center round info 90%> 
 + 
 +<wrap :ja>**API パスワード(API password)**</wrap>、<wrap :ja>**ユーザ(User)**</wrap>、および <wrap :ja>**パスワード(Password)**</wrap> フィールドは、ユーザ認証情報を使用してクエリを実行するために使用されます。PFMS バージョン 768 以降では、<wrap :ja>**API トークン(API Token)**</wrap> を使用して認証することが推奨されています。API トークンは、各ユーザが自身のプライベートおよび個人使用のために生成する //[[https://www.rfc-editor.org/rfc/rfc6750#page-3|ベアラートークン]]// として [[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers|HTTP ヘッダー]] で送信されます。詳細については、「[[:ja:documentation:pandorafms:management_and_operation:11_managing_and_administration#ks1_1_1|ユーザの編集]]」を参照してください。 
 + 
 +</WRAP> 
 + 
 +The IP address defaults to ''127.0.0.1''. If you want to query using the real IP address of the PFMS Server, you must take into account the [[#ks2_1_1|allowed IP addresses]]. 
 + 
 +IPアドレスのデフォルトは ''127.0.0.1'' です。PFMS サーバの実際の IP アドレスを使用してクエリを実行する場合は、[[#ks2_1_1|許可されたIPアドレス]]を考慮する必要があります。 
 + 
 +{{  :wiki:pfms-admin_tools-api_checker-credentials_2.png  }} 
 + 
 +  * <wrap :en>**Call parameters**</wrap>: 
 + 
 +  * <wrap :ja>**呼び出しパラメータ(Call parameters)**</wrap>: 
 + 
 +See the [[#ks2|query syntax]]. 
 + 
 +[[#ks2|クエリ書式]]を参照してください。 
 + 
 +{{  :wiki:pfms-admin_tools-api_checker-call_parameters_2.png  }} 
 + 
 +  * <wrap :en>**Custom URL**</wrap>: 
 + 
 +  * <wrap :ja>**カスタム URL(Custom URL)**</wrap>: 
 + 
 +It will display the URL of the query performed. Although it allows editing, the changes will not be applied if the <wrap :en>**Call**</wrap> button is pressed. 
 + 
 +実行されたクエリの URL が表示されます。編集は可能ですが、<wrap :ja>**呼び出し(Call)**</wrap>ボタンを押しても変更は適用されません。 
 + 
 +{{  :wiki:pfms-admin_tools-api_checker-custom_url_2.png  }} 
 + 
 +  * <wrap :en>**Result**</wrap>: 
 + 
 +Returns the result of the query. If an ''auth error'' is obtained, you should review [[#ks2_1_5|the parameters and conditions]]. 
 + 
 +クエリの結果を返します。「認証エラー(auth error)」が発生した場合は、[[#ks2_1_5|パラメータと条件]]を確認してください。 
 + 
 +{{  :wiki:pfms-admin_tools-api_checker-result_2.png  }}
  
-{{  :wiki:pfms-admin_tools-api_checker-custom_url.png  }}+<wrap #ks2_3 />
  
 ==== セキュリティ処理の流れ ==== ==== セキュリティ処理の流れ ====
行 428: 行 518:
  
   * [[:en:documentation:08_technical_reference:02_annex_externalapi#by_origin|Filtering by IP address]]: Only the listed IP addresses will be able to access the API.   * [[:en:documentation:08_technical_reference:02_annex_externalapi#by_origin|Filtering by IP address]]: Only the listed IP addresses will be able to access the API.
-  * [[:en:documentation:08_technical_reference:02_annex_externalapi#by_api_password|Global password for the API]]: If defined, it is mandatory to use it in all calls.+  * [[:en:documentation:08_technical_reference:02_annex_externalapi#by_api_password|Global password for the API]]: If defined, it is required to use it in all calls.
   * [[:en:documentation:08_technical_reference:02_annex_externalapi#by_user_credentials|User and password]]: User of type [[:en:documentation:01_understanding:03_glossary#superadmin|superadmin]] and valid in the Web Console. Your permissions will be used for each requested operation. **From version NG 768 onwards**  it is also possible to access by [[:en:documentation:08_technical_reference:02_annex_externalapi#authentication_by_bearer_token|bearer token]].   * [[:en:documentation:08_technical_reference:02_annex_externalapi#by_user_credentials|User and password]]: User of type [[:en:documentation:01_understanding:03_glossary#superadmin|superadmin]] and valid in the Web Console. Your permissions will be used for each requested operation. **From version NG 768 onwards**  it is also possible to access by [[:en:documentation:08_technical_reference:02_annex_externalapi#authentication_by_bearer_token|bearer token]].
  
行 519: 行 609:
  
   * 接続をデバッグする場合は、''-v'' パラメータを利用します。(バージョンを表示する ''-V'' と混同しないでください。)   * 接続をデバッグする場合は、''-v'' パラメータを利用します。(バージョンを表示する ''-V'' と混同しないでください。)
 +
 +<wrap #ks2_4_2 />
  
 === 情報取得 === === 情報取得 ===
行 4524: 行 4616:
  
   * op=set (required)   * op=set (required)
-  * op2=add_agent_policy_by_id (mandatory)+  * op2=add_agent_policy_by_id (required)
   * id=<id_policy> (required). It must be a policy Id.   * id=<id_policy> (required). It must be a policy Id.
   * other=<serialized parameters> (required). These are agent configuration and data, serialized in the following order:   * other=<serialized parameters> (required). These are agent configuration and data, serialized in the following order:
行 8459: 行 8551:
  
 { {
-name: <value>, // mandatory +name: <value>, // required 
-id_module: <value>, // mandatory +id_module: <value>, // required 
-id_tipo_modulo: <value>, // mandatory+id_tipo_modulo: <value>, // required
 configuration_data: <value>, configuration_data: <value>,
 description: <value>, description: <value>,
  • ja/documentation/pandorafms/technical_reference/02_annex_externalapi.1757718348.txt.gz
  • 最終更新: 2025/09/12 23:05
  • by junichi