差分

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

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:technical_reference:02_annex_externalapi [2024/11/09 23:22] – [get special_days] junichija:documentation:pandorafms:technical_reference:02_annex_externalapi [2026/06/06 23:13] (現在) – [set create_alerts_policy] 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 />
行 166: 行 170:
 <WRAP center round info 90%> <WRAP center round info 90%>
  
-Through the [[#ks1_4|web interface]] you can generate and copy the necessary codes, with their parameters and mandatory fields, of all the commands of this PFMS API 2.0. See [[#ks1_6|schemas]] for more details.+Through the [[#ks1_4|web interface]] you can generate and copy the necessary codes, with their parameters and required fields, of all the commands of this PFMS API 2.0. See [[#ks1_6|schemas]] for more details.
  
 </WRAP> </WRAP>
行 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 />
  
 === 情報取得 === === 情報取得 ===
行 926: 行 1018:
 == get locate_agent == == get locate_agent ==
  
-エージェントが存在するサーバ ID を取得し、すべての結果を csv で出力します。+<WRAP center round info 90%>
  
-書式:+This command only works in [[:en:documentation:pandorafms:command_center:01_introduction|Command Center]].
  
-  * op=get (必須) +</WRAP>
-  * op2=locate_agent (必須) +
-  * return_type=<csv(必須) 出力フォーマット +
-  * id=id_agent (必須) +
-  * other_mode=other_mode=url_encode_separator_<separator> (必須)+
  
-**例**+<WRAP center round info 90%>
  
-<code+このコマンドは [[:ja:documentation:pandorafms:command_center:01_introduction|コマンドセンター]] でのみ動作します。 
-http://127.0.0.1/pandora_console/include/api.php?op=get&op2=locate_agent&return_type=csv&apipass=1234&user=admin&pass=pandora&id=Pepito&other_mode=url_encode_separator_%7C+ 
 +</WRAP
 + 
 +Gets the ID of the server where the agent is located, and prints the whole result as a CSV file. You can search by both name and agent ID. 
 + 
 +エージェントが存在するサーバの ID を取得し、結果全体をCSVファイルとして出力します。名前とエージェント ID の両方で検索できます。 
 + 
 +**[[#ks2|Call syntax]]**: 
 + 
 +**[[#ks2|書式]]**: 
 + 
 +  * ''op=get'' (required). 
 +  * ''op2=locate_agent'' (required). 
 +  * ''return_type=csv'' (required) Output format. 
 +  * ''id='' id_agent or agent_name (required) 
 +  * ''other_mode=other_mode=url_encode_separator_''< separator > (required) 
 + 
 +  * ''op=get'' (必須) 
 +  * ''op2=locate_agent'' (必須) 
 +  * ''return_type=csv'' (必須) 出力フォーマット 
 +  * ''id='' エージェント ID もしくはエージェント名(必須) 
 +  * ''other_mode=other_mode=url_encode_separator_'' < separator > (必須) 
 + 
 +**Example (see [[#ks2|call syntax]])**: 
 + 
 +**例 ([[#ks2|書式]]を参照)**: 
 + 
 +<code bash> 
 +/include/api.php?op=get&op2=locate_agent&return_type=csv&apipass=1234&user=admin&pass=pandora&id=MySQLagent&other_mode=url_encode_separator_|
  
 </code> </code>
行 2919: 行 3035:
 パラメータで渡したデータで、エージェントを更新します。 パラメータで渡したデータで、エージェントを更新します。
  
-書式:+[[#ks2|Call syntax]]: 
 + 
 +[[#ks2|書式]]:
  
-  * ''op=set'' (required)+  * ''op=set'' (required) 
   * ''op2=update_agent'' (required)   * ''op2=update_agent'' (required)
   * ''id=''<id_agent> (required)   * ''id=''<id_agent> (required)
-  * ''other=''<serialized parameters> (required). They are agent configuration and data, serialized in the following order: +  * ''other=''<serialized parameters> (required). They are agent configuration and data, serialized in the following order:  
-    <agent_alias> + 
-    <ip_address> +  - <agent_alias> 
-    <id_parent> +  <ip_address> 
-    <id_group> +  <id_parent> 
-    <cascade_protection> +  <id_group> 
-    <cascade_protection_module> +  <cascade_protection> 
-    <interval_sec> +  <cascade_protection_module> 
-    <id_os> +  <interval_sec> 
-    <name_server> +  <id_os> 
-    <custom_id> +  <name_server> 
-    <learning_mode> +  <custom_id> 
-    <disabled> +  <learning_mode> 
-    <description> +  <disabled> 
-    <os_version>+  <description> 
 +  <os_version>
  
   * ''op=set'' (必須)   * ''op=set'' (必須)
行 2944: 行 3063:
   * ''id=''<エージェントID> (必須)   * ''id=''<エージェントID> (必須)
   * ''other=''<連続パラメータ> (必須) エージェントの設定データで次の順番で設定します。   * ''other=''<連続パラメータ> (必須) エージェントの設定データで次の順番で設定します。
-      * <エージェントの別名> 
-      * <ipアドレス> 
-      * <親ID> 
-      * <グループID> 
-      * <関連障害検知抑制> 
-      * <関連障害検知抑制モジュール> 
-      * <間隔(秒)> 
-      * <OSのID> 
-      * <サーバ名> 
-      * <カスタムID> 
-      * <学習モード> 
-      * <無効化> 
-      * <説明> 
-      * <OSバージョン> 
  
-**Example (see [[:en:documentation:08_technical_reference:02_annex_externalapi#pandora_fms_external_api|call syntax]]**):+  - <エージェントの別名> 
 +  - <ipアドレス> 
 +  - <親ID> 
 +  - <グループID> 
 +  - <関連障害検知抑制> 
 +  - <関連障害検知抑制モジュール> 
 +  - <間隔()
 +  - <OSのID> 
 +  - <サーバ名> 
 +  - <カスタムID> 
 +  - <学習モード> 
 +  - <無効化> 
 +  - <説明> 
 +  - <OSバージョン>
  
-**例 ([[:ja:documentation:08_technical_reference:02_annex_externalapi#外部_api書式]]を参照):**+**Example (see [[#ks2|call syntax]]**):
  
-<code bash> +**例 ([[#ks2|書式]]を参照):**
-.../include/api.php?op=set&op2=update_agent&id=5&other=agent_name%7C1.1.1.1%7C0%7C4%7C0%7C0%7C30%7C8%7Clocalhost.localdomain%7C%7C0%7C0%7Cla%20description|Ubuntu&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora+
  
 +<code bash>
 +.../include/api.php?op=set&op2=update_agent&id=5&other=agent_name%7C1.1.1.1%7C0%7C4%7C0%7C0%7C30%7C8%7Clocalhost.localdomain%7C%7C0%7C0%7Cla%20description|Ubuntu&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora 
 </code> </code>
  
 == set update_agent_field == == set update_agent_field ==
  
-This call updates the field(s) of one or more Agents (the latter if it uses aliases and there are several matching ones.+Updates one or more fields of an agent (or multiple agents if ''agent_alias'' is used) with the data passed as parameters.
  
-この呼び出しは、1つもしくは、(別名を利用し一致するエージェントが複数ある場合は) 複数のエージェントのフィールドを更新します。+1つもしくは、(''agent_alias'' を利用し一致するエージェントが複数ある場合は) 複数のエージェントのフィールドを更新します。
  
-Call syntax:+[[#ks2|Call syntax]]: 
 + 
 +[[#ks2|書式]]:
  
   * op=set (required)   * op=set (required)
行 2995: 行 3116:
   * <disabled>   * <disabled>
   * <description>   * <description>
- 
-書式: 
  
   * op=set (必須)   * op=set (必須)
-  * op2=update_agent (必須)+  * op2=update_agent_field (必須)
   * id=<id_agent> or <alias> (必須), <alias> id2 パラメータに依存します。   * id=<id_agent> or <alias> (必須), <alias> id2 パラメータに依存します。
   * id2= <id_agente> の場合 0 (オプション), <alias> の場合 1 (必須)   * id2= <id_agente> の場合 0 (オプション), <alias> の場合 1 (必須)
行 3024: 行 3143:
 エージェント名を利用する場合: エージェント名を利用する場合:
  
-<code> +<code bash
-http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_agent_field&id=1&other=id_os,1|alias,pandora|direccion,192.168.10.16|id_parent,1cascade_protection,1|cascade_protection_module,1|intervalo,5||modo|3|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora +.../include/api.php?op=set&op2=update_agent_field&id=3&other=id_os,1|direccion,192.168.10.15|id_parent,2|cascade_protection,1|cascade_protection_module,40|intervalo,5||modo|3|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
 </code> </code>
  
行 3032: 行 3150:
  
 別名を利用する場合。別名を含む全エージェントを編集します: 別名を利用する場合。別名を含む全エージェントを編集します:
 +
 <code> <code>
- +.../include/api.php?op=set&op2=update_agent_field&id=pandora&id2=1&other=id_os,1|alias,pandora|direccion,192.168.10.16|id_parent,1cascade_protection,1|cascade_protection_module,1|intervalo,5||modo|3|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
-http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_agent_field&id=pandora&id2=1&other=id_os,1|alias,pandora|direccion,192.168.10.16|id_parent,1cascade_protection,1|cascade_protection_module,1|intervalo,5||modo|3|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora +
 </code> </code>
- 
  
 == set delete_agent == == set delete_agent ==
行 3204: 行 3320:
   * ''op=set'' (required).   * ''op=set'' (required).
   * ''op2=create_plugin_module'' (required).   * ''op2=create_plugin_module'' (required).
-  * ''id=''< agent_name > (required). It should be an agent name.+  * ''id=''< agent_name > (required) it should be an agent name.
   * ''other=''< serialized parameters > (required). They are module configuration and data, serialized in the following order:   * ''other=''< serialized parameters > (required). They are module configuration and data, serialized in the following order:
  
行 3295: 行 3411:
  
 例 ([[#pandora_fms_外部_api|書式を参照]]): 例 ([[#pandora_fms_外部_api|書式を参照]]):
 +
 +  * Example without macro:
 +
 +  * マクロ無しの例:
 +
 +<code bash>
 +…/include/api.php?op=set&op2=create_plugin_module&id=pandora.internals&other=module_plugin_test_|0|1|2|0|0||0|0||0|0|127.0.0.1|0||0|300|0|0|0|0|plugin%20module%20from%20api|4|2|admin|pass|-p%20max||||||||||||2001&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
 +
 +</code>
 +
 +  * Example with macro:
 +
 +  * マクロありの例
 +
 +To use the **DNS plugin** that is installed by default in PFMS (**Management → Servers → Plugins** menu ) and whose identifier is ''2'', the **dig** tool (included in **dnsutils**) must be installed in the PFMS server and **//connected to the internet//**.
 +
 +PFMS にデフォルトでインストールされ (**管理(Management) → サーバ(Servers) → プラグイン(Plugins)** メニュー)、識別子が ''2'' である **DNS プラグイン** を使用するには、**dig** ツール (**dnsutils** に含まれています) を PFMS サーバにインストールし、**//インターネットに接続//** する必要があります。
 +
 +It can be tested by executing in a command terminal on the PFMS server the following statement (it should return ''1'' for a successful result, ''0'' if domain/address is not matched and ''-1'' for any error that prevents it from working):
 +
 +これは、PFMS サーバのコマンドターミナルで次のステートメントを実行することによってテストできます (成功した場合は ''1''、ドメイン/アドレスが一致しない場合は ''0''、動作を妨げるエラーの場合は ''-1'' が返されます)。
  
 <code bash> <code bash>
-/include/api.php?op=set&op2=create_plugin_module&id=example&other=prueba|0|1|2|0|0||0|0||0|0|127.0.0.1|0||0|300|0|0|0|0|plugin%20module%20from%20api|4|2|admin|pass|-p%20max&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora+/usr/share/pandora_server/util/plugin/dns_plugin.sh -d pandorafms.com -i 172.66.40.150 -s 8.8.8.8
  
 </code> </code>
行 3305: 行 3442:
 JSON ドキュメントの内容は、次のプロパティを持つ複数のオブジェクトで構成されるオ ブジェクトである必要があります。 JSON ドキュメントの内容は、次のプロパティを持つ複数のオブジェクトで構成されるオ ブジェクトである必要があります。
  
-  * ''macro'': Macro nameIt should be //_field1_//, //_field2_//, …, //_fieldN_//+  * ''macro'': Name of the macroMust be //_field1_//, //_field2_//, …, //_fieldN_//
-  * ''desc'': Descriptive macro name. +  * ''desc'': Descriptive name of the macro
-  * ''help'': Macro description.+  * ''help'': Macro detailed description.
   * ''value'': Macro value.   * ''value'': Macro value.
-  * ''hide'': Set to ''1''  to hide the macro value (useful for storing passwords).+  * ''hide'': Set to ''1'' to hide the macro value (useful for storing passwords).
  
   * ''macro'': マクロ名。//_field1_//, //_field2_//, …, //_fieldN_// である必要があります。   * ''macro'': マクロ名。//_field1_//, //_field2_//, …, //_fieldN_// である必要があります。
行 3317: 行 3454:
   * ''hide'': マクロ値を非表示にするには、''1'' に設定します (パスワードの保存に役立ちます)。   * ''hide'': マクロ値を非表示にするには、''1'' に設定します (パスワードの保存に役立ちます)。
  
-Example:+For this example it will be verified that the domain ''pandorafms.com'' uses at least one IP address ''172.66.40.150'':
  
-+このでは、ドメイン ''pandorafms.com'' が少なくとも 1 つの IP アドレス ''172.66.40.150'' を使用していることが検証されます。
- +
-<file>+
  
 +<file | plugin_fields.json>
 { {
- "1":+    "1":
-   "macro": "_field1_", +        "macro": "_field1_", 
-   "desc": "Target IP", +        "desc": "Target IP", 
-   "help": "", +        "help": "", 
-   "value": "192.168.0.1", +        "value": "172.66.40.150" 
-   "hide": "" +    }
- }, +    "2": 
- "2": { +        "macro": "_field2_", 
-   "macro": "_field2_", +        "desc": "Domain to check", 
-   "desc": "Port", +        "help": "For example pandorafms.com", 
-   "help": "", +        "value": "pandorafms.com
-   "value": "80", +    }, 
-   "hide": "" +    "3": { 
- }+        "macro": "_field3_", 
 +        "desc": "DNS Server to check", 
 +        "help": "For example 8.8.8.8", 
 +        "value": "8.8.8.8" 
 +    }
 +    "4": { 
 +        "macro": "_field4_", 
 +        "desc": "Optional parameters", 
 +        "help": "", 
 +        "value": "" 
 +    }
 } }
- 
 </file> </file>
 +
 +The previous file must be converted to base 64 with:
 +
 +前のファイルは次のようにして Base 64 に変換する必要があります。
 +
 +<code bash>
 +PLUGIN_FIELDS=$(base64 plugin_fields.json -w 0)
 +
 +</code>
 +
 +And the previous variable should be used in a complete URL to add a module in the default agent, ''pandora.internals'', in the module group ''Networking'' and with critical inverse to ''0'':
 +
 +また、前の変数は、完全な URL で使用して、デフォルトエージェントのモジュール ''pandora.internals'' をモジュールグループ ''Networking'' に追加し、障害値を ''0'' に反転する必要があります。
 +
 +<code bash>
 +curl '…/include/api.php?op=set&op2=create_plugin_module&id=pandora.internals&other=dns_module||2|2||||1|||||pandorafms.com|0||0|300|0|0|0|0|dns_plugin|2|||||'$PLUGIN_FIELDS'|W10=|||||1|||||&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora'
 +
 +</code>
  
 == set create_data_module == == set create_data_module ==
行 3834: 行 3997:
   - < min >   - < min >
   - < max >   - < max >
-  - < post_process > ( {{:wiki:icono-modulo-enterprise.png?23x23|Enterprise version}}only for [[:en:documentation:pandorafms:installation:05_configuration_agents#module_postprocess|Software Agents]] with remote configuration enabled).+  - < post_process > ( Only for [[:en:documentation:pandorafms:installation:05_configuration_agents#module_postprocess|EndPoints]] with remote configuration enabled).
   - < [[:en:documentation:pandorafms:installation:05_configuration_agents#module_interval|module_interval]] >   - < [[:en:documentation:pandorafms:installation:05_configuration_agents#module_interval|module_interval]] >
   - < min_warning >   - < min_warning >
行 3867: 行 4030:
   - < 最小 >   - < 最小 >
   - < 最大 >   - < 最大 >
-  - < 保存倍率 > ( {{:wiki:icono-modulo-enterprise.png?23x23|Enterprise 版}}([[:ja:documentation:pandorafms:installation:05_configuration_agents#module_postprocess|ソフトウエアージェント]] でリモート設定が有効な場合のみ)+  - < 保存倍率 > ([[:ja:documentation:pandorafms:installation:05_configuration_agents#module_postprocess|エンドポイント]] でリモート設定が有効な場合のみ)
   - < [[:ja:documentation:pandorafms:installation:05_configuration_agents#module_interval|モジュールの間隔]] >   - < [[:ja:documentation:pandorafms:installation:05_configuration_agents#module_interval|モジュールの間隔]] >
   - < 警告の最小値 >   - < 警告の最小値 >
行 4453: 行 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:
行 7485: 行 7648:
 == set create_alerts_policy == == set create_alerts_policy ==
  
->= 7.0. 725+To create standard or external alerts in a monitoring policy.
  
-ポリシーアラートを作成します。+監視ポリシーで標準アラートまたは外部アラートを作成します。
  
-  * 存在するポリシー ID を指定する必要があります。 +[[#ks2|Call syntax]]:
-  * 通常のタイプの場合、ポリシーモジュールIDを指定する必要があります。 +
-  * 存在するテンプレートIDを指定する必要があります。 +
-  * 外部かどうかを 0(通常)、1(外部) で設定します。デフォルトは、通常の 0 です。 +
-  * 外部タイプ(1) の場合は、名前を指定する必要があります。+
  
-0(失敗) または、ポリシーに追加したアラートID(成功) を返します。+[[#ks2|書式]]:
  
-書式:+**To create [[:en:documentation:pandorafms:complex_environments_and_optimization:02_policy#ks4_6|standard alerts]]**:
  
-  op=set +**[[:ja:documentation:pandorafms:complex_environments_and_optimization:02_policy#ks4_6|標準アラート]]を作成するには**
-  op2=create_alerts_policy +
-  * id=ポリシーID +
-  * id2=ポリシーモジュールID +
-  * other=ポリシーモジュールID|テンプレートID|0 または 1|モジュール名 +
-  other_mode=url_encode_separator_| +
-  return_type=(string, csv, json).+
  
-**** +  ''op=set'' (required). 
-<code>+  ''op2=create_alerts_policy'' (required). 
 +  ''id='' A policy identifier that must exist (required). 
 +  ''return_type'' Output format (optional): STRING, CSV o JSON. 
 +  * ''other_mode=url_encode_separator_|''
 +  * ''other='' With the following fields properly delimited:
  
-http://localhost/pandora_console/include/api.php?op=set&op2=create_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=2&other=0|2|1|cpu%20load&other_mode=url_encode_separator_|+  * ''op=set'' (必須)。 
 +  * ''op2=create_alerts_policy'' (必須)。 
 +  * ''id='' ポリシー識別子 (必須)。 
 +  * ''return_type'' 出力形式 (オプション):STRING、CSV、または JSON。 
 +  * ''other_mode=url_encode_separator_|''
  
 +  - Existing module ID (required).
 +  - A template identifier that must exist (required).
 +  - ''0'' It is explicitly stated that this is a standard alert (optional); this parameter can also be omitted, as the default value is zero.
 +  - This parameter is omitted when creating a standard alert, as it will be generated using the name of the existing module identifier provided.
 +
 +  - 既存のモジュールID(必須)。
 +  - 必ず存在するテンプレート識別子(必須)。
 +  - ''0'' は、これが標準アラートであることを明示的に示しています(オプション)。デフォルト値はゼロなので、このパラメータは省略できます。
 +  - 標準アラートを作成する場合、このパラメータは省略されます。指定された既存のモジュール識別子の名前を使用してアラートが生成されるためです。
 +
 +**To create [[:en:documentation:pandorafms:complex_environments_and_optimization:02_policy#ks4_7|external alerts]]**:
 +
 +**[[:ja:documentation:pandorafms:complex_environments_and_optimization:02_policy#ks4_7|外部アラート]]を作成するには**:
 +
 +  * ''op=set'' (required).
 +  * ''op2=create_alerts_policy'' (required).
 +  * ''id='' A policy identifier that must exist (required).
 +  * ''return_type'' Output format (optional): STRING, CSV o JSON.
 +  * ''other_mode=url_encode_separator_|''.
 +  * ''other='' With the following fields properly delimited:
 +
 +  * ''op=set'' (必須)。
 +  * ''op2=create_alerts_policy'' (必須)。
 +  * ''id='' ポリシー識別子 (必須)。
 +  * ''return_type'' 出力形式 (オプション):STRING、CSV、またはJSON。
 +  * ''other_mode=url_encode_separator_|''
 +  * ''other='' 以下のフィールドを適切に区切り文字で区切ってください。
 +
 +  - ''0'' Since the external alert does not require an existing module to be generated (optional).
 +  - A template identifier that must exist (required).
 +  - ''1'' It is explicitly stated that this is an external alert (mandatory).
 +  - Module name for the external alert (required).
 +
 +  - ''0'' 外部アラートは既存のモジュールを生成する必要がないため(オプション)。
 +  - 必ず存在しなければならないテンプレート識別子(必須)。
 +  - ''1'' これが外部アラートであることを明示的に指定する(必須)。
 +  - 外部アラートのモジュール名(必須)。
 +
 +**Result**:
 +
 +**結果**:
 +
 +Returns '0' (//false//) or the identifier of the alert added to the policy (//true//).
 +
 +'0' (//false//) またはポリシーに追加されたアラートの識別子 (//true//) を返します。
 +
 +**Example of a standard alert (see [[#ks2|call syntax]]):**
 +
 +**標準アラートの例([[#ks2|書式]]を参照):**
 +
 +<code bash>
 +…/include/api.php?op=set&op2=create_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=7&other=39|1|0|&other_mode=url_encode_separator_|
 +</code>
 +
 +**Example of an external alert (see [[#ks2|call syntax]]):**
 +
 +**外部アラートの例([[#ks2|書式]]を参照):**
 +
 +<code bash>
 +…/include/api.php?op=set&op2=create_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=8&other=0|1|1|ESET%20logd&other_mode=url_encode_separator_|
 </code> </code>
  
行 8258: 行 8479:
  
 { {
-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>,
行 8388: 行 8609:
  
 { {
-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.1731194562.txt.gz
  • 最終更新: 2024/11/09 23:22
  • by junichi