差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:documentation:pandorafms:technical_reference:11_pfms_plugis [2024/09/07 22:11] – [サーバプラグイン] junichi | ja:documentation:pandorafms:technical_reference:11_pfms_plugis [2024/12/21 23:12] (現在) – [モジュールのタイムスタンプ] junichi | ||
---|---|---|---|
行 7: | 行 7: | ||
===== 概要 ===== | ===== 概要 ===== | ||
- | This plugin development guide contains documentation for users who want to create their own plugins. Use this documentation to learn how to create plugins that solve your business needs. | + | This plugin development guide contains documentation for users who wish to create their own plugins. Use this documentation to learn how to create plugins that solve your business needs. |
このプラグイン開発ガイドには、独自のプラグインを作成したいユーザ向けのドキュメントが含まれています。 このドキュメントを使用して、ビジネスニーズを解決するプラグインを作成する方法を学習してください。 | このプラグイン開発ガイドには、独自のプラグインを作成したいユーザ向けのドキュメントが含まれています。 このドキュメントを使用して、ビジネスニーズを解決するプラグインを作成する方法を学習してください。 | ||
行 23: | 行 23: | ||
プラグインを使用すると、Pandora FMS の機能を拡張できます。これにより、新しい監視オプションを開発する際にさまざまな可能性が提供されます。 | プラグインを使用すると、Pandora FMS の機能を拡張できます。これにより、新しい監視オプションを開発する際にさまざまな可能性が提供されます。 | ||
- | With them you could integrate service, application or database monitoring among others and much more, they can even be used to modify or automate tasks and processes. | + | By means of their use you may integrate service, application or database monitoring, among others, and much more, they can even be used to modify or automate tasks and processes. |
それらを使用すると、サービス、アプリケーション、またはデータベースの監視などを統合でき、タスクや処理を変更または自動化するために使用することもできます. | それらを使用すると、サービス、アプリケーション、またはデータベースの監視などを統合でき、タスクや処理を変更または自動化するために使用することもできます. | ||
行 87: | 行 87: | ||
===== プラグインのライフサイクル ===== | ===== プラグインのライフサイクル ===== | ||
- | {{ : | + | [[: |
===== プラグインの計画 ===== | ===== プラグインの計画 ===== | ||
行 254: | 行 254: | ||
<code bash> | <code bash> | ||
pyinstaller –onefile < plugin_name >.py | pyinstaller –onefile < plugin_name >.py | ||
+ | |||
</ | </ | ||
行 288: | 行 289: | ||
プラグインは、データや Pandora FMS の追加機能を統合するスクリプトです。これらは小さなプログラムであるため、開発するには、フレームワークまたは Visual Studio Code などのコードエディタが必要です。 | プラグインは、データや Pandora FMS の追加機能を統合するスクリプトです。これらは小さなプログラムであるため、開発するには、フレームワークまたは Visual Studio Code などのコードエディタが必要です。 | ||
- | {{ : | + | [[: |
In turn, tools such as github or gitlab can help preserve and maintain the code of the plugins created. | In turn, tools such as github or gitlab can help preserve and maintain the code of the plugins created. | ||
行 314: | 行 315: | ||
プラグインの開発には、通常、監視するサービスのインストール、アカウントなどのテスト環境が必要です。速度とシンプルさから環境作成に役立つ 2 つの技術としては、docker と vagrant があります。 もちろん、テストしたいサービスのプロジェクトでソリューションを用意する必要がありますが、いくつかのコマンドまたは小さな構成のみで実行できます。 | プラグインの開発には、通常、監視するサービスのインストール、アカウントなどのテスト環境が必要です。速度とシンプルさから環境作成に役立つ 2 つの技術としては、docker と vagrant があります。 もちろん、テストしたいサービスのプロジェクトでソリューションを用意する必要がありますが、いくつかのコマンドまたは小さな構成のみで実行できます。 | ||
+ | <wrap #ks11 /> | ||
===== XML ===== | ===== XML ===== | ||
行 331: | 行 333: | ||
<code xml> | <code xml> | ||
<?xml version=' | <?xml version=' | ||
+ | |||
</ | </ | ||
行 337: | 行 340: | ||
ただし、プラグインとそのデータが XML に基づいているのはエージェントプラグインのみです。エージェントプラグインのみがターミナル実行で XML を出力します。サーバプラグインは単純なデータのみを表示します。サーバプラグインにおける最も基本的なことは、正常な場合は '' | ただし、プラグインとそのデータが XML に基づいているのはエージェントプラグインのみです。エージェントプラグインのみがターミナル実行で XML を出力します。サーバプラグインは単純なデータのみを表示します。サーバプラグインにおける最も基本的なことは、正常な場合は '' | ||
+ | |||
+ | <wrap #ks12 /> | ||
===== エージェントとモジュール ===== | ===== エージェントとモジュール ===== | ||
行 346: | 行 351: | ||
The xml structure of agents and modules have different attributes for configuring them. | The xml structure of agents and modules have different attributes for configuring them. | ||
- | エージェントとモジュールの xml 構造には、それらを構成するためのさまざまな属性があります。 | + | エージェントとモジュールの |
+ | |||
+ | |||
+ | ==== エージェント ==== | ||
The element '' | The element '' | ||
行 358: | 行 366: | ||
* '' | * '' | ||
* '' | * '' | ||
- | * '' | + | * '' |
* '' | * '' | ||
* '' | * '' | ||
行 368: | 行 376: | ||
* '' | * '' | ||
* '' | * '' | ||
- | |||
* '' | * '' | ||
* '' | * '' | ||
行 385: | 行 392: | ||
* '' | * '' | ||
* '' | * '' | ||
- | XML heading example: | + | ==== XML ヘッダ例 |
- | + | ||
- | XML ヘッダ例: | + | |
<code xml> | <code xml> | ||
行 395: | 行 400: | ||
address=' | address=' | ||
url_address=' | url_address=' | ||
+ | |||
</ | </ | ||
+ | |||
+ | <wrap #ks12_3 /> | ||
+ | |||
+ | ==== モジュール ==== | ||
An module element is needed for each '' | An module element is needed for each '' | ||
- | 各 '' | + | 各 '' |
+ | |||
+ | <WRAP group> \\ <WRAP half column> | ||
* **name**: Module name. | * **name**: Module name. | ||
行 416: | 行 428: | ||
* **max_warning**: | * **max_warning**: | ||
* **disabled**: | * **disabled**: | ||
- | * **min_ff_event**: | + | * **min_ff_event**: |
* **status**: Module status (NORMAL, WARNING or CRITICAL). Critical and alert status limits are ignored if the status is specified. | * **status**: Module status (NORMAL, WARNING or CRITICAL). Critical and alert status limits are ignored if the status is specified. | ||
* **datalist**: | * **datalist**: | ||
* **unit**: Module unit. It supports '' | * **unit**: Module unit. It supports '' | ||
- | * **timestamp**: | + | * **timestamp**: |
* **module_group**: | * **module_group**: | ||
* **custom_id**: | * **custom_id**: | ||
行 426: | 行 438: | ||
* **str_critical**: | * **str_critical**: | ||
* **critical_instructions**: | * **critical_instructions**: | ||
+ | </ | ||
+ | |||
+ | <WRAP half column> | ||
+ | |||
* **warning_instructions**: | * **warning_instructions**: | ||
* **unknown_instructions**: | * **unknown_instructions**: | ||
行 441: | 行 457: | ||
* **module_parent**: | * **module_parent**: | ||
* **ff_type**: | * **ff_type**: | ||
+ | * **min_warning_forced**: | ||
+ | * **max_warning_forced**: | ||
+ | * **min_critical_forced**: | ||
+ | * **max_critical_forced**: | ||
+ | * **str_warning_forced**: | ||
+ | * **str_critical_forced**: | ||
+ | </ | ||
+ | |||
+ | <WRAP group> \\ <WRAP half column> | ||
* **name**: モジュール名。 | * **name**: モジュール名。 | ||
* **description**: | * **description**: | ||
行 455: | 行 480: | ||
* **max_warning**: | * **max_warning**: | ||
* **disabled**: | * **disabled**: | ||
- | * **min_ff_event**: | + | * **min_ff_event**: |
* **status**: モジュールの状態(NORMAL, | * **status**: モジュールの状態(NORMAL, | ||
* **datalist**: | * **datalist**: | ||
* **unit**: モジュールの単位。timeticks フォーマットを '' | * **unit**: モジュールの単位。timeticks フォーマットを '' | ||
- | * **timestamp**: | + | * **timestamp**: |
* **module_group**: | * **module_group**: | ||
* **custom_id**: | * **custom_id**: | ||
行 465: | 行 490: | ||
* **str_critical**: | * **str_critical**: | ||
* **critical_instructions**: | * **critical_instructions**: | ||
+ | </ | ||
+ | <WRAP half column> | ||
* **warning_instructions**: | * **warning_instructions**: | ||
* **unknown_instructions**: | * **unknown_instructions**: | ||
行 480: | 行 507: | ||
* **module_parent**: | * **module_parent**: | ||
* **ff_type**: | * **ff_type**: | ||
- | From Pandora FMS version 749, new tokens are available to force thresholds: | ||
- | |||
- | Pandora FMS バージョン 749 から、しきい値を強制するための新しいトークンが利用可能になりました。 | ||
- | |||
- | * **min_warning_forced**: | ||
- | * **max_warning_forced**: | ||
- | * **min_critical_forced**: | ||
- | * **max_critical_forced**: | ||
- | * **str_warning_forced**: | ||
- | * **str_critical_forced**: | ||
- | * A module must have at least one name, type and data element. | ||
- | |||
* **min_warning_forced**: | * **min_warning_forced**: | ||
* **max_warning_forced**: | * **max_warning_forced**: | ||
行 498: | 行 513: | ||
* **str_warning_forced**: | * **str_warning_forced**: | ||
* **str_critical_forced**: | * **str_critical_forced**: | ||
- | * モジュールには、少なくとも 1 つの名前、型、およびデータ要素が必要です。 | + | </ |
+ | |||
+ | <wrap #ks12_4 /> | ||
+ | |||
+ | ==== モジュールの要素 | ||
+ | |||
+ | A module must have at least one name, type and data element. | ||
- | For instance: | + | モジュールには、少なくとも 1 つの名前、型、およびデータ要素が必要です。 |
- | 例: | ||
<code xml> | <code xml> | ||
< | < | ||
行 510: | 行 530: | ||
< | < | ||
</ | </ | ||
+ | |||
</ | </ | ||
行 517: | 行 538: | ||
XML データ ファイルには、任意の数の要素を含めることができます。 | XML データ ファイルには、任意の数の要素を含めることができます。 | ||
- | <WRAP center round important | + | <WRAP center round important |
Do not forget to close the tag '' | Do not forget to close the tag '' | ||
行 523: | 行 544: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
- | '' | + | '' |
</ | </ | ||
+ | |||
+ | <wrap #ks12_5 /> | ||
+ | |||
+ | ==== リストタイプモジュール ==== | ||
There are also list modules, which instead of having only one value may contain several, these are useful for string values. The datalist tag should be used in this type of modules as you see in the following example: | There are also list modules, which instead of having only one value may contain several, these are useful for string values. The datalist tag should be used in this type of modules as you see in the following example: | ||
行 543: | 行 568: | ||
</ | </ | ||
</ | </ | ||
+ | |||
</ | </ | ||
+ | |||
+ | <wrap #ks12_6 /> | ||
+ | |||
+ | ==== モジュールのタイムスタンプ ==== | ||
A time stamp can be specified for each value: | A time stamp can be specified for each value: | ||
行 567: | 行 597: | ||
</ | </ | ||
</ | </ | ||
+ | |||
</ | </ | ||
- | Some more examples that include the use of thresholds and units: | + | <wrap #ks12_7 /> |
+ | |||
+ | ==== しきい値と単位 ==== | ||
+ | |||
+ | More examples that include the use of thresholds and units: | ||
しきい値と単位の指定を含むその他の例: | しきい値と単位の指定を含むその他の例: | ||
行 597: | 行 632: | ||
< | < | ||
</ | </ | ||
+ | |||
</ | </ | ||
行 643: | 行 679: | ||
通常、プラグインで非常に便利なもう 1 つのオプションは、パラメータをヘルプに含めて、すべてのプラグインオプションとパラメータ、およびその設定方法を表示することです。 これは、ソフトウェアに含まれるプラグインに関する小さなデジタルドキュメントのようなものです。 | 通常、プラグインで非常に便利なもう 1 つのオプションは、パラメータをヘルプに含めて、すべてのプラグインオプションとパラメータ、およびその設定方法を表示することです。 これは、ソフトウェアに含まれるプラグインに関する小さなデジタルドキュメントのようなものです。 | ||
- | |||
===== Pandora FMS プラグイン設定 ===== | ===== Pandora FMS プラグイン設定 ===== | ||
行 657: | 行 692: | ||
サーバプラグインを使用して Pandora FMS から監視するには、サーバメニューの " | サーバプラグインを使用して Pandora FMS から監視するには、サーバメニューの " | ||
- | {{ : | + | [[: |
Click on " | Click on " | ||
行 670: | 行 705: | ||
The recommended path for using server plugins is: | The recommended path for using server plugins is: | ||
+ | < | ||
- | < | ||
/ | / | ||
</ | </ | ||
- | |||
- | \\ | ||
</ | </ | ||
行 688: | 行 721: | ||
</ | </ | ||
- | |||
- | \\ | ||
</ | </ | ||
行 697: | 行 728: | ||
プラグインパスには、コマンドを入力する必要があります。 | プラグインパスには、コマンドを入力する必要があります。 | ||
- | {{ : | + | [[: |
In plugin parameters enter them followed by the macro '' | In plugin parameters enter them followed by the macro '' | ||
行 705: | 行 736: | ||
'' | '' | ||
- | {{ | + | [[: |
'' | '' | ||
- | {{ : | + | [[: |
'' | '' | ||
- | {{ : | + | [[: |
Once this is done, click on " | Once this is done, click on " | ||
行 759: | 行 790: | ||
リモート設定が有効になっている場合は、コンソールからも設定を行えます。 [[: | リモート設定が有効になっている場合は、コンソールからも設定を行えます。 [[: | ||
- | {{ : | + | [[: |
===== Pandora FMS でのプラグインの表示 ===== | ===== Pandora FMS でのプラグインの表示 ===== | ||
行 767: | 行 798: | ||
プラグインデータの表示は通常、エージェント表示から行われます。 通常、データ構造はエージェントとモジュールにて定義されるため、プラグインがエージェントとモジュールを作成するのは普通のことです。したがって、これらのデータはエージェント自体の表示メニューに表示できます。 | プラグインデータの表示は通常、エージェント表示から行われます。 通常、データ構造はエージェントとモジュールにて定義されるため、プラグインがエージェントとモジュールを作成するのは普通のことです。したがって、これらのデータはエージェント自体の表示メニューに表示できます。 | ||
- | {{ : | + | [[: |
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 '' | ||
行 779: | 行 810: | ||
**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 " | ||
行 866: | 行 897: | ||
プラグインはできるだけ互換性を持たせることが重要です。ある種のプラグインは、MS Windows® のような特定の OS でしか利用できないサービス特有のものであったりします。しかし、避けられない制限の中で、できるだけ多くのシナリオをカバーできる互換性をプラグインに持たせることが重要です。 | プラグインはできるだけ互換性を持たせることが重要です。ある種のプラグインは、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 | + | 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 Rocky Linux 7 operating system that has all the necessary plugin dependencies installed. |
- | OSによっては、他の OS には存在しないパッケージがあり、コンパイルしたプラグインの実行でエラーが発生することがあるため、必要なプラグインの依存関係がすべてインストールされている | + | OSによっては、他の OS には存在しないパッケージがあり、コンパイルしたプラグインの実行でエラーが発生することがあるため、必要なプラグインの依存関係がすべてインストールされている |
===== エラー制御 ===== | ===== エラー制御 ===== | ||
行 910: | 行 941: | ||
Pandora FMS には、ドキュメントのメンテナンスを容易にするためのオンラインクイックガイドのシステムがあり、以下のリンクからアクセスできます。 | Pandora FMS には、ドキュメントのメンテナンスを容易にするためのオンラインクイックガイドのシステムがあり、以下のリンクからアクセスできます。 | ||
- | <WRAP center round download | + | <WRAP center round download |
[[https:// | [[https:// | ||
- | </ | + | </ |
+ | |||
+ | The alternative to the documentation in quick-guide format is the PDF format. | ||
クイックガイド形式のドキュメントに代わるものとして、PDF 形式のものもあります。 | クイックガイド形式のドキュメントに代わるものとして、PDF 形式のものもあります。 | ||
行 924: | 行 957: | ||
Pandora FMS ライブラリにプラグインをアップロードする方法は非常に簡単です。ライブラリの "my plugins" | 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, | ||
行 938: | 行 971: | ||
プラグインが公開されると、" | プラグインが公開されると、" | ||
- | {{ : | + | [[: |
===== プラグインのレビューとメンテナンスに役立つグッドプラクティス ===== | ===== プラグインのレビューとメンテナンスに役立つグッドプラクティス ===== |