差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| ja:documentation:08_technical_reference:12_disco_development [2023/12/13 05:57] – [CUSTOM_SELECT Blocks] junichi | ja:documentation:08_technical_reference:12_disco_development [2026/10/05 07:50] (現在) – 削除 - 外部編集 (不明な日付) 127.0.0.1 | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== .Disco 開発 ====== | ||
| - | |||
| - | {{indexmenu_n> | ||
| - | |||
| - | ===== パッケージ '' | ||
| - | |||
| - | **Discovery** allows you to load both official Pandora FMS plugins and custom ones. | ||
| - | |||
| - | **自動検出** を使用すると、公式 Pandora FMS プラグインとカスタムプラグインの両方をロードできます。 | ||
| - | |||
| - | To load custom plugins it is necessary to generate a '' | ||
| - | |||
| - | カスタムプラグインをロードするには、コンソールと Pandora FMS サーバの両方で次のことができるように、必要なものすべてを含む '' | ||
| - | |||
| - | * Show the configuration interface for new discovery tasks. | ||
| - | * Execute the discovery tasks configured in the environment. | ||
| - | |||
| - | * 新しい検出タスクの設定インターフェイスを表示します。 | ||
| - | * 環境内で設定された検出タスクを実行します。 | ||
| - | |||
| - | A '' | ||
| - | |||
| - | '' | ||
| - | |||
| - | Optionally, a '' | ||
| - | |||
| - | オプションで、'' | ||
| - | |||
| - | Finally, typically, a '' | ||
| - | |||
| - | 最後に、通常、'' | ||
| - | |||
| - | Therefore, and in short, a '' | ||
| - | |||
| - | したがって、簡単に言うと、'' | ||
| - | |||
| - | * '' | ||
| - | * '' | ||
| - | * Scripts, executables and libraries. | ||
| - | |||
| - | * '' | ||
| - | * '' | ||
| - | * スクリプト、実行ファイルおよび、ライブラリ | ||
| - | |||
| - | ===== '' | ||
| - | |||
| - | The **discovery_definition.ini** file is the most important within a '' | ||
| - | |||
| - | **discovery_setting.ini** ファイルは、プラグイン定義全体が含まれているため、'' | ||
| - | |||
| - | It contains both the parameters that will be displayed by the console to be filled in a task definition form, as well as the executions that the Pandora FMS server will have to perform for the plugin tasks. | ||
| - | |||
| - | これには、タスク定義フォームに入力するためにコンソールに表示されるパラメータと、Pandora FMS サーバによるプラグインタスクの実行のための情報の両方が含まれています。 | ||
| - | |||
| - | In order to facilitate its definition and processing in the console, the format used in a '' | ||
| - | |||
| - | コンソールでの定義と処理を容易にするために、'' | ||
| - | |||
| - | A '' | ||
| - | |||
| - | '' | ||
| - | |||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | |||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | |||
| - | ===== 共通のコンセプト ===== | ||
| - | |||
| - | During the following explanations it will be common to use some terms. This section explains those terms. | ||
| - | |||
| - | 以降の説明では、一般的にいくつかの用語が使用されます。 この章ではこれらの用語について説明します。 | ||
| - | |||
| - | A **macro** is a unique text key used to store information (values, paths to files, ...). When a **macro** is used (for example during a run) you want to use the information it contains instead. | ||
| - | |||
| - | **マクロ**は、情報 (値、ファイルへのパスなど) を保存するために使用される一意のテキストキーです。 **マクロ**が使用されるとき(実行中など)、マクロに含まれる情報を使用したいことがあります。 | ||
| - | |||
| - | A **valid macro** is a text key that starts and ends with underscores '' | ||
| - | |||
| - | **有効なマクロ**は、始まりと終わりがアンダースコア '' | ||
| - | |||
| - | When we talk about **STRING** we refer to alphanumeric text strings. | ||
| - | |||
| - | **STRING** は、英数字のテキスト文字列を指します。 | ||
| - | |||
| - | When we talk about **NUMBER** we will refer exclusively to numbers. | ||
| - | |||
| - | **NUMBER** は、数字のみを指します。 | ||
| - | |||
| - | When we talk about **BOOL** we refer to values **true** / **false**, **1** / **0**, **yes** / **no**. | ||
| - | |||
| - | **BOOL** は、値 **true** / **false**、**1** / **0**、**yes** / **no** を指します。 | ||
| - | |||
| - | When we talk about **VALUE** we refer to any value (**STRING**, | ||
| - | |||
| - | **VALUE** は、任意の値 (**STRING**、**NUMBER**、または **BOOL**) を指します。 通常、同じ型の値を表すためにカンマ区切りのリストで使用されます。 | ||
| - | |||
| - | When the letters **N** or **M** are used in capital letters, we refer to a positive integer. It will normally be used in conjunction with other elements such as **VALUE** to indicate that it can be repeated more than once (For example, **VALUE_N**). | ||
| - | |||
| - | **N** または **M** という文字が大文字で使用されている場合、正の整数を指します。 通常、**VALUE** などの他の要素と組み合わせて使用され、複数回繰り返すことができることを示します (**VALUE_N** など)。 | ||
| - | |||
| - | ===== サーバマクロ ===== | ||
| - | |||
| - | Much of the configuration of executions for the server is based on the use of **macros**. Mainly, these will be defined by the user, but there are some specific ones of the Pandora FMS server that can be useful: | ||
| - | |||
| - | サーバの実行設定の多くは、**マクロ**の使用に基づいています。 主にこれらはユーザによって定義されますが、Pandora FMS サーバに特有の便利なものもいくつかあります。 | ||
| - | |||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | |||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | * ''< | ||
| - | |||
| - | <WRAP center round important 60%> | ||
| - | |||
| - | These macros are in no case used by the Pandora FMS console. | ||
| - | |||
| - | </ | ||
| - | |||
| - | <WRAP center round important 60%> | ||
| - | |||
| - | これらのマクロは、Pandora FMS コンソールでは使用されません。 | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== discovery_extension_definition ブロック ===== | ||
| - | |||
| - | This block defines the main configuration of the plugin and has the following parameters: | ||
| - | |||
| - | このブロックはプラグインの主な設定を定義し、次のパラメータがあります。 | ||
| - | |||
| - | * **short_name**: | ||
| - | * Mandatory. | ||
| - | * Defines the short name of the plugin. | ||
| - | * The short name must be unique. | ||
| - | * Short names beginning with the prefix " | ||
| - | * Short names can only contain letters ('' | ||
| - | * **section**: | ||
| - | * Mandatory. | ||
| - | * Defines the section of the console where the plugin will be displayed. | ||
| - | * Can be **app**, **cloud** or **custom**. | ||
| - | * **name**: | ||
| - | * Mandatory. | ||
| - | * Defines the name of the plugin that will be displayed in the console. | ||
| - | * **version**: | ||
| - | * Mandatory. | ||
| - | * Defines the version of the plugin that will be displayed in the console. | ||
| - | * It is recommended to change the version if changes are made to a plugin, no matter how minor. | ||
| - | * **description**: | ||
| - | * Optional. | ||
| - | * Defines the description of the plugin that will be displayed in the console. | ||
| - | * **execution_file**: | ||
| - | * Optional. | ||
| - | * Indicates the relative paths (within the '' | ||
| - | * All the indicated files will be given execute permission. | ||
| - | * This parameter is an **array** whose keys will be **valid macros** that will be used to indicate the use of the plugin files. | ||
| - | * Being an **array** this parameter can be indicated several times using different keys. | ||
| - | * For example: | ||
| - | |||
| - | * **short_name**: | ||
| - | * 必須。 | ||
| - | * プラグインの短い名前を定義します。 | ||
| - | * 短い名前はユニークでなければいけません。 | ||
| - | * " | ||
| - | * 短い名前に含めることはできるのは、アルファベット ('' | ||
| - | * **section**: | ||
| - | * 必須。 | ||
| - | * プラグインが表示されるコンソールのセクションを定義します。 | ||
| - | * **app**, **cloud** または **custom** を指定できます。 | ||
| - | * **name**: | ||
| - | * 必須。 | ||
| - | * コンソールに表示されるプラグインの名前を定義します。 | ||
| - | * **version**: | ||
| - | * 必須。 | ||
| - | * コンソールに表示されるプラグインのバージョンを定義します。 | ||
| - | * プラグインに変更が加えられた場合は、どんなに小さな変更であっても、バージョンを変更することをお勧めします。 | ||
| - | * **description**: | ||
| - | * オプション。 | ||
| - | * コンソールに表示されるプラグインの説明を定義します。 | ||
| - | * **execution_file**: | ||
| - | * オプション。 | ||
| - | * プラグインによって使用されるスクリプトおよび実行可能ファイルへの相対パス ('' | ||
| - | * 指定されたすべてのファイルに実行権限が与えられます。 | ||
| - | * このパラメータは **配列**で、そのキーはプラグインファイルの使用を示すために使用される **有効なマクロ** になります。 | ||
| - | * このパラメータは **配列**であるため、異なるキーを使用して複数回指定できます。 | ||
| - | * 例: | ||
| - | |||
| - | < | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | </ | ||
| - | |||
| - | * **exec**: | ||
| - | * Mandatory. | ||
| - | * Defines the format of the executions that the Pandora FMS server must perform for the plugin tasks. | ||
| - | * This parameter is an **array** whose keys will be positional, that is, they can be indicated with numbers or not indicated. | ||
| - | * Being an **array** this parameter can be indicated several times using different keys. | ||
| - | * It will be common to use **macros** in the defined executions both to indicate the paths to the scripts or executables used and to indicate the parameters of said scripts or executables. | ||
| - | * The Pandora FMS server will launch each of the defined executions in order and will store the result of all of them to produce the output of the plugin in the task and obtain its status. | ||
| - | * For example: | ||
| - | |||
| - | * **exec**: | ||
| - | * 必須。 | ||
| - | * Pandora FMS サーバがプラグインタスクに対して実行する必要がある実行形式を定義します。 | ||
| - | * このパラメータは **配列** で、そのキーは位置指定になります。つまり、キーは数字で示されることも、示されないこともあります。 | ||
| - | * このパラメータは **配列**であるため、異なるキーを使用して複数回指定できます。 | ||
| - | * 定義された実行では 使用されるスクリプトまたは実行可能ファイルへのパスを示したり、そのスクリプトまたは実行可能ファイルのパラメータを示す **マクロ** を使用するのが一般的です。 | ||
| - | * Pandora FMS サーバは、定義された各実行を順番に起動し、すべての実行の結果を保存して、タスク内のプラグインの出力を生成し、そのステータスを取得します。 | ||
| - | * 例: | ||
| - | |||
| - | < | ||
| - | | ||
| - | | ||
| - | |||
| - | </ | ||
| - | |||
| - | * **passencrypt_script**: | ||
| - | * Optional. | ||
| - | * Defines the relative path (within the '' | ||
| - | * The indicated file will be given execute permission. | ||
| - | * **passencrypt_exec**: | ||
| - | * Optional. | ||
| - | * Defines the format of the execution of the script to encrypt passwords from the console. | ||
| - | * The expected result of said execution will be a text that corresponds to the encrypted password. | ||
| - | * Only supports the use of the **_passencrypt_script_** and **_password_** macros in its definition. | ||
| - | * The **_passencrypt_script_** macro is replaced by the path to the file defined in **passencrypt_script**. | ||
| - | * The **_password_** macro is replaced by the value of the password type field that must be encrypted at any time. | ||
| - | * For example: | ||
| - | |||
| - | * **passencrypt_script**: | ||
| - | * オプション。 | ||
| - | * コンソールからパスワード タイプのフィールドを暗号化するために使用されるスクリプトへの相対パス ('' | ||
| - | * 指定されたファイルに実行権限が与えられます。 | ||
| - | * **passencrypt_exec**: | ||
| - | * オプション。 | ||
| - | * コンソールからパスワードを暗号化するためのスクリプトの実行形式を定義します。 | ||
| - | * 上記の実行で期待される結果は、暗号化されたパスワードに対応するテキストになります。 | ||
| - | * 定義内では **_passencrypt_script_** マクロと **_password_** マクロの使用のみがサポートされています。 | ||
| - | * **_passencrypt_script_** マクロは、**passencrypt_script** で定義されたファイルへのパスに置き換えられます。 | ||
| - | * **_password_** マクロは、いつでも暗号化する必要があるパスワード タイプ フィールドの値に置き換えられます。 | ||
| - | * 例: | ||
| - | |||
| - | < | ||
| - | | ||
| - | |||
| - | </ | ||
| - | |||
| - | * **passdecrypt_script**: | ||
| - | * Optional. | ||
| - | * Defines the relative path (within the '' | ||
| - | * The indicated file will be given execute permission. | ||
| - | * **passdecrypt_exec**: | ||
| - | * Optional. | ||
| - | * Defines the format of the execution of the script to decrypt passwords from the console. | ||
| - | * The expected result of said execution will be a text that corresponds to the decrypted password. | ||
| - | * Only supports the use of the **_passdecrypt_script_** and **_password_** macros in its definition. | ||
| - | * The **_passdecrypt_script_** macro is replaced by the path to the file defined in **passdecrypt_script**. | ||
| - | * The **_password_** macro is replaced by the value of the password type field that must be decrypted at any time. | ||
| - | * For example: | ||
| - | |||
| - | * **passdecrypt_script**: | ||
| - | * オプション。 | ||
| - | * コンソールからパスワード タイプのフィールドを復号化するために使用されるスクリプトへの相対パス ('' | ||
| - | * 指定されたファイルに実行権限が与えられます。 | ||
| - | * **passdecrypt_exec**: | ||
| - | * オプション。 | ||
| - | * コンソールからパスワードを復号化するためのスクリプトの実行形式を定義します。 | ||
| - | * 上記の実行で期待される結果は、復号化されたパスワードに対応するテキストになります。 | ||
| - | * 定義内では **_passdecrypt_script_** マクロと **_password_** マクロの使用のみがサポートされています。 | ||
| - | * **_passdecrypt_script_** マクロは、**passdecrypt_script** で定義されたファイルへのパスに置き換えられます。 | ||
| - | * **_password_** マクロは、いつでも復号化する必要があるパスワード タイプ フィールドの値に置き換えられます。 | ||
| - | * 例: | ||
| - | |||
| - | < | ||
| - | | ||
| - | |||
| - | </ | ||
| - | |||
| - | * **default_value**: | ||
| - | * Optional. | ||
| - | * Defines the default values for the various **macros** used during executions, ie the default values for the data stored for each *Discovery* task created for this plugin. | ||
| - | * This parameter is an **array** whose keys will be **valid macros**. | ||
| - | * Being an **array** this parameter can be indicated several times using different keys. | ||
| - | * Depending on the type of field used in the console forms (see below) the default values may be: | ||
| - | - **string**: //STRING// . | ||
| - | - **number**: //NUMBER// . | ||
| - | - **password**: | ||
| - | - **textarea**: | ||
| - | - **checkbox**: | ||
| - | - **select**: //VALUE_N// . | ||
| - | - **multiselect**: | ||
| - | - **tree**: // | ||
| - | * It is recommended to include a **default_value** for each of the **macros** that may be in the task configuration forms. | ||
| - | * For example: | ||
| - | |||
| - | * **default_value**: | ||
| - | * オプション。 | ||
| - | * 実行中に使用されるさまざまな **マクロ** のデフォルト値、つまり、このプラグイン用に作成された各 *自動検出* タスクに保存されるデータのデフォルト値を定義します。 | ||
| - | * このパラメータは **配列**で、そのキーは **有効なマクロ**になります。 | ||
| - | * このパラメータは **配列**であるため、異なるキーを使用して複数回指定できます。 | ||
| - | * コンソールフォーム (以下を参照) で使用されるフィールドのタイプに応じて、デフォルト値は次のようになります。 | ||
| - | - **string**: //STRING// . | ||
| - | - **number**: //NUMBER// . | ||
| - | - **password**: | ||
| - | - **textarea**: | ||
| - | - **checkbox**: | ||
| - | - **select**: //VALUE_N// . | ||
| - | - **multiselect**: | ||
| - | - **tree**: // | ||
| - | * タスク設定フォームに含まれる可能性のある**マクロ**ごとに**default_value**を含めることをお勧めします。 | ||
| - | * 例: | ||
| - | |||
| - | < | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | </ | ||
| - | |||
| - | The following example can be used as a base for this block, since it includes all the parameters explained with comments for each case: | ||
| - | |||
| - | 次の例は、各ケースのコメントで説明されているすべてのパラメーターが含まれているため、このブロックのベースとして使用できます。 | ||
| - | |||
| - | < | ||
| - | [discovery_extension_definition] | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines discovery application short name | ||
| - | ; Short name must be unique | ||
| - | ; Short names with " | ||
| - | |||
| - | short_name = DISCOVERY_APPLICATION_UNIQUE_NAME | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines the section where application will be shown in console | ||
| - | ; Possible values: | ||
| - | ; apps | ||
| - | ; clouds | ||
| - | ; custom | ||
| - | |||
| - | section = app | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines discovery application name, shown in console | ||
| - | |||
| - | name = DISCOVERY_APPLICATION_NAME | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines discovery application version, shown in console | ||
| - | |||
| - | version = VERSION | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines discovery application description, | ||
| - | |||
| - | description = DESCRIPTION | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines execution files inside .disk | ||
| - | ; Several execution files can be defined | ||
| - | |||
| - | execution_file[_EXEC_MACRO_N_] = SCRIPT.pl | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines execution for discovery server | ||
| - | ; Several executions can be defined | ||
| - | ; At least 1 is required for server execution | ||
| - | |||
| - | exec[] = SERVER_EXECUTION | ||
| - | |||
| - | ; Optional | ||
| - | ; Define password encrypt script | ||
| - | |||
| - | passencrypt_script = PASS_ENCRYPT_SCRIPT.pl | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines password encrypt script execution format | ||
| - | ; _passencrypt_script_ is replaced with the passencrypt_script file path | ||
| - | ; _password_ is replaced with the string (password) to encrypt | ||
| - | |||
| - | passencrypt_exec = EXECUTION | ||
| - | |||
| - | ; Optional | ||
| - | ; Define password decrypt script | ||
| - | |||
| - | passdecrypt_script = PASS_DECRYPT_SCRIPT.pl | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines password encrypt script execution format | ||
| - | ; _passdecrypt_script_ is replaced with the passdecrypt_script file path | ||
| - | ; _password_ is replaced with the string (password) to encrypt | ||
| - | |||
| - | passdecrypt_exec = EXECUTION | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines the default values for the fields when a new task is created | ||
| - | ; By default all values are empty or not selected | ||
| - | ; Several default values can be defined | ||
| - | ; Possible values depending on field type: | ||
| - | ; string - STRING | ||
| - | ; number - NUMBER | ||
| - | ; password-STRING | ||
| - | ; textarea-STRING | ||
| - | ; checkbox-BOOL | ||
| - | ; select-VALUE_N | ||
| - | ; multiselect - [VALUE_1, | ||
| - | ; tree - [VALUE_1, | ||
| - | |||
| - | default_value[_FIELD_MACRO_N_] = DEFAULT_VALUE | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== config_steps ブロック ===== | ||
| - | |||
| - | This block defines the configuration steps for the plugin tasks and has the following parameters: | ||
| - | |||
| - | このブロックはプラグインタスクの設定手順を定義し、次のパラメータがあります。 | ||
| - | |||
| - | <WRAP center round info 60%> | ||
| - | |||
| - | These rules apply to all parameters of this block: | ||
| - | |||
| - | * The parameters are **arrays** whose keys will be positional, that is, they can be indicated with numbers or not indicated. It is recommended to indicate the keys. | ||
| - | * As they are **arrays** the parameters can be indicated several times using different keys. | ||
| - | * All parameters that share a key refer to the same element. That is, they assign different values (depending on the parameter) to the same element. | ||
| - | |||
| - | </ | ||
| - | |||
| - | <WRAP center round info 60%> | ||
| - | |||
| - | これらのルールは、このブロックのすべてのパラメーターに適用されます。 | ||
| - | |||
| - | * パラメータは **配列** であり、そのキーは位置指定になります。つまり、数値で示すことも、示さないこともできます。 キーを示すことをお勧めします。 | ||
| - | * パラメータは **配列**であるため、異なるキーを使用して複数回指定できます。 | ||
| - | * キーを共有するすべてのパラメータは、同じ要素を参照します。 つまり、(パラメータに応じて) 異なる値を同じ要素に割り当てます。 | ||
| - | |||
| - | </ | ||
| - | |||
| - | * **name**: | ||
| - | * Mandatory. | ||
| - | * Defines the names of the different configuration steps in the tasks. | ||
| - | * **script_data_fields**: | ||
| - | * Required if a **custom_fields** is not defined for the same key. | ||
| - | * Optional if a **custom_fields** is defined for the same key. | ||
| - | * Defines the format of the executions that the Pandora FMS console must carry out for the forms that are generated dynamically. For example, if you are going to monitor a virtualization environment and you want to get a list of virtual machines to select the ones you want to monitor. | ||
| - | * The keys used must exist in the **name** array of this block. | ||
| - | * It will be common to use **macros** in the executions defined both to indicate the paths to the scripts or executables used and to indicate the parameters of said scripts or executables. | ||
| - | * The result of the executions indicated here must be a **JSON** with the following format. The JSON keys correspond to the parameters of the CUSTOM_FIELDS block (see below): | ||
| - | |||
| - | * **name**: | ||
| - | * 必須。 | ||
| - | * タスク内のさまざまな設定ステップの名前を定義します。 | ||
| - | * **script_data_fields**: | ||
| - | * **custom_fields** が同じキーに対して定義されていない場合は必須です。 | ||
| - | * **custom_fields** が同じキーに対して定義されている場合はオプションです。 | ||
| - | * 動的に生成されるフォームに対して Pandora FMS コンソールが実行する必要がある実行の形式を定義します。 たとえば、仮想化環境を監視する予定で、監視する仮想マシンを選択するために仮想マシンのリストを取得したい場合です。 | ||
| - | * 使用されるキーは、このブロックの **name** 配列に存在する必要があります。 | ||
| - | * 使用されるスクリプトまたは実行可能ファイルへのパスを示すためと、そのスクリプトまたは実行可能ファイルのパラメータを示すために、定義された実行で **マクロ** を使用するのが一般的です。 | ||
| - | * ここで示される実行結果は、次の形式の **JSON** である必要があります。 JSON キーは、CUSTOM_FIELDS ブロックのパラメーターに対応します (以下を参照)。 | ||
| - | |||
| - | < | ||
| - | [ | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | }, | ||
| - | " | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | }, | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | ] | ||
| - | }, | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | ] | ||
| - | } | ||
| - | ] | ||
| - | |||
| - | </ | ||
| - | |||
| - | * **custom_fields**: | ||
| - | * Required if a **script_data_fields** is not defined for the same key. | ||
| - | * Optional if a **script_data_fields** is defined for the same key. | ||
| - | * Defines the configuration blocks of the same INI file from which the form fields will be obtained when creating tasks in the Pandora FMS console. | ||
| - | * The keys used must exist in the **name** array of this block. | ||
| - | * **fields_columns**: | ||
| - | * Optional. | ||
| - | * Defines the number of columns in which the fields of the task forms will be distributed in each configuration step. | ||
| - | * The keys used must exist in the **name** array of this block. | ||
| - | * Can be assigned the value **1** or **2**. | ||
| - | * Its default value is **2**. | ||
| - | |||
| - | * **custom_fields**: | ||
| - | * **script_data_fields** が同じキーに対して定義されていない場合は必須です。 | ||
| - | * **script_data_fields** が同じキーに対して定義されている場合はオプションです。 | ||
| - | * Pandora FMS コンソールでタスクを作成するときにフォームフィールドから取得されるのと同じ INI ファイルの設定ブロックを定義します。 | ||
| - | * 使用されるキーは、このブロックの **name** 配列に存在する必要があります。 | ||
| - | * **fields_columns**: | ||
| - | * オプション。 | ||
| - | * 各構成ステップでタスクフォームのフィールドが分散される列の数を定義します。 | ||
| - | * 使用されるキーは、このブロックの **name** 配列に存在する必要があります。 | ||
| - | * 値 **1** または **2** を割り当てることができます。 | ||
| - | * デフォルト値は **2** です。 | ||
| - | |||
| - | For example, this would be a way to define multiple configuration steps: | ||
| - | |||
| - | たとえば、これは複数の設定ステップを定義する方法です。 | ||
| - | |||
| - | < | ||
| - | [config_steps] | ||
| - | |||
| - | name[1] = First step | ||
| - | script_data_fields[1] = "' | ||
| - | |||
| - | name[2] = Mid step | ||
| - | custom_fields[2] = custom_fields_1 | ||
| - | |||
| - | name[3] = Last step | ||
| - | script_data_fields[3] = "' | ||
| - | custom_fields[3] = custom_fields_2 | ||
| - | |||
| - | </ | ||
| - | |||
| - | If **script_data_fields** and **custom_fields** are indicated for the same configuration step, the form will first show the fields obtained by **script_data_fields** and then those defined in **custom_fields**. | ||
| - | |||
| - | 同じ設定ステップに対して **script_data_fields** と **custom_fields** が指定されている場合、フォームには最初に **script_data_fields** によって取得されたフィールドが表示され、次に **custom_fields** で定義されたフィールドが表示されます。 | ||
| - | |||
| - | The following example can be used as a base for this block, since it includes all the parameters explained with comments for each case: | ||
| - | |||
| - | 次の例は、各ケースのコメントで説明されているすべてのパラメーターが含まれているため、このブロックのベースとして使用できます。 | ||
| - | |||
| - | < | ||
| - | [config_steps] | ||
| - | |||
| - | ; Following parameters can be setup for each configuration step | ||
| - | ; Several steps can be defined using a different key (N) | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines configuration step name | ||
| - | |||
| - | name[N] = STEP_NAME | ||
| - | |||
| - | ; Mandatory if not custom_fields defined | ||
| - | ; Defines configuration fields retrieved to console by a command execution | ||
| - | ; execution_file scripts can be used to retrieve data | ||
| - | ; Command execution output must be JSON as follows | ||
| - | ; [ | ||
| - | ; { | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; }, | ||
| - | ; " | ||
| - | ; { | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; { | ||
| - | ; " | ||
| - | ;" | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; }, | ||
| - | ; { | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; } | ||
| - | ; ] | ||
| - | ; }, | ||
| - | ; { | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; } | ||
| - | ; ] | ||
| - | ; } | ||
| - | ; ] | ||
| - | |||
| - | script_data_fields[N] = CONSOLE_EXECUTION_FIELDS | ||
| - | |||
| - | ; Mandatory if not script_data_fields defined | ||
| - | ; Defines custom configuration fields | ||
| - | |||
| - | custom_fields[N] = CUSTOM_FIELDS_N | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines the number of fields columns for the configuration steps (1 or 2) | ||
| - | |||
| - | fields_columns[N] = M | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== tempfile_confs ブロック ===== | ||
| - | |||
| - | This block defines the format for the temporary configuration files used by the plugin and has the following parameters: | ||
| - | |||
| - | このブロックは、プラグインによって使用される一時設定ファイルの形式を定義し、次のパラメータがあります。 | ||
| - | |||
| - | * **file**: | ||
| - | * Mandatory. | ||
| - | * Defines the contents for temporary configuration files that can be used during the executions of the Pandora FMS server and console. | ||
| - | * This parameter is an **array** whose keys will be **valid macros** that will be used to indicate the use of temporary files in the plugin. | ||
| - | * Being an **array** this parameter can be indicated several times using different keys. | ||
| - | * When one of the keys of this **array** is indicated during an execution, a temporary file is generated whose content is the one indicated in this **array** and the value of the macro is replaced by the location of said file temporary. Once the execution is finished, the file is deleted. | ||
| - | * Within the content of the temporary configuration files, it is possible to indicate other **macros**, so that they are replaced by the corresponding value. | ||
| - | * For example: | ||
| - | |||
| - | * **file**: | ||
| - | * 必須。 | ||
| - | * Pandora FMS サーバおよびコンソールの実行中に使用できる一時設定ファイルの内容を定義します。 | ||
| - | * このパラメータは **配列**で、そのキーはプラグインでの一時ファイルの使用を示すために使用される**有効なマクロ**になります。 | ||
| - | * このパラメータは **配列**であるため、異なるキーを使用して複数回指定できます。 | ||
| - | * 実行中にこの **配列** のキーの 1 つが指定されると、この **配列** で指定された内容を含む一時ファイルが生成され、マクロの値はそのファイルの場所に置き換えられます。実行が完了すると、ファイルは削除されます。 | ||
| - | * 一時設定ファイル内で、他の **マクロ**を指定して、対応する値に置き換えることができます。 | ||
| - | * 例: | ||
| - | |||
| - | < | ||
| - | | ||
| - | user _param2_ | ||
| - | | ||
| - | log __temp__/ | ||
| - | |||
| - | </ | ||
| - | |||
| - | The following example can be used as a base for this block, since it includes all the parameters explained with comments for each case: | ||
| - | |||
| - | 次の例は、各ケースのコメントで説明されているすべてのパラメーターが含まれているため、このブロックのベースとして使用できます。 | ||
| - | |||
| - | < | ||
| - | [tempfile_confs] | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines the content for the temporary file | ||
| - | ; File will be used where temporary file macro is specified during executions | ||
| - | ; File content replaces fields macros with their values | ||
| - | |||
| - | file[_TEMP_FILE_MACRO_N_] = _FIELD_MACRO_N_, | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== CUSTOM_FIELDS ブロック ===== | ||
| - | |||
| - | This type of block can have any name you want, as long as it has been assigned as a value within the **config_steps** block for its **custom_fields** parameter. They define the fields for the forms in the plugin configuration steps and have the following parameters: | ||
| - | |||
| - | このタイプのブロックには、**config_steps** ブロック内の **custom_fields** パラメーターの値として割り当てられている限り、任意の名前を付けることができます。 これらはプラグイン設定手順でフォームのフィールドを定義し、次のパラメータがあります。 | ||
| - | |||
| - | <WRAP center round info 60 %> These rules apply for all parameters in this block: | ||
| - | |||
| - | * The parameters are **arrays** whose keys will be positional, that is, they can be indicated with numbers or not indicated. It is recommended to indicate the keys. | ||
| - | * Being **arrays** the parameters can be indicated several times using different keys. | ||
| - | * All parameters that share a key refer to the same element. That is, they assign different values (depending on the parameter) to the same element. | ||
| - | |||
| - | </ | ||
| - | |||
| - | <WRAP center round info 60 %> These rules apply for all parameters in this block: | ||
| - | |||
| - | * パラメータは **配列** であり、そのキーは位置指定になります。つまり、数値で示すことも、示さないこともできます。 キーを示すことをお勧めします。 | ||
| - | * **配列**であるため、パラメータは異なるキーを使用して複数回指定できます。 | ||
| - | * キーを共有するすべてのパラメータは、同じ要素を参照します。 つまり、(パラメータに応じて) 異なる値を同じ要素に割り当てます。 | ||
| - | |||
| - | </ | ||
| - | |||
| - | * **macro**: | ||
| - | * Mandatory. | ||
| - | * Defines the macros in which the task configuration values will be stored. | ||
| - | * **mandatory_field**: | ||
| - | * Optional. | ||
| - | * Defines by means of **BOOL** type values if the configuration field of the form must have a mandatory value or not. | ||
| - | * The keys used must exist in the **macro** array of this block. | ||
| - | * By default all fields are required. | ||
| - | * Even though they are mandatory, the **multiselect** and **tree** type fields admit that elements cannot be selected. | ||
| - | * **name**: | ||
| - | * Mandatory. | ||
| - | * Defines the names of the form configuration fields. | ||
| - | * The keys used must exist in the **macro** array of this block. | ||
| - | * **tip**: | ||
| - | * Optional. | ||
| - | * Defines the help of the form configuration fields. | ||
| - | * The keys used must exist in the **macro** array of this block. | ||
| - | * **type**: | ||
| - | * Mandatory. | ||
| - | * Defines the types of the form configuration fields. | ||
| - | * The keys used must exist in the **macro** array of this block. | ||
| - | * Its possible values are: | ||
| - | * **string**: The field will be a text box. It will admit values of type **STRING**. | ||
| - | * **number**: The field will be a number entry box.Shall accept values of type **NUMBER**. | ||
| - | * **password**: | ||
| - | * **textarea**: | ||
| - | * **checkbox**: | ||
| - | * **select**: The field will be a dropdown in which to select a single value. Shall accept values of type **VALUE**. | ||
| - | * **multiselect**: | ||
| - | * **tree**: The field will be a tree of different levels whose elements can be selected or not to send their values. Shall accept values of type **VALUE**. | ||
| - | * **placeholder**: | ||
| - | * Optional if the associated **type** is **string** or **textarea**. | ||
| - | * Defines the texts that will be displayed in the text boxes as examples. | ||
| - | * The keys used must exist in the **macro** array of this block. | ||
| - | * **show_on_true**: | ||
| - | * Optional. | ||
| - | * Defines **macros** of other **checkbox** fields on the form as values, so that when those macros have a value of **true** on the form, the desired field is displayed. | ||
| - | * The keys used must exist in the **macro** array of this block. | ||
| - | * **encrypt_on_true**: | ||
| - | * Optional if the associated **type** is **password**. | ||
| - | * Defines **macros** of other fields of type **checkbox** in the form as values, so that when these macros have a value **true** in the form, the desired field is encrypted when saving the configuration. | ||
| - | * The encryption/ | ||
| - | * The keys used must exist in the **macro** array of this block. | ||
| - | * **select_data**: | ||
| - | * Required if the associated **type** is **select** or **multiselect**. | ||
| - | * Defines the source of the values for the dropdowns. | ||
| - | * The selectors can be generated with data from Pandora FMS or customized. To do this, it admits the following values: | ||
| - | * The name of other configuration blocks in the same INI file from which the elements of type **select** or **multiselect** will be obtained. | ||
| - | * **agent_groups**: | ||
| - | * **agents**: Use agents as data. | ||
| - | * **module_groups**: | ||
| - | * **modules**: | ||
| - | * **module_types**: | ||
| - | * **tags**: Use the tags as data. | ||
| - | * **status**: Use statuses as data. | ||
| - | * **alert_templates**: | ||
| - | * **alert_actions**: | ||
| - | * **interval**: | ||
| - | * **credentials.custom**: | ||
| - | * **credentials.aws**: | ||
| - | * **credentials.azure**: | ||
| - | * **credentials.gcp**: | ||
| - | * **credentials.sap**: | ||
| - | * **credentials.snmp**: | ||
| - | * **credentials.wmi**: | ||
| - | * **os**: Use the OS as data. | ||
| - | * The keys used must exist in the **macro** array of this block. | ||
| - | * The values of the macro if the associated **type** is **multiselect** will be a **JSON** of type **array** with the different values selected. For example: | ||
| - | |||
| - | * **macro**: | ||
| - | * 必須。 | ||
| - | * タスク設定値が保存されるマクロを定義します。 | ||
| - | * **mandatory_field**: | ||
| - | * オプション。 | ||
| - | * フォームの設定フィールドに必須の値が必要かどうかを **BOOL** 型の値を使用して定義します。 | ||
| - | * 使用されるキーは、このブロックの **マクロ** 配列に存在する必要があります。 | ||
| - | * デフォルトでは、すべてのフィールドが必須です。 | ||
| - | * **multiselect** および **tree** タイプのフィールドは必須ではありますが、要素を選択できないことを認めています。 | ||
| - | * **name**: | ||
| - | * 必須。 | ||
| - | * フォーム設定フィールドの名前を定義します。 | ||
| - | * 使用されるキーは、このブロックの **マクロ** 配列に存在する必要があります。 | ||
| - | * **tip**: | ||
| - | * オプション。 | ||
| - | * フォーム設定フィールドのヘルプを定義します。 | ||
| - | * 使用されるキーは、このブロックの **マクロ** 配列に存在する必要があります。 | ||
| - | * **type**: | ||
| - | * 必須。 | ||
| - | * フォーム設定フィールドのタイプを定義します。 | ||
| - | * 可能な値は次のとおりです。 | ||
| - | * **string**: フィールドはテキストボックスになります。 **STRING** 型の値を受け入れます。 | ||
| - | * **number**: フィールドは数値入力ボックスになります。**NUMBER** タイプの値を受け入れます。 | ||
| - | * **password**: | ||
| - | * **textarea**: | ||
| - | * **checkbox**: | ||
| - | * **select**: このフィールドは、単一の値を選択するドロップダウンになります。 **VALUE** 型の値を受け入れます。 | ||
| - | * **multiselect**: | ||
| - | * **tree**: フィールドはさまざまなレベルのツリーになり、その要素を選択して値を送信するかどうかを選択できます。 **VALUE** 型の値を受け入れます。 | ||
| - | * **placeholder**: | ||
| - | * 関連付けられた **type** が **string** または **textarea** の場合はオプションです。 | ||
| - | * テキストボックスに例として表示されるテキストを定義します。 | ||
| - | * 使用されるキーは、このブロックの **マクロ** 配列に存在する必要があります。 | ||
| - | * **show_on_true**: | ||
| - | * オプション。 | ||
| - | * フォーム上の他の **チェックボックス** フィールドの **マクロ** を値として定義します。これにより、それらのマクロがフォーム上で **true** の値を持つ場合、目的のフィールドが表示されます。 | ||
| - | * 使用されるキーは、このブロックの **マクロ** 配列に存在する必要があります。 | ||
| - | * **encrypt_on_true**: | ||
| - | * 関連付けられた **type** が **password** の場合はオプションです。 | ||
| - | * フォーム内の **checkbox** タイプの他のフィールドの **マクロ** を値として定義します。これにより、これらのマクロがフォーム内で値 **true** を持つ場合、設定を保存するときに目的のフィールドが暗号化されます。 | ||
| - | * 暗号化/ | ||
| - | * 使用されるキーは、このブロックの **マクロ** 配列に存在する必要があります。 | ||
| - | * **select_data**: | ||
| - | * 関連付けられた **type** が **select** または **multiselect** の場合は必須です。 | ||
| - | * ドロップダウンの値のソースを定義します。 | ||
| - | * セレクタは、Pandora FMS からのデータを使用して生成することも、カスタマイズすることもできます。 これを行うために、次の値が受け入れられます。 | ||
| - | * **select** または **multiselect** タイプの要素が取得される、同じ INI ファイル内の他の設定ブロックの名前。 | ||
| - | * **agent_groups**: | ||
| - | * **agents**: エージェントをデータとして使用します。 | ||
| - | * **module_groups**: | ||
| - | * **modules**: | ||
| - | * **module_types**: | ||
| - | * **tags**: タグをデータとして使用します。 | ||
| - | * **status**: ステータスをデータとして使用します。 | ||
| - | * **alert_templates**: | ||
| - | * **alert_actions**: | ||
| - | * **interval**: | ||
| - | * **credentials.custom**: | ||
| - | * **credentials.aws**: | ||
| - | * **credentials.azure**: | ||
| - | * **credentials.gcp**: | ||
| - | * **credentials.sap**: | ||
| - | * **credentials.snmp**: | ||
| - | * **credentials.wmi**: | ||
| - | * **os**: OSをデータとして利用します。 | ||
| - | * 使用されるキーは、このブロックの **マクロ** 配列に存在する必要があります。 | ||
| - | * 関連付けられた **type** が **multiselect** の場合、マクロの値は、異なる値が選択された **array** タイプの **JSON** になります。 例: | ||
| - | |||
| - | < | ||
| - | | ||
| - | |||
| - | </ | ||
| - | |||
| - | * **tree_data**: | ||
| - | * Required if the associated **type** is **tree**. | ||
| - | * Defines the configuration blocks of the same INI file from which the **tree** type elements will be obtained. | ||
| - | * The keys used must exist in the **macro** array of this block. | ||
| - | * The values of the macro will be a **JSON** of type **array** with the different values selected. For example: | ||
| - | |||
| - | * **tree_data**: | ||
| - | * 関連付けられた **type** が **tree** の場合は必須です。 | ||
| - | * **tree** タイプの要素が取得される同じ INI ファイルの設定ブロックを定義します。 | ||
| - | * 使用されるキーは、このブロックの **マクロ** 配列に存在する必要があります。 | ||
| - | * マクロの値は、さまざまな値が選択された **array** タイプの **JSON** になります。 例: | ||
| - | |||
| - | < | ||
| - | | ||
| - | |||
| - | </ | ||
| - | |||
| - | For example, this would be a way to define several configuration fields: | ||
| - | |||
| - | たとえば、これはいくつかの設定フィールドを定義する方法です。 | ||
| - | |||
| - | < | ||
| - | [custom_fields_1] | ||
| - | |||
| - | macro[1] = _param1_ | ||
| - | name[1] = User | ||
| - | type[1] = string | ||
| - | |||
| - | macro[2] = _param2_ | ||
| - | name[2] = Password | ||
| - | type[2] = password | ||
| - | encrypt_on_true[2] = _param3_ | ||
| - | |||
| - | macro[3] = _param3_ | ||
| - | name[3] = Encrypt password | ||
| - | type[3] = checkbox | ||
| - | |||
| - | macro[4] = _param4_ | ||
| - | name[4] = Max threads | ||
| - | type[4] = number | ||
| - | mandatory_field[4] = false | ||
| - | |||
| - | macro[5] = _param5_ | ||
| - | name[5] = Agents group | ||
| - | tip[5] = Agents are generated in this group | ||
| - | type[5] = select | ||
| - | select_data[5] = agent_groups | ||
| - | |||
| - | macro[6] = _param6_ | ||
| - | name[6] = Mode | ||
| - | type[6] = select | ||
| - | select_data[6] = custom_select_1 | ||
| - | |||
| - | macro[7] = _param7_ | ||
| - | name[7] = Add extra options | ||
| - | type[7] = checkbox | ||
| - | |||
| - | macro[8] = _param8_ | ||
| - | name[8] = Extra elements | ||
| - | type[8] = tree | ||
| - | tree_data[8] = custom_tree_1 | ||
| - | show_on_true[8] = _param7_ | ||
| - | |||
| - | macro[9] = _param9_ | ||
| - | name[9] = Extra options | ||
| - | type[9] = textarea | ||
| - | placeholder[9] = "Add extra options here" | ||
| - | show_on_true[9] = _param7_ | ||
| - | |||
| - | </ | ||
| - | |||
| - | The following example can be used as a base for this block, since it includes all the parameters explained with comments for each case: | ||
| - | |||
| - | 次の例は、各ケースのコメントで説明されているすべてのパラメーターが含まれているため、このブロックのベースとして使用できます。 | ||
| - | |||
| - | < | ||
| - | [CUSTOM_FIELDS_N] | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines configuration field unique macro | ||
| - | ; Macros can be used for script executions, using their value in place | ||
| - | |||
| - | macro[N] = _FIELD_MACRO_N_ | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines if configuration field is mandatory or not | ||
| - | ; By default all configuration fields are mandatory | ||
| - | |||
| - | mandatory_field[N] = BOOL | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines configuration field name to be displayed in console | ||
| - | ; Macro will be used as name if this field is empty | ||
| - | |||
| - | name[N] = FIELD_NAME | ||
| - | |||
| - | ; Optional | ||
| - | ; Define a tip for the field, to be displayed in console | ||
| - | |||
| - | tip[N] = FIELD_TIP | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines the field type to be displayed in console | ||
| - | ; Possible values: | ||
| - | ; string | ||
| - | ; number | ||
| - | ; password | ||
| - | ; textarea | ||
| - | ; check box | ||
| - | ; select | ||
| - | ; multi select | ||
| - | ; tree | ||
| - | |||
| - | type[N] = FIELD_TYPE | ||
| - | |||
| - | ; Optional if type is string or textarea | ||
| - | ; Defines a placeholder for the field, to be displayed in console | ||
| - | |||
| - | placeholder[N] = PLACEHOLDER | ||
| - | |||
| - | ; Optional | ||
| - | ; Field is shown in console only if assigned field macro exists, is checkbox and is true | ||
| - | |||
| - | show_on_true[N] = _FIELD_MACRO_N_ | ||
| - | |||
| - | ; Optional if type is password | ||
| - | ; Field value is encrypted when stored into database if assigned field macro exists, is checkbox and is true | ||
| - | ; Password encrypt and decrypt depends on scripts uploaded to the discovery application | ||
| - | |||
| - | encrypt_on_true[N] = _FIELD_MACRO_N_ | ||
| - | |||
| - | ; Mandatory if type is select or multiselect | ||
| - | ; Defines select data to be displayed in console | ||
| - | ; Possible values: | ||
| - | ; agent_groups - Uses agent groups names | ||
| - | ; agents - Uses agents names | ||
| - | ; module_groups - Uses module groups | ||
| - | ; modules - Uses modules names | ||
| - | ; module_types - Uses module types names | ||
| - | ; tags - Uses module tags | ||
| - | ; status - Uses module status names | ||
| - | ; alert_templates - Uses alert templates names | ||
| - | ; alert_actions - Uses alert actions names | ||
| - | ; interval - Uses time interval selector | ||
| - | ; credentials.custom - Uses pandora custom credentials selector | ||
| - | ; credentials.aws - Uses pandora AWS credentials selector | ||
| - | ; credentials.azure - Uses pandora Microsoft Azure credentials selector | ||
| - | ; credentials.gcp - Uses pandora Google Cloud Platform credentials selector | ||
| - | ; credentials.sap - Uses pandora SAP credentials selector | ||
| - | ; credentials.snmp - Uses pandora SNMP credentials selector | ||
| - | ; credentials.wmi - Uses pandora WMI credentials selector | ||
| - | ; os - Uses pandora OS names | ||
| - | ; CUSTOM_SELECT_N - Uses custom selector values | ||
| - | ; multiselect fields value is a comma separated list of selected values | ||
| - | |||
| - | select_data[N] = FIELD_DATA | ||
| - | |||
| - | ; Mandatory if type is tree | ||
| - | ; Defines tree data to be displayed in console | ||
| - | ; tree fields value is a comma separated list of selected values | ||
| - | |||
| - | tree_data[N] = CUSTOM_TREE_DATA_N | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== CUSTOM_SELECT ブロック ===== | ||
| - | |||
| - | This type of block can have any name you like, as long as it has been assigned as a value within a **CUSTOM_FIELDS** block for its **select_data** parameter. They define the options of a drop-down of the plugin configuration form and it has the following parameters: | ||
| - | |||
| - | このタイプのブロックには、**select_data** パラメーターの **CUSTOM_FIELDS** ブロック内の値として割り当てられている限り、任意の名前を付けることができます。 これらはプラグイン設定フォームのドロップダウンのオプションを定義しており、次のパラメータがあります。 | ||
| - | |||
| - | * **option**: | ||
| - | * Mandatory. | ||
| - | * Defines the options of a custom selector. | ||
| - | * This parameter is an **array** whose keys are the values of the custom selector options, and its values are the texts displayed for each option in the custom selector. | ||
| - | * Being an **array** this parameter can be indicated several times using different keys. | ||
| - | |||
| - | * **option**: | ||
| - | * 必須。 | ||
| - | * カスタムセレクターのオプションを定義します。 | ||
| - | * このパラメーターは **配列** で、そのキーはカスタムセレクターオプションの値であり、その値はカスタムセレクターの各オプションに表示されるテキストです。 | ||
| - | * このパラメータは **配列**であるため、異なるキーを使用して複数回指定できます。 | ||
| - | |||
| - | For example: | ||
| - | |||
| - | 例: | ||
| - | |||
| - | < | ||
| - | [custom_select_1] | ||
| - | |||
| - | option[v1] = Value 1 | ||
| - | option[v2] = Value 2 | ||
| - | option[v3] = Value 3 | ||
| - | option[v4] = Value 4 | ||
| - | option[v5] = Value 5 | ||
| - | |||
| - | </ | ||
| - | |||
| - | The following example can be used as a base for this block, since it includes all the parameters explained with comments for each case: | ||
| - | |||
| - | 次の例は、各ケースのコメントで説明されているすべてのパラメーターが含まれているため、このブロックのベースとして使用できます。 | ||
| - | |||
| - | < | ||
| - | [CUSTOM_SELECT_N] | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines the value-text pair for the select or multiselect | ||
| - | ; Several value-text pairs can be defined | ||
| - | |||
| - | option[VALUE_N] = TEXT_N | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== CUSTOM_TREE_DATA Blocks ===== | ||
| - | |||
| - | This type of block can have any name you like, as long as it has been assigned as a value within a **CUSTOM_FIELDS** block for its **tree_data** parameter or within another **CUSTOM_TREE_DATA** block for its parameter **children**. They define the elements of a tree of the plugin configuration form and have the following parameters: | ||
| - | |||
| - | <WRAP center round info 60%> These rules apply forto all parameters of this block: | ||
| - | |||
| - | * The parameters are **arrays** whose keys will be positional, that is, they can be indicated with numbers or not indicated. It is recommended to indicate the keys. | ||
| - | * Being **arrays** the parameters can be indicated several times using different keys. | ||
| - | * All parameters that share a key refer to the same element. That is, they assign different values (depending on the parameter) to the same element. | ||
| - | |||
| - | </ | ||
| - | |||
| - | * **name**: | ||
| - | * Mandatory. | ||
| - | * Defines the names of the different elements of this level of the tree. | ||
| - | * **selectable**: | ||
| - | * Optional. | ||
| - | * Defines if the elements of this level of the tree are selectable or not. | ||
| - | * By default all tree elements are selectable. | ||
| - | * The keys used must exist in the **name** array of this block. | ||
| - | * **macro**: | ||
| - | * Optional if the associated **selectable** is **true** | ||
| - | * Defines the **macros** for which the values of the elements of this level of the tree that are selected in the form will be stored. | ||
| - | * Values must be **valid macros**. | ||
| - | * The same **macro** can be defined for different elements of the same tree. | ||
| - | * **Macros** cannot be the same as those for other elements outside the tree. | ||
| - | * If no **macro** is defined and the associated **selectable** is **true**, the value of the tree element will be stored in the **macro** defined for the tree. | ||
| - | * The keys used must exist in the **name** array of this block. | ||
| - | * **value**: | ||
| - | * Required if the associated **selectable** is **true** | ||
| - | * Defines the values of the different elements of this level of the tree. | ||
| - | * The keys used must exist in the **name** array of this block. | ||
| - | |||
| - | - The values of the macro will be a **JSON** of type **array** with the different values selected in the tree that share the same macro. For example: | ||
| - | |||
| - | < | ||
| - | | ||
| - | |||
| - | </ | ||
| - | |||
| - | * **children**: | ||
| - | * Optional. | ||
| - | * Defines the names of other configuration blocks in the same INI file from which the child elements of this level of the tree will be obtained. | ||
| - | * Configuration blocks from the same INI that have been used at a higher level of the tree cannot be referenced to avoid infinite loops. | ||
| - | * The keys used must exist in the **name** array of this block. | ||
| - | |||
| - | For example, this would be a way to define several elements of a tree: | ||
| - | |||
| - | < | ||
| - | [custom_tree_1] | ||
| - | |||
| - | name[1] = Performance modules | ||
| - | selectable[1] = false | ||
| - | children[1] = custom_tree_1_A | ||
| - | |||
| - | name[2] = Counter modules | ||
| - | selectable[2] = false | ||
| - | children[2] = custom_tree_1_B | ||
| - | |||
| - | [custom_tree_1_A] | ||
| - | |||
| - | name[1] = Profile1 | ||
| - | macro[1] = _param10_ | ||
| - | value[1] = p1 | ||
| - | |||
| - | name[2] = Perf2 | ||
| - | macro[2] = _param10_ | ||
| - | value[2] = p2 | ||
| - | |||
| - | name[3] = Perf3 | ||
| - | macro[3] = _param10_ | ||
| - | value[3] = p3 | ||
| - | |||
| - | [custom_tree_1_B] | ||
| - | |||
| - | name[1] = Counter1 | ||
| - | macro[1] = _param11_ | ||
| - | value[1] = c1 | ||
| - | |||
| - | name[2] = Counter1 | ||
| - | macro[2] = _param11_ | ||
| - | value[2] = c2 | ||
| - | |||
| - | name[3] = Counter1 | ||
| - | macro[3] = _param11_ | ||
| - | value[3] = c3 | ||
| - | |||
| - | </ | ||
| - | |||
| - | The following example can be used as a base for this block, since it includes all the parameters explained with comments for each case: | ||
| - | |||
| - | < | ||
| - | [CUSTOM_TREE_DATA_N] | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines the name for the tree element | ||
| - | ; Several names can be defined | ||
| - | |||
| - | name[N] = TEXT_N | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines if tree element is selectable or not | ||
| - | ; By default all tree elements are selectable | ||
| - | ; Several selectables can be defined | ||
| - | |||
| - | selectable[N] = VALUE_N | ||
| - | |||
| - | ; Optional if selectable is true | ||
| - | ; Defines the macro where value is stored for the tree element | ||
| - | ; Several macros can be defined | ||
| - | ; Same macro can be defined for several tree elements inside the same tree | ||
| - | ; Macro can't be the same as other outside the tree | ||
| - | ; If no macro is defined, value is stored for the global tree macro | ||
| - | ; Tree values are stored and used the same way as multiselect values do | ||
| - | |||
| - | macro[N] = FIELD_MACRO_N | ||
| - | |||
| - | ; Mandatory if selectable is true | ||
| - | ; Defines the value for the tree element | ||
| - | ; Several values can be defined | ||
| - | |||
| - | value[N] = VALUE_N | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines the children elements for the tree element | ||
| - | ; CUSTOM_TREE_DATA_M can't be the same than in an upper level | ||
| - | ; Several children can be defined | ||
| - | |||
| - | children[N] = CUSTOM_TREE_DATA_M | ||
| - | |||
| - | </ | ||
| - | |||
| - | === Selectors with Pandora FMS data === | ||
| - | |||
| - | Within the fields shown in the forms, the simple and multiple selectors have the possibility of using data from the Pandora FMS application itself. | ||
| - | |||
| - | Depending on the data that is wanted, the values that will be stored and those that will be used in the executions will vary: | ||
| - | |||
| - | * **agent_groups**: | ||
| - | * In the selector it will use the names of the agent groups. | ||
| - | * Will store your IDs as data. | ||
| - | * On executions it will check if the group ID exists, and if it exists it will use its name as value. Otherwise it will go empty. | ||
| - | * **agents**: | ||
| - | * In the selector it will use the aliases of the agents. | ||
| - | * Will store their names as data. | ||
| - | * In the runs will check if the agent exists, and if it does it will use its name as a value. Otherwise it will go empty. | ||
| - | * **module_groups**: | ||
| - | * In the selector you will use the module groups. | ||
| - | * Will store your IDs as data. | ||
| - | * On executions it will check if the group ID exists, and if it exists it will use its name as value. Otherwise it will go empty. | ||
| - | * **modules**: | ||
| - | * In the selector it will use the module names. | ||
| - | * Will store their names as data. | ||
| - | * In the executions it will check if a module with that name exists, and if it exists it will use its name as a value. Otherwise it will go empty. | ||
| - | * **module_types**: | ||
| - | * In the selector you will use the descriptions of module types. | ||
| - | * Will store their names as data. | ||
| - | * In executions it will use their names as values. | ||
| - | * **tags**: | ||
| - | * In the selector it will use the tags. | ||
| - | * Will store your IDs as data. | ||
| - | * In executions it will check if the tag ID exists, and if it exists it will use its name as value. Otherwise it will go empty. | ||
| - | * **status**: | ||
| - | * In the selector it will use the names of the module states. | ||
| - | * It will store your constants as data. | ||
| - | * In executions it will use the constants as values: | ||
| - | * **0**: Normal | ||
| - | * **2**: Warning | ||
| - | * **1**: Critical | ||
| - | * **3**: Unknown | ||
| - | * **5**: Not init | ||
| - | * **alert_templates**: | ||
| - | * In the selector it will use the names of the module templates. | ||
| - | * Will store your IDs as data. | ||
| - | * On execution it will check if the template id exists, and if it does it will use its name as the value. Otherwise it will go empty. | ||
| - | * **alert_actions**: | ||
| - | * In the selector it will use the names of the alert actions. | ||
| - | * Will store your IDs as data. | ||
| - | * In executions it will check if the action id exists, and if it exists it will use its name as value. Otherwise it will go empty. | ||
| - | * **interval**: | ||
| - | * In the selector you will use the interval selector. | ||
| - | * Will store time in seconds. | ||
| - | * In the executions it will use the time in seconds as value. | ||
| - | * **credentials.custom**: | ||
| - | * In the selector it will use the custom credential selector. | ||
| - | * Will store your IDs as data. | ||
| - | * In executions it will check if the credential id exists, and if it exists it will use a base64 of a JSON with the credential data as value. Otherwise it will go empty. | ||
| - | * The JSON for this type of credentials will have this format: | ||
| - | < | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | </ | ||
| - | * **credentials.aws**: | ||
| - | * In the picker you will use the AWS credential picker. | ||
| - | * Will store your IDs as data. | ||
| - | * In executions it will check if the credential id exists, and if it exists it will use a base64 of a JSON with the credential data as value. Otherwise it will go empty. | ||
| - | * The JSON for this type of credentials will have this format: | ||
| - | < | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | </ | ||
| - | * **credentials.azure**: | ||
| - | * In the picker you will use the Microsoft Azure credential picker. | ||
| - | * Will store your IDs as data. | ||
| - | * In executions it will check if the credential id exists, and if it exists it will use a base64 of a JSON with the credential data as value. Otherwise it will go empty. | ||
| - | * The JSON for this type of credentials will have this format: | ||
| - | < | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | </ | ||
| - | * **credentials.gcp**: | ||
| - | * In the picker you will use the Google Cloud Platform credential picker. | ||
| - | * Will store your IDs as data. | ||
| - | * In executions it will check if the credential id exists, and if it exists it will use a base64 of a JSON with the credential data as value. Otherwise it will go empty. | ||
| - | * The JSON for this type of credentials will have this format: | ||
| - | < | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | </ | ||
| - | * **credentials.sap**: | ||
| - | * In the selector you will use the SAP credential selector. | ||
| - | * Will store your IDs as data. | ||
| - | * In executions it will check if the credential id exists, and if it exists it will use a base64 of a JSON with the credential data as value. Otherwise it will go empty. | ||
| - | * The JSON for this type of credentials will have this format: | ||
| - | < | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | </ | ||
| - | * **credentials.snmp**: | ||
| - | * In the selector you will use the SNMP credential selector. | ||
| - | * Will store your IDs as data. | ||
| - | * On runs it will check if the credential id exists, and if it does it will use a base64 of a JSON with the data of the credentials as value. Otherwise it will go empty. | ||
| - | * The JSON for this type of credentials will have this format: | ||
| - | < | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | </ | ||
| - | * **credentials.wmi**: | ||
| - | * In the picker you will use the WMI credential picker. | ||
| - | * Will store your IDs as data. | ||
| - | * In executions it will check if the credential id exists, and if it exists it will use a base64 of a JSON with the credential data as value. Otherwise it will go empty. | ||
| - | * The JSON for this type of credentials will have this format: | ||
| - | < | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | </ | ||
| - | * **os**: | ||
| - | * In the selector it will use the names of the OS. | ||
| - | * Will store the IDs as data. | ||
| - | * On executions it will check if the OS ID exists, and if it exists it will use its name as the value. Otherwise it will go empty. | ||
| - | |||
| - | ===== Base file ===== | ||
| - | |||
| - | The following example can be used as a basis for creating **discovery_definition.ini** files, as it includes all the possible blocks and parameters explained above with comments for each case: | ||
| - | |||
| - | < | ||
| - | ; | ||
| - | ; DISCOVERY APPLICATION INI FILE BASE ; | ||
| - | ; | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines global application data | ||
| - | |||
| - | [discovery_extension_definition] | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines discovery application short name | ||
| - | ; Short name must be unique | ||
| - | ; Short names with " | ||
| - | |||
| - | short_name = DISCOVERY_APPLICATION_UNIQUE_NAME | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines the section where application will be shown in console | ||
| - | ; Possible values: | ||
| - | ; apps | ||
| - | ; clouds | ||
| - | ; custom | ||
| - | |||
| - | section = app | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines discovery application name, shown in console | ||
| - | |||
| - | name = DISCOVERY_APPLICATION_NAME | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines discovery application version, shown in console | ||
| - | |||
| - | version = VERSION | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines discovery application description, | ||
| - | |||
| - | description = DESCRIPTION | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines execution files inside .disk | ||
| - | ; Several execution files can be defined | ||
| - | |||
| - | execution_file[_EXEC_MACRO_N_] = SCRIPT.pl | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines execution for discovery server | ||
| - | ; Several executions can be defined | ||
| - | ; At least 1 is required for server execution | ||
| - | |||
| - | exec[] = SERVER_EXECUTION | ||
| - | |||
| - | ; Optional | ||
| - | ; Define password encrypt script | ||
| - | |||
| - | passencrypt_script = PASS_ENCRYPT_SCRIPT.pl | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines password encrypt script execution format | ||
| - | ; _passencrypt_script_ is replaced with the passencrypt_script file path | ||
| - | ; _password_ is replaced with the string (password) to encrypt | ||
| - | |||
| - | passencrypt_exec = EXECUTION | ||
| - | |||
| - | ; Optional | ||
| - | ; Define password decrypt script | ||
| - | |||
| - | passdecrypt_script = PASS_DECRYPT_SCRIPT.pl | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines password encrypt script execution format | ||
| - | ; _passdecrypt_script_ is replaced with the passdecrypt_script file path | ||
| - | ; _password_ is replaced with the string (password) to encrypt | ||
| - | |||
| - | passdecrypt_exec = EXECUTION | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines the default values for the fields when a new task is created | ||
| - | ; By default all values are empty or not selected | ||
| - | ; Several default values can be defined | ||
| - | ; Possible values depending on field type: | ||
| - | ; string - STRING | ||
| - | ; number - NUMBER | ||
| - | ; password-STRING | ||
| - | ; textarea-STRING | ||
| - | ; checkbox-BOOL | ||
| - | ; select-VALUE_N | ||
| - | ; multiselect - [VALUE_1, | ||
| - | ; tree - [VALUE_1, | ||
| - | |||
| - | default_value[_FIELD_MACRO_N_] = DEFAULT_VALUE | ||
| - | |||
| - | ; | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines application configuration steps | ||
| - | |||
| - | [config_steps] | ||
| - | |||
| - | ; Following parameters can be setup for each configuration step | ||
| - | ; Several steps can be defined using a different key (N) | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines configuration step name | ||
| - | |||
| - | name[N] = STEP_NAME | ||
| - | |||
| - | ; Mandatory if not custom_fields defined | ||
| - | ; Defines configuration fields retrieved to console by a command execution | ||
| - | ; execution_file scripts can be used to retrieve data | ||
| - | ; Command execution output must be JSON as follows | ||
| - | ; [ | ||
| - | ; { | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; }, | ||
| - | ; " | ||
| - | ; { | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; childin": | ||
| - | ; { | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; }, | ||
| - | ; { | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; } | ||
| - | ; ] | ||
| - | ; }, | ||
| - | ; { | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; " | ||
| - | ; } | ||
| - | ; ] | ||
| - | ; } | ||
| - | ; ] | ||
| - | |||
| - | script_data_fields[N] = CONSOLE_EXECUTION_FIELDS | ||
| - | |||
| - | ; Mandatory if not script_data_fields defined | ||
| - | ; Defines custom configuration fields | ||
| - | |||
| - | custom_fields[N] = CUSTOM_FIELDS_N | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines the number of fields columns for the configuration steps (1 or 2) | ||
| - | |||
| - | fields_columns[N] = M | ||
| - | |||
| - | ; | ||
| - | |||
| - | ; Mandatory if not script_data_fields defined | ||
| - | ; Defines custom configuration fields to be used by configuration steps | ||
| - | |||
| - | [CUSTOM_FIELDS_N] | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines configuration field unique macro | ||
| - | ; Macros can be used for script executions, using their value in place | ||
| - | |||
| - | macro[N] = _FIELD_MACRO_N_ | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines if configuration field is mandatory or not | ||
| - | ; By default all configuration fields are mandatory | ||
| - | |||
| - | mandatory_field[N] = BOOL | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines configuration field name to be displayed in console | ||
| - | ; Macro will be used as name if this field is empty | ||
| - | |||
| - | name[N] = FIELD_NAME | ||
| - | |||
| - | ; Optional | ||
| - | ; Define a tip for the field, to be displayed in console | ||
| - | |||
| - | tip[N] = FIELD_TIP | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines the field type to be displayed in console | ||
| - | ; Possible values: | ||
| - | ; string | ||
| - | ; number | ||
| - | ; password | ||
| - | ; textarea | ||
| - | ; check box | ||
| - | ; select | ||
| - | ; multi select | ||
| - | ; tree | ||
| - | |||
| - | type[N] = FIELD_TYPE | ||
| - | |||
| - | ; Optional if type is string or textarea | ||
| - | ; Defines a placeholder for the field, to be displayed in console | ||
| - | |||
| - | placeholder[N] = PLACEHOLDER | ||
| - | |||
| - | ; Optional | ||
| - | ; Field is shown in console only if assigned field macro exists, is checkbox and is true | ||
| - | |||
| - | show_on_true[N] = _FIELD_MACRO_N_ | ||
| - | |||
| - | ; Optional if type is password | ||
| - | ; Field value is encrypted when stored into database if assigned field macro exists, is checkbox and is true | ||
| - | ; Password encrypt and decrypt depends on scripts uploaded to the discovery application | ||
| - | |||
| - | encrypt_on_true[N] = _FIELD_MACRO_N_ | ||
| - | |||
| - | ; Mandatory if type is select or multiselect | ||
| - | ; Defines select data to be displayed in console | ||
| - | ; Possible values: | ||
| - | ; agent_groups - Uses agent groups names | ||
| - | ; agents - Uses agents names | ||
| - | ; module_groups - Uses module groups | ||
| - | ; modules - Uses modules names | ||
| - | ; module_types - Uses module types names | ||
| - | ; tags - Uses module tags | ||
| - | ; status - Uses module status names | ||
| - | ; alert_templates - Uses alert templates names | ||
| - | ; alert_actions - Uses alert actions names | ||
| - | ; interval - Uses time interval selector | ||
| - | ; credentials.custom - Uses pandora custom credentials selector | ||
| - | ; credentials.aws - Uses pandora AWS credentials selector | ||
| - | ; credentials.azure - Uses pandora Microsoft Azure credentials selector | ||
| - | ; credentials.gcp - Uses pandora Google Cloud Platform credentials selector | ||
| - | ; credentials.sap - Uses pandora SAP credentials selector | ||
| - | ; credentials.snmp - Uses pandora SNMP credentials selector | ||
| - | ; credentials.wmi - Uses pandora WMI credentials selector | ||
| - | ; os - Uses pandora OS names | ||
| - | ; CUSTOM_SELECT_N - Uses custom selector values | ||
| - | ; multiselect fields value is a comma separated list of selected values | ||
| - | |||
| - | select_data[N] = FIELD_DATA | ||
| - | |||
| - | ; Mandatory if type is tree | ||
| - | ; Defines tree data to be displayed in console | ||
| - | ; tree fields value is a comma separated list of selected values | ||
| - | |||
| - | tree_data[N] = CUSTOM_TREE_DATA_N | ||
| - | |||
| - | ; | ||
| - | |||
| - | ; Mandatory if custom tree defined | ||
| - | ; Defines custom tree values to be used by configuration fields | ||
| - | |||
| - | [CUSTOM_TREE_DATA_N] | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines the name for the tree element | ||
| - | ; Several names can be defined | ||
| - | |||
| - | name[N] = TEXT_N | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines if tree element is selectable or not | ||
| - | ; By default all tree elements are selectable | ||
| - | ; Several selectables can be defined | ||
| - | |||
| - | selectable[N] = VALUE_N | ||
| - | |||
| - | ; Optional if selectable is true | ||
| - | ; Defines the macro where value is stored for the tree element | ||
| - | ; Several macros can be defined | ||
| - | ; Same macro can be defined for several tree elements inside the same tree | ||
| - | ; Macro can't be the same as other outside the tree | ||
| - | ; If no macro is defined, value is stored for the global tree macro | ||
| - | ; Tree values are stored and used the same way as multiselect values do | ||
| - | |||
| - | macro[N] = FIELD_MACRO_N | ||
| - | |||
| - | ; Mandatory if selectable is true | ||
| - | ; Defines the value for the tree element | ||
| - | ; Several values can be defined | ||
| - | |||
| - | value[N] = VALUE_N | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines the children elements for the tree element | ||
| - | ; CUSTOM_TREE_DATA_M can't be the same than in an upper level | ||
| - | ; Several children can be defined | ||
| - | |||
| - | children[N] = CUSTOM_TREE_DATA_M | ||
| - | |||
| - | ; | ||
| - | |||
| - | ; Mandatory if custom select or multiselect defined | ||
| - | ; Defines custom select or multiselect values to be used by configuration fields | ||
| - | |||
| - | [CUSTOM_SELECT_N] | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines the value-text pair for the select or multiselect | ||
| - | ; Several value-text pairs can be defined | ||
| - | |||
| - | option[VALUE_N] = TEXT_N | ||
| - | |||
| - | ; | ||
| - | |||
| - | ; Optional | ||
| - | ; Defines temporary configuration files to be created and used during script executions | ||
| - | |||
| - | [tempfile_confs] | ||
| - | |||
| - | ; Mandatory | ||
| - | ; Defines the content for the temporary file | ||
| - | ; File will be used where temporary file macro is specified during executions | ||
| - | ; File content replaces fields macros with their values | ||
| - | |||
| - | file[_TEMP_FILE_MACRO_N_] = _FIELD_MACRO_N_, | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== Example ===== | ||
| - | |||
| - | Below we show an example of the **discovery_definition.ini** file and how its form would be displayed in the Pandora FMS console: | ||
| - | |||
| - | < | ||
| - | [discovery_extension_definition] | ||
| - | |||
| - | short_name = discoveryTest | ||
| - | section = custom | ||
| - | name = Discovery test | ||
| - | version=" | ||
| - | description = A test discovery plugin | ||
| - | |||
| - | execution_file[_exec1_] = test.py | ||
| - | |||
| - | exec[] = "' | ||
| - | |||
| - | passencrypt_script = pass_encrypter.py | ||
| - | passencrypt_exec = "' | ||
| - | |||
| - | passdecrypt_script = pass_encrypter.py | ||
| - | passencrypt_exec = "' | ||
| - | |||
| - | default_value[_param1_] = " | ||
| - | default_value[_param2_] = "" | ||
| - | default_value[_param3_] = false | ||
| - | default_value[_param4_] = 5 | ||
| - | default_value[_param5_] = 0 | ||
| - | default_value[_param6_] = v1 | ||
| - | default_value[_param7_] = true | ||
| - | default_value[_param8_] = " | ||
| - | default_value[_param9_] = "" | ||
| - | default_value[_param10_] = " | ||
| - | default_value[_param11_] = " | ||
| - | |||
| - | [config_steps] | ||
| - | |||
| - | name[1] = Configuration step | ||
| - | custom_fields[1] = custom_fields_1 | ||
| - | |||
| - | [tempfile_confs] | ||
| - | |||
| - | file[_tempConf_] = "user _param1_ | ||
| - | password _param2_ | ||
| - | encrypt_pass _param3_ | ||
| - | |||
| - | threads _param4_ | ||
| - | |||
| - | group _param5_ | ||
| - | |||
| - | mode _param6_ | ||
| - | extra_options _param7_ | ||
| - | extra_elements _param8_ | ||
| - | extra_perfs _param10_ | ||
| - | extra_counters _param11_ | ||
| - | |||
| - | log __temp__/ | ||
| - | |||
| - | _param9_" | ||
| - | |||
| - | [custom_fields_1] | ||
| - | |||
| - | macro[1] = _param1_ | ||
| - | name[1] = User | ||
| - | type[1] = string | ||
| - | |||
| - | macro[2] = _param2_ | ||
| - | name[2] = Password | ||
| - | type[2] = password | ||
| - | encrypt_on_true[2] = _param3_ | ||
| - | |||
| - | macro[3] = _param3_ | ||
| - | name[3] = Encrypt password | ||
| - | type[3] = checkbox | ||
| - | |||
| - | macro[4] = _param4_ | ||
| - | name[4] = Max threads | ||
| - | type[4] = number | ||
| - | mandatory_field[4] = false | ||
| - | |||
| - | macro[5] = _param5_ | ||
| - | name[5] = Agents group | ||
| - | tip[5] = Agents are generated in this group | ||
| - | type[5] = select | ||
| - | select_data[5] = agent_groups | ||
| - | |||
| - | macro[6] = _param6_ | ||
| - | name[6] = Mode | ||
| - | type[6] = select | ||
| - | select_data[6] = custom_select_1 | ||
| - | |||
| - | macro[7] = _param7_ | ||
| - | name[7] = Add extra options | ||
| - | type[7] = checkbox | ||
| - | |||
| - | macro[8] = _param8_ | ||
| - | name[8] = Extra elements | ||
| - | type[8] = tree | ||
| - | tree_data[8] = custom_tree_1 | ||
| - | show_on_true[8] = _param7_ | ||
| - | |||
| - | macro[9] = _param9_ | ||
| - | name[9] = Extra options | ||
| - | type[9] = textarea | ||
| - | placeholder[9] = "Add extra options here" | ||
| - | show_on_true[9] = _param7_ | ||
| - | |||
| - | [custom_select_1] | ||
| - | |||
| - | option[v1] = Value 1 | ||
| - | option[v2] = Value 2 | ||
| - | option[v3] = Value 3 | ||
| - | option[v4] = Value 4 | ||
| - | option[v5] = Value 5 | ||
| - | |||
| - | [custom_tree_1] | ||
| - | |||
| - | name[1] = Performance modules | ||
| - | selectable[1] = false | ||
| - | children[1] = custom_tree_1_A | ||
| - | |||
| - | name[2] = Counter modules | ||
| - | selectable[2] = false | ||
| - | children[2] = custom_tree_1_B | ||
| - | |||
| - | [custom_tree_1_A] | ||
| - | |||
| - | name[1] = Profile1 | ||
| - | selectable[1] = true | ||
| - | macro[1] = _param10_ | ||
| - | value[1] = p1 | ||
| - | |||
| - | name[2] = Perf2 | ||
| - | selectable[2] = true | ||
| - | macro[2] = _param10_ | ||
| - | value[2] = p2 | ||
| - | |||
| - | name[3] = Perf3 | ||
| - | selectable[3] = true | ||
| - | macro[3] = _param10_ | ||
| - | value[3] = p3 | ||
| - | |||
| - | [custom_tree_1_B] | ||
| - | |||
| - | name[1] = Counter1 | ||
| - | selectable[1] = true | ||
| - | macro[1] = _param11_ | ||
| - | value[1] = c1 | ||
| - | |||
| - | name[2] = Counter1 | ||
| - | selectable[2] = true | ||
| - | macro[2] = _param11_ | ||
| - | value[2] = c2 | ||
| - | |||
| - | name[3] = Counter1 | ||
| - | selectable[3] = true | ||
| - | macro[3] = _param11_ | ||
| - | value[3] = c3 | ||
| - | |||
| - | </ | ||
| - | |||
| - | With the definition above, when creating a task for the application, | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | The "Extra elements" | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | When this task is executed by the server, it generates a temporary file (for example ''/ | ||
| - | |||
| - | < | ||
| - | user admin | ||
| - | password MjZhYjBkYjkwZDcyZTI4YWQwYmExZTIyZWU1MTA1MTAgIC0K | ||
| - | encrypt_pass 1 | ||
| - | |||
| - | thread 2 | ||
| - | |||
| - | group Applications | ||
| - | |||
| - | mode v1 | ||
| - | extra_options 1 | ||
| - | extra_elements[] | ||
| - | extra_perfs[" | ||
| - | extra_counters[" | ||
| - | |||
| - | log / | ||
| - | |||
| - | </ | ||
| - | |||
| - | And which it would use during execution, which would be similar to this: | ||
| - | |||
| - | < | ||
| - | '/ | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== Scripts and executables ===== | ||
| - | |||
| - | The Pandora FMS server will be in charge of executing the scripts and executables defined in the '' | ||
| - | |||
| - | To determine the status, it will check the error code returned by each of the executions it performs. If at least one of the executions returns an error code other than '' | ||
| - | |||
| - | To show the summary of the task, for each of the executions carried out by the Pandora FMS server it will collect its output, both the standard output (STDOUT) and the error output (STDERR). Typically you would expect output in the following minimal JSON format: | ||
| - | |||
| - | < | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | }, | ||
| - | " | ||
| - | } | ||
| - | |||
| - | </ | ||
| - | |||
| - | In the console the **summary** key will be read as a two-column table, considering its keys as the elements on the left and its values as the elements on the right. | ||
| - | |||
| - | The **info** key will be read as additional information, | ||
| - | |||
| - | Any other key of the JSON or in case of not returning a JSON or one that does not comply with that structure, the rest of the information will be added in one more row in the summary table. | ||
| - | |||
| - | A summary table will be generated for each of the executions, listing them based on the order of executions performed by the server. In this way, the " | ||
| - | |||
| - | This is intended to ensure that the result of the last execution is visible in the console at all times, whether it was successful or failed. | ||
| - | |||
| - | Finally, apart from the actions carried out by the scripts or executables, | ||
| - | |||
| - | Thus, the expected JSON output format for **Discovery** plugins is this: | ||
| - | |||
| - | < | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | }, | ||
| - | " | ||
| - | " | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | }, | ||
| - | " | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | ] | ||
| - | } | ||
| - | ] | ||
| - | } | ||
| - | |||
| - | </ | ||