差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
ja:documentation:08_technical_reference:11_pfms_plugis [2022/12/15 01:12] – [Upload a plugin to the library] junichi | ja:documentation:08_technical_reference:11_pfms_plugis [2022/12/15 01:31] – junichi | ||
---|---|---|---|
行 3: | 行 3: | ||
{{indexmenu_n> | {{indexmenu_n> | ||
- | [[ja: | + | [[:ja: |
===== 概要 ===== | ===== 概要 ===== | ||
行 44: | 行 43: | ||
* **Open**: Plugins with open license can be downloaded by any user without having to have an Enterprise license, these plugins are not usually compiled so it may be necessary to install certain dependencies for their use. | * **Open**: Plugins with open license can be downloaded by any user without having to have an Enterprise license, these plugins are not usually compiled so it may be necessary to install certain dependencies for their use. | ||
* **Enterprise**: | * **Enterprise**: | ||
- | |||
* **オープンソース**: | * **オープンソース**: | ||
* **Enterprise**: | * **Enterprise**: | ||
- | |||
By execution type: | By execution type: | ||
行 56: | 行 53: | ||
* エージェントプラグイン: | * エージェントプラグイン: | ||
- | * サーバプラグイン: | + | * サーバプラグイン: |
===== プラグインの見つけ方 ===== | ===== プラグインの見つけ方 ===== | ||
行 126: | 行 123: | ||
It is important to be clear about what solution you intend to achieve with the plugin. It could be monitoring a service of interest, managing to unify all data in Pandora FMS which can be an advantage in time or costs, or it can also be automating a process, such as a plugin that reads emails and with which an alarm can be activated when a certain message arrives. | It is important to be clear about what solution you intend to achieve with the plugin. It could be monitoring a service of interest, managing to unify all data in Pandora FMS which can be an advantage in time or costs, or it can also be automating a process, such as a plugin that reads emails and with which an alarm can be activated when a certain message arrives. | ||
- | プラグインで達成しようとしているソリューションを明確にすることが重要です。 関心のあるサービスを監視し、Pandora FMS ですべてのデータを統合することで、時間やコストの面で有利になる場合があります。また、プラグインにより電子メールを読み込んで特定のメッセージが到着したときアラームを鳴らすといった自動化をすることもできます。 | + | プラグインで達成しようとしているソリューションを明確にすることが重要です。 関心のあるサービスを監視し、Pandora FMS ですべてのデータを統合することで、時間やコストの面で有利になる場合があります。また、プラグインにより電子メールを読み込んで特定のメッセージが到着したときアラームを鳴らすといった自動化をすることもできます。 |
Plugins seek to solve a need or make interaction, | Plugins seek to solve a need or make interaction, | ||
行 200: | 行 197: | ||
If the plugin is written in python3, it will be necessary to have '' | If the plugin is written in python3, it will be necessary to have '' | ||
- | プラグインが python3 で記述されている場合、プラグインを使用するマシンに '' | + | プラグインが python3 で記述されている場合、プラグインを使用するマシンに '' |
One option, for plugins created in python is to provide a '' | One option, for plugins created in python is to provide a '' | ||
- | Python で作成されたプラグインでの一つのオプションとしては、プラグインで使用されるすべての依存関係をプラグインと共に '' | + | Python で作成されたプラグインでの一つのオプションとしては、プラグインで使用されるすべての依存関係をプラグインと共に '' |
Example of the plugin '' | Example of the plugin '' | ||
- | リモート MongoDB プラグインの '' | + | リモート MongoDB プラグインの '' |
< | < | ||
行 223: | 行 219: | ||
The file can be written by hand, but you may also generate a '' | The file can be written by hand, but you may also generate a '' | ||
- | このファイルは手動で作成できますが、'' | + | このファイルは手動で作成できますが、'' |
< | < | ||
行 247: | 行 243: | ||
In the case of python to create executables, | In the case of python to create executables, | ||
- | python で実行可能ファイルを作成する場合、'' | + | python で実行可能ファイルを作成する場合、'' |
<WRAP center round download 60%> | <WRAP center round download 60%> | ||
行 258: | 行 254: | ||
これは、次のコマンドでインストールできます。 | これは、次のコマンドでインストールできます。 | ||
- | |||
< | < | ||
行 285: | 行 280: | ||
A folder called '' | A folder called '' | ||
- | '' | + | '' |
It may be the case that a plugin that has been compiled on one operating system does not work on another, it is recommended to compile the plugins in CentOS 7, since the plugins compiled on this system usually work on all other GNU/Linux operating systems. | It may be the case that a plugin that has been compiled on one operating system does not work on another, it is recommended to compile the plugins in CentOS 7, since the plugins compiled on this system usually work on all other GNU/Linux operating systems. | ||
行 325: | 行 320: | ||
Python and perl have a tool developed by Pandora FMS that plugin creation easier called **Plugin Tools**, this tool has a lot of features designed to make plugin creation easier as well as automate it, so it can be a decisive advantage when choosing the right language. | Python and perl have a tool developed by Pandora FMS that plugin creation easier called **Plugin Tools**, this tool has a lot of features designed to make plugin creation easier as well as automate it, so it can be a decisive advantage when choosing the right language. | ||
- | Python と perl には、Pandora FMS によって開発された **Plugin Tools** と呼ばれるプラグイン作成を容易にするツールがあります。このツールには、プラグイン作成を容易にし、自動化するように設計された多くの機能があるため、言語を選択する際の決定的な利点となる可能性があります。 | + | Python と perl には、Pandora FMS によって開発された **Plugin Tools** |
==== テスト環境構築に便利なツール ==== | ==== テスト環境構築に便利なツール ==== | ||
行 348: | 行 343: | ||
他の XML ドキュメントと同様に、データファイルは XML 宣言で開始する必要があります。 | 他の XML ドキュメントと同様に、データファイルは XML 宣言で開始する必要があります。 | ||
- | |||
< | < | ||
+ | |||
<?xml version=' | <?xml version=' | ||
行 356: | 行 351: | ||
However, although the plugins and their data is based on XML, only the agent plugins will print an XML in a terminal execution, the server plugins only show a simple data, like a one, which will be the value that will contain the module that activates it, so the most normal thing in these cases is that it emits a '' | However, although the plugins and their data is based on XML, only the agent plugins will print an XML in a terminal execution, the server plugins only show a simple data, like a one, which will be the value that will contain the module that activates it, so the most normal thing in these cases is that it emits a '' | ||
- | ただし、プラグインとそのデータが XML に基づいているのはエージェントプラグインのみです。エージェントプラグインのみがターミナル実行で XML を出力します。サーバプラグインは単純なデータのみを表示します。サーバプラグインにおける最も基本的なことは、正常な場合は '' | + | ただし、プラグインとそのデータが XML に基づいているのはエージェントプラグインのみです。エージェントプラグインのみがターミナル実行で XML を出力します。サーバプラグインは単純なデータのみを表示します。サーバプラグインにおける最も基本的なことは、正常な場合は '' |
===== エージェントとモジュール ===== | ===== エージェントとモジュール ===== | ||
行 370: | 行 365: | ||
The element '' | The element '' | ||
- | データを送信するエージェントを定義する要素 '' | + | データを送信するエージェントを定義する要素 '' |
* '' | * '' | ||
行 388: | 行 383: | ||
* '' | * '' | ||
* '' | * '' | ||
- | |||
* '' | * '' | ||
* '' | * '' | ||
行 405: | 行 399: | ||
* '' | * '' | ||
* '' | * '' | ||
- | |||
XML heading example: | XML heading example: | ||
行 421: | 行 414: | ||
An module element is needed for each '' | An module element is needed for each '' | ||
- | 各 '' | + | 各 '' |
* **name**: Module name. | * **name**: Module name. | ||
行 462: | 行 455: | ||
* **module_parent**: | * **module_parent**: | ||
* **ff_type**: | * **ff_type**: | ||
- | |||
* **name**: モジュール名。 | * **name**: モジュール名。 | ||
* **description**: | * **description**: | ||
行 480: | 行 472: | ||
* **status**: モジュールの状態(NORMAL, | * **status**: モジュールの状態(NORMAL, | ||
* **datalist**: | * **datalist**: | ||
- | * **unit**: モジュールの単位。timeticks フォーマットを '' | + | * **unit**: モジュールの単位。timeticks フォーマットを '' |
* **timestamp**: | * **timestamp**: | ||
* **module_group**: | * **module_group**: | ||
行 502: | 行 494: | ||
* **module_parent**: | * **module_parent**: | ||
* **ff_type**: | * **ff_type**: | ||
- | |||
From Pandora FMS version 749, new tokens are available to force thresholds: | From Pandora FMS version 749, new tokens are available to force thresholds: | ||
行 515: | 行 506: | ||
* A module must have at least one name, type and data element. | * A module must have at least one name, type and data element. | ||
- | * **min_warning_forced**: | + | * **min_warning_forced**: |
- | * **max_warning_forced**: | + | * **max_warning_forced**: |
- | * **min_critical_forced**: | + | * **min_critical_forced**: |
- | * **max_critical_forced**: | + | * **max_critical_forced**: |
- | * **str_warning_forced**: | + | * **str_warning_forced**: |
- | * **str_critical_forced**: | + | * **str_critical_forced**: |
* モジュールには、少なくとも 1 つの名前、型、およびデータ要素が必要です。 | * モジュールには、少なくとも 1 つの名前、型、およびデータ要素が必要です。 | ||
行 526: | 行 517: | ||
例: | 例: | ||
- | |||
< | < | ||
行 550: | 行 540: | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | '' | + | '' |
</ | </ | ||
行 713: | 行 703: | ||
サーバプラグインを利用するための推奨パスは次のとおりです。 | サーバプラグインを利用するための推奨パスは次のとおりです。 | ||
- | < | ||
+ | < | ||
/ | / | ||
行 729: | 行 719: | ||
In plugin parameters enter them followed by the macro '' | In plugin parameters enter them followed by the macro '' | ||
- | プラグインパラメータでは、マクロ '' | + | プラグインパラメータでは、マクロ '' |
'' | '' | ||
- | {{ : | + | {{ : |
- | '' | + | '' |
- | '' | + | '' |
Once this is done, click on " | Once this is done, click on " | ||
行 759: | 行 749: | ||
If the module is displayed with '' | If the module is displayed with '' | ||
- | モジュールの値が '' | + | モジュールの値が '' |
{{ : | {{ : | ||
行 767: | 行 757: | ||
In order to monitor from Pandora FMS with an agent plugin, call it from the software agent '' | In order to monitor from Pandora FMS with an agent plugin, call it from the software agent '' | ||
- | エージェントプラグインを使用して Pandora FMS で監視するには、GNU/ | + | エージェントプラグインを使用して Pandora FMS で監視するには、GNU/ |
< | < | ||
+ | |||
/ | / | ||
行 776: | 行 766: | ||
The execution on the last conf line can be created with the '' | The execution on the last conf line can be created with the '' | ||
- | conf では '' | + | conf では '' |
Example of a possible plugin execution: | Example of a possible plugin execution: | ||
行 789: | 行 779: | ||
This can also be done from the console if remote configuration is enabled. [[: | This can also be done from the console if remote configuration is enabled. [[: | ||
- | リモート設定が有効になっている場合は、コンソールからも設定を行えます。 | + | リモート設定が有効になっている場合は、コンソールからも設定を行えます。 [[: |
- | [[: | + | |
{{ : | {{ : | ||
行 804: | 行 793: | ||
In many plugins it could be the case that many agents are created, such as the Xenserver plugin that creates an agent for each virtual server machine, but luckily you may define a prefix for the agents, in this case for example the prefix '' | In many plugins it could be the case that many agents are created, such as the Xenserver plugin that creates an agent for each virtual server machine, but luckily you may define a prefix for the agents, in this case for example the prefix '' | ||
- | 仮想サーバマシンごとにエージェントを作成する Xenserver プラグインなど、多くのプラグインでは複数のエージェントが作成される場合があります。この場合、エージェントのプレフィックスに例えば '' | + | 仮想サーバマシンごとにエージェントを作成する Xenserver プラグインなど、多くのプラグインでは複数のエージェントが作成される場合があります。この場合、エージェントのプレフィックスに例えば '' |
===== PSPZ2 ===== | ===== PSPZ2 ===== | ||
行 810: | 行 799: | ||
A **pspz2** | A **pspz2** | ||
- | **pspz2** ファイルは、プラグインとモジュールの定義を含む '' | + | **pspz2** |
{{ : | {{ : | ||
行 820: | 行 809: | ||
Example of '' | Example of '' | ||
- | プラグインの '' | + | プラグインの '' |
< | < | ||
行 855: | 行 843: | ||
**filename**: | **filename**: | ||
- | **filename**: | + | **filename**: |
**plugin_type**: | **plugin_type**: | ||
- | **plugin_type**: | + | **plugin_type**: |
**total_modules_provided**: | **total_modules_provided**: | ||
- | **total_modules_provided**: | + | **total_modules_provided**: |
**execution_command**: | **execution_command**: | ||
- | **execution_command**: | + | **execution_command**: |
**execution_postcommand**: | **execution_postcommand**: | ||
- | **execution_postcommand**: | + | **execution_postcommand**: |
**total_macros_provided**: | **total_macros_provided**: | ||
行 962: | 行 950: | ||
Once all the sections of the entry have been configured, such as the title, a description of the plugin, the compressed plugin in zip format, the documentation, | Once all the sections of the entry have been configured, such as the title, a description of the plugin, the compressed plugin in zip format, the documentation, | ||
- | タイトル、プラグインの説明、zip 形式で圧縮されたプラグイン、ドキュメント、カテゴリ、タグなど、エントリーのすべてのセクションを設定したら、**submit** をクリックしてプラグインを公開することができます。 | + | タイトル、プラグインの説明、zip 形式で圧縮されたプラグイン、ドキュメント、カテゴリ、タグなど、エントリーのすべてのセクションを設定したら、**submit** |
All plugins uploaded to the library are reviewed and need a review time, before their final release. | All plugins uploaded to the library are reviewed and need a review time, before their final release. | ||
行 974: | 行 962: | ||
{{ : | {{ : | ||
- | ===== Good practices to help review and maintain a plugin | + | ===== プラグインのレビューとメンテナンスに役立つグッドプラクティス |
Some good practices can help decrease the time spent on tasks, prevent and circumvent common errors during the different stages of the plugin creation process and plugin maintenance over time, and make their review easier. These can be: | Some good practices can help decrease the time spent on tasks, prevent and circumvent common errors during the different stages of the plugin creation process and plugin maintenance over time, and make their review easier. These can be: | ||
+ | |||
+ | いくつかのグッドプラクティスは、タスクに費やす時間を減らし、プラグインの作成プロセスやプラグインのメンテナンスのさまざまな段階でよくあるエラーを防止・回避し、それらのレビューを容易にするのに役立ちます。これらは以下の通りです。 | ||
* Leaving a good previous configuration well documented in case it is necessary to make some previous configurations on the system on the plugin itself. | * Leaving a good previous configuration well documented in case it is necessary to make some previous configurations on the system on the plugin itself. | ||
行 984: | 行 974: | ||
* Testing your code. It is important to test the plugin' | * Testing your code. It is important to test the plugin' | ||
- | [[ja: | + | * システム上でこれまで行ったことのあるプラグインの設定を行う必要がある場合に備えて、正しく動作する設定を十分に文書化して残しておくこと。 |
+ | * プラグインの使い方をイメージしやすいように、実際に実行した例をドキュメント化すること。 | ||
+ | * プラグインのコードにコメントを書くことで、より深く、あるいはより速く理解することができます。 | ||
+ | * コードの読みやすさを優先します。複雑であればあるほど、それに対処するための時間とリソースが必要になります。 | ||
+ | * コードのテストをします。プラグインの動作をテストして、すべてが問題ないことを確認することが重要です。エラーを時間内に発見して修正することで、将来的な問題を回避することができます。 | ||
+ | |||
+ | [[:ja: | ||