You may find more information about monitoring with remote server plugins [[:en:documentation:03_monitoring:03_remote_monitoring#monitoring_with_server_remote_plugins|here]]. There you will find simple exambles and how the modules and agents they contain work. In this article server plugin creation is analyzed in depth.
Said plugin, [[:en:documentation:03_monitoring:03_remote_monitoring#example_3_-_dns_server_remote_plug_in|among other uses]], allows for a web domain and its corresponding IP to be checked by a DNS server.
+
+
[[:ja:documentation:03_monitoring:03_remote_monitoring#例3dns_サーバリモートプラグイン|このプラグイン]]を使用すると、Webドメインとそれに対応する IP を DNS サーバでチェックできます。
+
+
* ''-i '': Known domain IP address.
+
* ''-d '': Corresponding web domain.
+
* ''-s '': DNS server for checking. Knowing these three parameters, proceed to [[:en:documentation:08_technical_reference:05_anexo_server_plugins_development#plugin_manual_registration|manually register]] a new plugin, add the name“New DNS Plugin” and in the description copy the previous summary and **in addition** indicate that it is necessary for the Module to retrive a false value (0) or true (1) for monitoring. This type of data is also known as boolean and in Pandora FMS it is called ''generic_proc ''.
+
In the section **Macro parameters **add three macro fields **field1**, **field2** and **field3**.
+
+
* ''-i '': 既知のドメインの IP アドレス。
+
* ''-d '': 対応する Web ドメイン。
+
* ''-s '': チェックする DNS サーバ。
+
+
これらの3つのパラメータで、新しいプラグインの[[:ja:documentation:08_technical_reference:05_anexo_server_plugins_development#プラグインの手動登録|手動登録]]に進み、"New DNS Plugin"
For ''_field1_'' add the description according to the ''-i'' parameter and so on for parameters ''-d '' and ''-s ''. Leave the values by **default** empty, type in in the **Help **of each one of them the text you wish.
<WRAP center round box 60%> \\ When this plugin is used within the module, the **DNS Plugin** will be executed replacing each of the fields by the parameters written on the Module. \\ </WRAP>
Macros work like **_field1_**, **_field2_**, (…), **_fieldN**_, but they host special values both from the Modules and the Agents those Modules contain.
Going back to the example of the previous section where the default values of the **_fieldN_** were left blank. Edit it for the default value of ''_field2_'' and add the macro ''_module_''.
The ''_module_'' macro returns the Module the plugin uses and will be added to the user or policy when said Module is created. To verify this, create a new Agent called "DNS verify" and a new Module through the option **Create a new plugin server module**:
+
+
''_module_'' マクロは、プラグインが使用するモジュールを返し、そのモジュールが作成されるときにユーザまたはポリシーに追加されます。 これを確認するには、"DNS verify" と呼ばれる新しいエージェントを作成し、 **プラグインサーバモジュールの新規作成(Create a new plugin server module)** オプションを使用して新しいモジュールを作成します。
新しいモジュールの編集フォームで、**プラグイン**で "New DNS Plugin" をリストから選択すると、''_module_'' マクロが次のように表示されます。
+
+
{{:wiki:pfms-resources-manage_agents-modules-create_new_plugin_server_module_2.png?750}}Rememeber to add that the type of data to be collected must be "Generic boolean" **and for the name of the new Module, just add the web domain whose IP address you are going to verify with a specified DNS server****.** Save it and check it works.
収集するデータのタイプは "Generic boolean" である必要があることを忘れないでください。また、 **新しいモジュールの名前、指定した DNS サーバで IP アドレスを確認する Web ドメインを追加します。** 保存して機能することを確認します。
+
+
The advantage of this method is that it will have both Modules and Web domains you need to check and they are easily identified in different components (Dashboards, reports, etc.) through its name.
+
+
この方法の良い点は、モジュールとしてチェックする必要のある Web ドメインがあり、名前によってさまざまなコンポーネント(ダッシュボード、レポートなど)で簡単に識別できることです。
+
+
=== マクロ一覧 ===
+
+
* ''_agent_'' : Agent alias to be used in the macro. If no alias is assigned, the name of the agent will be used.
+
* ''_agentalias_'' : Agent alias to be used in the macro.
+
* ''_agentdescription_'' : Description of the agent to be used in the macro.
+
* ''_agentstatus_'' : Current status of the Agent when used in the macro.
+
* ''_agentgroup_'' : Name of the Agent group to be used in the macro.
+
* ''_agentname_'' : Name of the Agent to be used in the macro (see also ''_agente_'' > ).
+
* ''_address_'' : Agent adress to be used in the macro.
+
* ''_module_'' : Name of the Module to be used in the macro.
+
* ''_modulegroup_'' : Name of the Module group to be used in the macro.
+
* ''_moduledescription_'' : Description of the module to be used in the macro.
+
* ''_modulestatus_'' : Status of the module to be used in the macro.
+
* ''_moduletags_'' : URL associated to the module tags.
+
* ''_id_module_'' : ID of the module to be used in the macro.
+
* ''_id_agente_'' : ID of the agent to be used in the macro, useful for building the URL of access to Pandora FMS console.
+
* ''_id_group'' : ID of the agent group to be used for the macro.
+
* ''_interval_'' : Interval of the modules execution to be used for the macro.
+
* ''_target_ip_'' : Target IP address of the module to be used for the macro.
+
* ''_target_port_'' : Target port of the module to be used for the macro.
+
* ''_policy_'' : Name of the policy the module belongs to (if it applies).
+
* ''_plugin_parameters_'' : Plugin parameters of the module to be used in the macro.
+
* ''_email_tag_'' : Email inboxes associated to the module tags.
+
* ''_phone_tag_'' : Phone numbers associated to the module tags.
+
* ''_name_tag_'' : Name of the tags associated to the module for the macro.
This is a [[https://en.wikipedia.org/wiki/INI_file|classic INI file]] with optional sections. The first section, the most important, is a fixed name section called ''plugin_definition'', and this is an example:
From Pandora FMS version 4, some PSPZ prior to parameter dynamic field creation for plugins and had fixed parameters, **will not work in new versions**.
Find more information about major and minor version update in [[https://prewebs.pandorafms.com/manual/en/documentation/02_installation/02_annex_upgrade|this link]].