差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
ja:documentation:08_technical_reference:11_pfms_plugis [2022/12/14 05:50] – [Server plugins] 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 '' | ||
- | モジュールの値が '' | + | モジュールの値が '' |
{{ : | {{ : | ||
- | ==== Agent plugin | + | ==== エージェントプラグイン |
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/ | ||
< | < | ||
+ | |||
/ | / | ||
行 773: | 行 765: | ||
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 では '' | ||
Example of a possible plugin execution: | Example of a possible plugin execution: | ||
+ | |||
+ | プラグイン実行の例: | ||
< | < | ||
行 782: | 行 778: | ||
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. [[: | ||
+ | |||
+ | リモート設定が有効になっている場合は、コンソールからも設定を行えます。 [[: | ||
{{ : | {{ : | ||
- | ===== Displaying the plugin in Pandora FMS ===== | + | ===== Pandora FMS でのプラグインの表示 |
The display of the plugin data is usually done from the agents view. The data structure is usually defined by agents and modules so it is normal for the plugin to create agents and modules within them, so these data can be displayed in the view menu of the agent itself. | The display of the plugin data is usually done from the agents view. The data structure is usually defined by agents and modules so it is normal for the plugin to create agents and modules within them, so these data can be displayed in the view menu of the agent itself. | ||
+ | |||
+ | プラグインデータの表示は通常、エージェント表示から行われます。 通常、データ構造はエージェントとモジュールにて定義されるため、プラグインがエージェントとモジュールを作成するのは普通のことです。したがって、これらのデータはエージェント自体の表示メニューに表示できます。 | ||
{{ : | {{ : | ||
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 プラグインなど、多くのプラグインでは複数のエージェントが作成される場合があります。この場合、エージェントのプレフィックスに例えば '' | ||
===== PSPZ2 ===== | ===== PSPZ2 ===== | ||
A **pspz2** | A **pspz2** | ||
+ | |||
+ | **pspz2** | ||
{{ : | {{ : | ||
This file format is very useful when packaging plugins, as it simplifies their installation. Using this format, plugins can be installed more quickly in Pandora FMS console from the " | This file format is very useful when packaging plugins, as it simplifies their installation. Using this format, plugins can be installed more quickly in Pandora FMS console from the " | ||
+ | |||
+ | このファイル形式は、プラグインのインストールを簡素化するため、プラグインをパッケージ化するときに非常に便利です。 この形式を使用すると、Pandora FMS コンソールの " | ||
Example of '' | Example of '' | ||
+ | |||
+ | プラグインの '' | ||
< | < | ||
行 834: | 行 842: | ||
**filename**: | **filename**: | ||
+ | |||
+ | **filename**: | ||
**plugin_type**: | **plugin_type**: | ||
+ | |||
+ | **plugin_type**: | ||
**total_modules_provided**: | **total_modules_provided**: | ||
+ | |||
+ | **total_modules_provided**: | ||
**execution_command**: | **execution_command**: | ||
+ | |||
+ | **execution_command**: | ||
**execution_postcommand**: | **execution_postcommand**: | ||
+ | |||
+ | **execution_postcommand**: | ||
**total_macros_provided**: | **total_macros_provided**: | ||
+ | |||
+ | **total_macros_provided**: | ||
**macro_****_value**: | **macro_****_value**: | ||
+ | |||
+ | **macro_****_value**: | ||
And it must create a section for each dynamic macro, for example: | And it must create a section for each dynamic macro, for example: | ||
+ | |||
+ | また、動的マクロごとにセクションを作成しなければいけません。例: | ||
< | < | ||
行 858: | 行 882: | ||
</ | </ | ||
- | ===== Compatibility | + | ===== 互換性 |
It is important for the plugin to have as much compatibility as possible. Certain plugins are unique to services that can only be exploited on a given operating system, such as MS Windows®. But within the inevitable limitations it is important to give the plugin a compatibility that covers as many scenarios as possible. | It is important for the plugin to have as much compatibility as possible. Certain plugins are unique to services that can only be exploited on a given operating system, such as MS Windows®. But within the inevitable limitations it is important to give the plugin a compatibility that covers as many scenarios as possible. | ||
+ | |||
+ | プラグインはできるだけ互換性を持たせることが重要です。ある種のプラグインは、MS Windows® のような特定の OS でしか利用できないサービス特有のものであったりします。しかし、避けられない制限の中で、できるだけ多くのシナリオをカバーできる互換性をプラグインに持たせることが重要です。 | ||
Certain operating systems have packages that do not exist in others, which can lead to errors in the execution of a compiled plugin, so it is advisable to compile the plugins on a machine with CentOS 7 operating system that has all the necessary plugin dependencies installed. | Certain operating systems have packages that do not exist in others, which can lead to errors in the execution of a compiled plugin, so it is advisable to compile the plugins on a machine with CentOS 7 operating system that has all the necessary plugin dependencies installed. | ||
- | ===== Error control | + | OSによっては、他の OS には存在しないパッケージがあり、コンパイルしたプラグインの実行でエラーが発生することがあるため、必要なプラグインの依存関係がすべてインストールされている CentOS 7 OS の環境でプラグインをコンパイルすることをお勧めします。 |
+ | |||
+ | ===== エラー制御 | ||
Having good error control can help maintain the plugin over time, as it can help detect potential future errors in the plugin and locate them more quickly. | Having good error control can help maintain the plugin over time, as it can help detect potential future errors in the plugin and locate them more quickly. | ||
+ | |||
+ | 適切なエラー制御を行うと、プラグインの潜在的な将来起こりうるエラーを検出し、迅速に原因を見つけることができるため、長期にわたってプラグインを維持するのに役立ちます。 | ||
It can also help to detect what the error is accurately, since without error control in certain cases the error output may be too generic and it may be difficult to figure out what the problem is. | It can also help to detect what the error is accurately, since without error control in certain cases the error output may be too generic and it may be difficult to figure out what the problem is. | ||
- | ==== Plugin tests and validation | + | また、エラーを正確に検出するのにも役立ちます。エラー制御がないと、特定のケースではエラー出力があまりにも一般的になり、問題が何であるかを理解するのが難しくなる可能性があるためです。 |
+ | |||
+ | ==== プラグインのテストと検証 | ||
Once the plugin has been developed, it is suitable to perform tests in environments to check its operation, in fact it would be great to be able to test it in more than one test environment. | Once the plugin has been developed, it is suitable to perform tests in environments to check its operation, in fact it would be great to be able to test it in more than one test environment. | ||
+ | |||
+ | プラグインを開発したら、環境でテストを実行してその動作を確認すると良いです。複数のテスト環境でテストできると良いです。 | ||
A good testing process can help to solve possible errors and to make the plugin' | A good testing process can help to solve possible errors and to make the plugin' | ||
- | ==== Plugin launching | + | 良いテストプロセスは、起こりうるエラーを解決し、長期にわたってプラグインの動作をより強固にするのに役立ちます。よく言われる「転ばぬ先の杖」です。 |
+ | |||
+ | ==== プラグインの公開 | ||
When publishing the plugin, it is important to take certain aspects into account. | When publishing the plugin, it is important to take certain aspects into account. | ||
- | === Plugin documentation | + | プラグインを公開する際には、ある点を考慮することが重要です。 |
+ | |||
+ | === プラグインのドキュメント | ||
Using some plugins could be at first difficult to understand. Some may have several options and it can be a bit hard to understand them. | Using some plugins could be at first difficult to understand. Some may have several options and it can be a bit hard to understand them. | ||
+ | |||
+ | プラグインの中には、最初は理解しにくいものがあります。いくつかのプラグインにはいくつかのオプションがあり、それらを理解するのは少し難しいかもしれません。 | ||
Good documentation can help you understand it, it can even be useful for plugin creators themselves in the future, to help them remember certain things about the plugin that they may have forgotten over time. | Good documentation can help you understand it, it can even be useful for plugin creators themselves in the future, to help them remember certain things about the plugin that they may have forgotten over time. | ||
+ | |||
+ | 良いドキュメントは、それを理解するのに役立ちますし、将来的にはプラグイン制作者自身が、時間が経つにつれて忘れてしまったプラグインのある事柄を思い出すのに役立つことさえあります。 | ||
Pandora FMS has a system of online quick guides that makes documentation maintenance easier, which can be accessed from the following link: | Pandora FMS has a system of online quick guides that makes documentation maintenance easier, which can be accessed from the following link: | ||
+ | |||
+ | Pandora FMS には、ドキュメントのメンテナンスを容易にするためのオンラインクイックガイドのシステムがあり、以下のリンクからアクセスできます。 | ||
<WRAP center round download 60%> | <WRAP center round download 60%> | ||
- | [[https:// | + | [[https:// |
</ | </ | ||
- | === Upload a plugin to the library | + | クイックガイド形式のドキュメントに代わるものとして、PDF 形式のものもあります。 |
+ | |||
+ | === ライブラリへのプラグインのアップロード | ||
The process when uploading a plugin to Pandora FMS library is very simple. Just access the " | The process when uploading a plugin to Pandora FMS library is very simple. Just access the " | ||
+ | |||
+ | Pandora FMS ライブラリにプラグインをアップロードする方法は非常に簡単です。ライブラリの "my plugins" | ||
{{ : | {{ : | ||
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** | ||
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. | ||
+ | |||
+ | ライブラリにアップロードされたすべてのプラグインは、最終的なリリース前にレビューが行われます。レビュー時間がかかります。 | ||
Once the plugin is published, it will appear in the " | Once the plugin is published, it will appear in the " | ||
+ | |||
+ | プラグインが公開されると、" | ||
{{ : | {{ : | ||
- | ===== 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. | ||
行 918: | 行 974: | ||
* Testing your code. It is important to test the plugin' | * Testing your code. It is important to test the plugin' | ||
- | [[ja: | + | * システム上でこれまで行ったことのあるプラグインの設定を行う必要がある場合に備えて、正しく動作する設定を十分に文書化して残しておくこと。 |
+ | * プラグインの使い方をイメージしやすいように、実際に実行した例をドキュメント化すること。 | ||
+ | * プラグインのコードにコメントを書くことで、より深く、あるいはより速く理解することができます。 | ||
+ | * コードの読みやすさを優先します。複雑であればあるほど、それに対処するための時間とリソースが必要になります。 | ||
+ | * コードのテストをします。プラグインの動作をテストして、すべてが問題ないことを確認することが重要です。エラーを時間内に発見して修正することで、将来的な問題を回避することができます。 | ||
+ | |||
+ | [[:ja: | ||