差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:documentation:08_technical_reference:11_pfms_plugis [2022/12/15 00:45] – [Error control] junichi | ja:documentation:08_technical_reference:11_pfms_plugis [Unknown date] (現在) – 削除 - 外部編集 (Unknown date) 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== プラグイン開発ガイド ====== | ||
- | |||
- | {{indexmenu_n> | ||
- | |||
- | [[ja: | ||
- | |||
- | |||
- | ===== 概要 ===== | ||
- | |||
- | 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. | ||
- | |||
- | このプラグイン開発ガイドには、独自のプラグインを作成したいユーザ向けのドキュメントが含まれています。 このドキュメントを使用して、ビジネスニーズを解決するプラグインを作成する方法を学習してください。 | ||
- | |||
- | ===== プラグインとは? | ||
- | |||
- | A computer add-on, also known as a plugin, is an application that allows you to extend the features of another application, | ||
- | |||
- | プラグインとも呼ばれるコンピュータアドオンは、別のアプリケーション (この場合は Pandora FMS) の機能を拡張できるようにするアプリケーションです。 | ||
- | |||
- | ===== プラグインはなぜ便利なのか? | ||
- | |||
- | Plugins allow to extend Pandora FMS features, which offers a wide variety of possibilities when developing new options for monitoring. | ||
- | |||
- | プラグインを使用すると、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. | ||
- | |||
- | それらを使用すると、サービス、アプリケーション、またはデータベースの監視などを統合でき、タスクや処理を変更または自動化するために使用することもできます. | ||
- | |||
- | One of the objectives is to be able to monitor as many systems and services as possible in the same work environment and the use of plugins helps a lot with that task. | ||
- | |||
- | 目的の 1 つは、同じ作業環境でできるだけ多くのシステムとサービスを監視できるようにすることであり、プラグインの利用はそのタスクに大いに役立ちます。 | ||
- | |||
- | Most plugins are useful to be able to display data or performance statistics collected from external services in Pandora FMS. | ||
- | |||
- | ほとんどのプラグインは、Pandora FMS の外部サービスから収集されたデータまたはパフォーマンス統計を表示できるようにするのに便利です。 | ||
- | |||
- | ===== Pandora FMS におけるプラグインタイプ ===== | ||
- | |||
- | By modality: | ||
- | |||
- | ライセンス別: | ||
- | |||
- | * **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**: | ||
- | |||
- | By execution type: | ||
- | |||
- | 実行タイプ別: | ||
- | |||
- | * Agent plugin: Agent plugins are run by Pandora FMS software agent, they are usually local and do not work remotely so execution will be performed by the agent daemon. Agent plugins usually print an XML in their execution, modules with data. | ||
- | * Server plugin: Server plugins are executed by the [[: | ||
- | |||
- | * エージェントプラグイン: | ||
- | * サーバプラグイン: | ||
- | |||
- | ===== プラグインの見つけ方 ===== | ||
- | |||
- | Pandora FMS has a library from which you may download all plugins created for the system, both Open and Enterprise plugins. | ||
- | |||
- | Pandora FMS には、システム用に作成されたすべてのプラグイン(オープンプラグインと Enterprise プラグインの両方) をダウンロードできるライブラリがあります。 | ||
- | |||
- | Anyone can upload plugins to the library, although there is a review process before these are accepted and published. | ||
- | |||
- | プラグインは誰でもライブラリにアップロードできますが、受け入れて公開する前にレビュープロセスがあります。 | ||
- | |||
- | <WRAP center round download 60%> | ||
- | |||
- | [[https:// | ||
- | |||
- | </ | ||
- | |||
- | {{ : | ||
- | |||
- | Currently the library has a large number of plugins that cover all fields, databases, applications, | ||
- | |||
- | 現在、ライブラリには、すべての分野、データベース、アプリケーション、クラウド、メッセージングサービスなどをカバーする多数のプラグインがあります。 | ||
- | |||
- | The library has a search engine with which you may search for any plugin uploaded to it, in addition to different tags and menus with which you may browse comfortably. | ||
- | |||
- | ライブラリには、快適に閲覧できるさまざまなタグやメニューに加えて、ライブラリにアップロードされたプラグインを検索できる検索エンジンがあります。 | ||
- | |||
- | {{ : | ||
- | |||
- | Each plugin is usually accompanied by its documentation detailing the installation, | ||
- | |||
- | 通常、各プラグインには、インストール、プラグインの設定、およびプラグインが収集するデータの詳細が記載されたドキュメントが付属しています。プラグインが Enterprise の場合、Enterprise 版ユーザのみがダウンロードできます。それ以外の場合は、次のメッセージが表示されます。 | ||
- | |||
- | {{ : | ||
- | |||
- | ===== プラグインのインストール方法 ===== | ||
- | |||
- | Plugins can be installed from Pandora FMS console. Depending on their type they can be run in two different ways, which will create different ways of plugin configuration. Agent plugins are however run by the software agent, while server plugins are run by the plugin server. Usually server plugins create agents and modules while agent plugins only create modules within the software agent in which it is configured. | ||
- | |||
- | プラグインは、Pandora FMS コンソールからインストールできます。 タイプに応じて 2 つの異なる方法で実行でき、プラグイン設定が作成されます。 ただし、エージェントプラグインはソフトウェアエージェントによって実行され、サーバプラグインはプラグインサーバによって実行されます。 通常、サーバプラグインはエージェントとモジュールを作成しますが、エージェントプラグインは、それが設定されているソフトウェアエージェント内でのみモジュールを作成します。 | ||
- | |||
- | Installing the plugin consists of creating its custom execution in Pandora FMS. Every certain configurable time interval, the plugin will run and display the updated modules. | ||
- | |||
- | プラグインをインストールするには、Pandora FMS でカスタム実行を作成します。 設定可能な特定の時間間隔ごとにプラグインが実行され、更新されたモジュールが表示されます。 | ||
- | |||
- | ===== プラグインのライフサイクル ===== | ||
- | |||
- | {{ : | ||
- | |||
- | ===== プラグインの計画 ===== | ||
- | |||
- | When developing a plugin it is important to correctly plan its development taking into account some aspects. | ||
- | |||
- | プラグインを開発するときは、いくつかの側面を考慮して、その開発を正しく計画することが重要です。 | ||
- | |||
- | ==== プラグインで解決できる問題 ==== | ||
- | |||
- | You should be able to answer these questions in a first step in plugin planning: | ||
- | |||
- | プラグイン計画の最初のステップで、次の質問に答えることができる必要があります。 | ||
- | |||
- | * What is the purpose of the plugin? | ||
- | * What are the use cases that your plugin will address? | ||
- | |||
- | * プラグインの目的は何でしょうか? | ||
- | * あなたのプラグインが対応するユースケースは何ですか? | ||
- | |||
- | 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 ですべてのデータを統合することで、時間やコストの面で有利になる場合があります。また、プラグインにより電子メールを読み込んで特定のメッセージが到着したときアラームを鳴らすといった自動化をすることもできます。 | ||
- | |||
- | Plugins seek to solve a need or make interaction, | ||
- | |||
- | プラグインは、ニーズを解決したり、相互作用、処理、およびデータ表示を容易にしたりできます。 | ||
- | |||
- | ==== プラグインはどのようにデータを取得するのでしょうか? | ||
- | |||
- | The main utility of a plugin is to retrieve data, from a service, application, | ||
- | |||
- | プラグインの主な機能は、サービス、アプリケーション、データベースなどからデータを取得し、このデータを Pandora FMS に表示できるようにすることです。 しかし、必要なサービスからデータを取得するにはどうすればよいでしょうか? | ||
- | |||
- | This, undoubtedly, | ||
- | |||
- | これは間違いなく、プラグインで利用することを想定している技術やサービスに依存するため、それらについて予備調査を実施し、プラグインの実現可能性を調べ、プラグインを作成できるかどうかを調べる必要があります。 可能であればテスト環境を用意します。 | ||
- | |||
- | Usually these services usually have some way to get the monitoring statistics, that way usually varies depending on the service. Often they have an API or a CLI with which to be able to process the required data and be able to show them with the plugin. | ||
- | |||
- | 通常、これらのサービスには監視統計を取得する何らかの方法があり、その方法はサービスによって異なります。 多くの場合、必要なデータを処理し、プラグインで表示できる API または CLI を持っています。 | ||
- | |||
- | In some cases there are libraries that the community or the company that created the technology or service itself created to make interaction much more easier with data from their services. | ||
- | |||
- | 場合によっては、技術やサービス自体を作成したコミュニティまたは会社が、データとのやり取りをより簡単にするために作成したライブラリがあります。 | ||
- | |||
- | ==== ユーザはデータを取得するためのアクセス許可が必要ですか? | ||
- | |||
- | It is likely that when retrieving data from a service or technology, it is necessary to have an account that needs certain permissions to interact with the data, or that it is necessary to make some previous configurations in the environment before this data can be retrieved. | ||
- | |||
- | サービスや技術からデータを取得する場合、データを操作するために特定のアクセス許可があるアカウントが必要になるか、データを取得する前に環境内で事前に設定を行う必要がある可能性があります。 | ||
- | |||
- | Generally speaking, these requirements are specified in the service or technology documentation itself. | ||
- | |||
- | 一般的に言えば、これらの要件は、サービスまたは技術のドキュメントで示されています。 | ||
- | |||
- | It is important to keep clearly in mind what is necessary and what are the requirements to be able to retrieve data from that service and leave them detailed in the plugin documentation. | ||
- | |||
- | プラグインのドキュメントとして、サービスからデータを取得し詳細を残すためには何が必要でどのような要件があるかを明確にしておくことが重要です。 | ||
- | |||
- | ==== データはリモートまたはローカルで収集されますか? | ||
- | |||
- | Performance statistics may be retrieved by API remotely, either through some library, CLI, or by API with HTTP calls… or this data may only be retrieved internally or locally by commands or because it uses its own technology. Depending on the case the plugin execution will change and be different. | ||
- | |||
- | パフォーマンス統計は、ライブラリ、CLI、または HTTP 呼び出しを使用した API のいずれかを介して、リモートで取得できます。または、データは、コマンドであったり独自の技術を使用して内部またはローカルでのみ取得できる場合があります。 ケースに応じて、プラグインの実行は異なります。 | ||
- | |||
- | A plugin that can get data remotely, can run with the plugin server, as it does not need to be present on the service machine to get data. | ||
- | |||
- | データをリモートで取得できるプラグインは、データを取得するためにサービスマシン上に存在する必要がないため、プラグインサーバで実行できます。 | ||
- | |||
- | There are certain plugins that can only be run through the software agent since they need to be on the same system as the service from which you want to get data in order to get them. | ||
- | |||
- | ソフトウェアエージェントを介してのみ実行できる特定のプラグインもあります。データの取得がサービスと同じシステム上である必要がある場合です。 | ||
- | |||
- | ==== データをどのように表示しますか? | ||
- | |||
- | When defining how to display the plugin data on Pandora console, it is important to specify how you want to display this data. | ||
- | |||
- | Pandora コンソールでプラグイン データを表示する方法を定義する場合、このデータをどのように表示するかを指定することが重要です。 | ||
- | |||
- | Usually these data will be displayed following an agent and module structure, so it is important to define this structure correctly to then be able to see the information as easy as possible so that it is not confusing, something that can be difficult to achieve in plugins that process lots of data or that monitor many " | ||
- | |||
- | 通常、これらのデータはエージェントとモジュールの構造に従って表示されるため、この構造を正しく定義して、混乱しないように、情報をできるだけ簡単に表示できるようにすることが重要です。大量のデータを処理したり、多くのデータベースや仮想マシンなどを持っている場合など、多くの「もの」を監視したりするのは、プラグインで実現するのが難しくなります。 | ||
- | |||
- | Within the plugin you may include options to customize agent or module names, or add some kind of prefix to their name to make them more visible and distinguishable. | ||
- | |||
- | プラグイン内に、エージェントまたはモジュールの名前をカスタマイズするオプションを含めたり、それらの名前にある種のプレフィックスを追加して、それらをより見やすく、区別しやすくすることができます。 | ||
- | |||
- | ===== プラグインの要件と依存関係 ===== | ||
- | |||
- | Depending on the technologies used in the plugin, dependency installation may be necessary for its correct operation. These can be libraries of the language used that you imported into the plugin to perform some function or the language used itself. | ||
- | |||
- | プラグインで使用されている技術によっては、正しく動作させるために依存関係のインストールが必要になる場合があります。 これらは、何らかの機能を実行するためにプラグインにインポートした言語のライブラリ、またはそれ自体で使用される言語のライブラリです。 | ||
- | |||
- | If the plugin is written in python3, it will be necessary to have '' | ||
- | |||
- | プラグインが python3 で記述されている場合、プラグインを使用するマシンに '' | ||
- | |||
- | One option, for plugins created in python is to provide a '' | ||
- | |||
- | Python で作成されたプラグインでの一つのオプションとしては、プラグインで使用されるすべての依存関係をプラグインと共に '' | ||
- | |||
- | Example of the plugin '' | ||
- | |||
- | リモート MongoDB プラグインの '' | ||
- | |||
- | < | ||
- | |||
- | dnspython==2.1.0 | ||
- | pymongo==3.12.0 | ||
- | |||
- | </ | ||
- | |||
- | You may see how the file includes two libraries that it is necessary to keep installed on the system in order to launch it (in case it is not a compiled plugin). | ||
- | |||
- | ファイルには、プラグインを実行するためにシステムにインストールしておく必要がある 2 つのライブラリが含まれていることがわかります (コンパイルされたプラグインでない場合)。 | ||
- | |||
- | The file can be written by hand, but you may also generate a '' | ||
- | |||
- | このファイルは手動で作成できますが、'' | ||
- | |||
- | < | ||
- | pip freeze> requirements.txt | ||
- | |||
- | </ | ||
- | |||
- | You may copy the requirements file to the environment in which you want to install the dependencies and run the following command to install them: | ||
- | |||
- | 依存関係をインストールする環境に requirements.txt ファイルをコピーし、次のコマンドを実行してそれらをインストールできます。 | ||
- | |||
- | < | ||
- | pip install -r requirements.txt | ||
- | |||
- | </ | ||
- | |||
- | ==== プラグインのコンパイル ==== | ||
- | |||
- | One way to solve dependency problems with plugins is to create executables that already come with all the dependencies installed, this is an ideal solution for perl plugins and for python plugins. | ||
- | |||
- | プラグインの依存関係の問題を解決する一つの方法は、すべての依存関係が既にインストールされている実行可能ファイルを作成することです。これは、perl プラグインおよび python プラグインにとって理想的なソリューションです。 | ||
- | |||
- | In the case of python to create executables, | ||
- | |||
- | python で実行可能ファイルを作成する場合、'' | ||
- | |||
- | <WRAP center round download 60%> | ||
- | |||
- | [[https:// | ||
- | |||
- | </ | ||
- | |||
- | It can be installed with the following command: | ||
- | |||
- | これは、次のコマンドでインストールできます。 | ||
- | |||
- | < | ||
- | |||
- | pip install pyinstaller | ||
- | |||
- | </ | ||
- | |||
- | Once installed, the following command can be used to create a binary of the plugin in a file: | ||
- | |||
- | インストールしたら、次のコマンドを使用してプラグインのバイナリファイルに作成できます。 | ||
- | |||
- | **Linux:** | ||
- | |||
- | < | ||
- | pyinstaller –onefile < | ||
- | |||
- | </ | ||
- | |||
- | **MS Windows**: | ||
- | |||
- | < | ||
- | python3 -m PyInstaller –onefile < | ||
- | |||
- | </ | ||
- | |||
- | 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. | ||
- | |||
- | あるオペレーティングシステムでコンパイルされたプラグインは別のオペレーティングシステムで動作しない場合があります。プラグインのコンパイルは CentOS 7 で行うことをお勧めします.このシステムでコンパイルされたプラグインは通常、他のすべての GNU/Linux オペレーティングシステムで動作するためです。 | ||
- | |||
- | With binaries created in Fedora and Ubuntu we have been able to check that in other systems a dependency error is generated. | ||
- | |||
- | Fedora および Ubuntu で作成したバイナリを使用すると、他のシステムで依存関係エラーが発生することを確認しています。 | ||
- | |||
- | ===== プラグインの開発 ===== | ||
- | |||
- | It is important to be clear about which tools and technologies will be used in the plugin' | ||
- | |||
- | プラグインの開発にどのツールと技術を使用するかを明確にすることが重要です。 | ||
- | |||
- | ==== 開発ツール ==== | ||
- | |||
- | Plugins are scripts that integrate data or an extra feature in Pandora FMS, they are still small programs, so to develop them it is necessary to have a framework or a code editor such as 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. | ||
- | |||
- | 次に、github や gitlab などのツールは、作成されたプラグインのコードを保存および維持するのに役立ちます。 | ||
- | |||
- | ==== プログラミング言語 ==== | ||
- | |||
- | For plugin development it is necessary to use a programming language, Pandora FMS supports any type of language, as long as it displays the data in XML format, Pandora FMS will be able to understand and display them in your console. To that end, follow a label structure with the XML that includes agents, modules and their attributes. | ||
- | |||
- | プラグインの開発には、プログラミング言語を使用する必要があります。Pandora FMS は、データが XML 形式で提供される限り、あらゆるタイプの言語をサポートします。Pandora FMS はそれらを理解しコンソールに表示できます。 そのために、エージェント、モジュール、およびそれらの属性を含む XML でラベル構造に従います。 | ||
- | |||
- | Usually the scripting languages most commonly used in Pandora FMS plugins are Python, Perl, BASH and Powershell, the first two being probably the most complete ones. | ||
- | |||
- | 通常、Pandora FMS プラグインで最も一般的に使用されるスクリプト言語は、Python、Perl、BASH、および Powershell であり、最初の 2 つはおそらく最も充実したものです。 | ||
- | |||
- | 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** と呼ばれるプラグイン作成を容易にするツールがあります。このツールには、プラグイン作成を容易にし、自動化するように設計された多くの機能があるため、言語を選択する際の決定的な利点となる可能性があります。 | ||
- | |||
- | ==== テスト環境構築に便利なツール ==== | ||
- | |||
- | For plugin development it is usually necessary a testing environment, | ||
- | |||
- | プラグインの開発には、通常、監視するサービスのインストール、アカウントなどのテスト環境が必要です。速度とシンプルさから環境作成に役立つ 2 つの技術としては、docker と vagrant があります。 もちろん、テストしたいサービスのプロジェクトでソリューションを用意する必要がありますが、いくつかのコマンドまたは小さな構成のみで実行できます。 | ||
- | |||
- | {{ : | ||
- | |||
- | ===== XML ===== | ||
- | |||
- | In order for Pandora FMS to consume the data it receives from the plugin in order to display it, it is necessary for those data to be translated into XML format. | ||
- | |||
- | Pandora FMS がプラグインから受信したデータを使用して表示するには、それらのデータを XML 形式に変換する必要があります。 | ||
- | |||
- | Knowing the format of Pandora FMS data XML can help you improve plugins, create custom agents with them, or just send custom XML files to Pandora FMS data server. | ||
- | |||
- | Pandora FMS の XML データ形式を理解すると、プラグインを改善したり、プラグインを使用してカスタムエージェントを作成したり、カスタム XML ファイルを Pandora FMS データサーバに送信したりするのに役立ちます。 | ||
- | |||
- | Like any XML document, the data file should start with an XML declaration: | ||
- | |||
- | 他の XML ドキュメントと同様に、データファイルは XML 宣言で開始する必要があります。 | ||
- | |||
- | < | ||
- | <?xml version=' | ||
- | |||
- | </ | ||
- | |||
- | 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 を出力します。サーバプラグインは単純なデータのみを表示します。サーバプラグインにおける最も基本的なことは、正常な場合は '' | ||
- | |||
- | ===== エージェントとモジュール ===== | ||
- | |||
- | The data that the plugin collects can be displayed in Pandora FMS through agents and modules, so it is important to outline the way in which you want to display data. For example, each agent could be a database to be monitored, with modules representing its information. | ||
- | |||
- | プラグインが収集するデータは、エージェントとモジュールを介して Pandora FMS に表示できるため、データを表示する方法を示すことが重要です。 たとえば、各エージェントは監視対象のデータベースで、モジュールとしてその情報を表すなどです。 | ||
- | |||
- | The xml structure of agents and modules have different attributes for configuring them. | ||
- | |||
- | エージェントとモジュールの xml 構造には、それらを構成するためのさまざまな属性があります。 | ||
- | |||
- | The element '' | ||
- | |||
- | データを送信するエージェントを定義する要素 '' | ||
- | |||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | |||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | |||
- | XML heading example: | ||
- | |||
- | XML ヘッダ例: | ||
- | |||
- | < | ||
- | < | ||
- | interval=' | ||
- | agent_name=' | ||
- | address=' | ||
- | url_address=' | ||
- | |||
- | </ | ||
- | |||
- | An module element is needed for each '' | ||
- | |||
- | 各 '' | ||
- | |||
- | * **name**: Module name. | ||
- | * **description**: | ||
- | * **tags**: Tags associated with the module. | ||
- | * **type**: Module type (it must exist in Pandora FMS database). | ||
- | * **data**: Module data. | ||
- | * **max**: Maximum module value. | ||
- | * **min**: Minimum module value. | ||
- | * **post_process**: | ||
- | * **module_interval**: | ||
- | * **min_critical**: | ||
- | * **max_critical**: | ||
- | * **min_warning**: | ||
- | * **max_warning**: | ||
- | * **disabled**: | ||
- | * **min_ff_event**: | ||
- | * **status**: Module status (NORMAL, WARNING or CRITICAL). Critical and alert status limits are ignored if the status is specified. | ||
- | * **datalist**: | ||
- | * **unit**: Module unit. It supports '' | ||
- | * **timestamp**: | ||
- | * **module_group**: | ||
- | * **custom_id**: | ||
- | * **str_warning**: | ||
- | * **str_critical**: | ||
- | * **critical_instructions**: | ||
- | * **warning_instructions**: | ||
- | * **unknown_instructions**: | ||
- | * **critical_inverse**: | ||
- | * **warning_inverse**: | ||
- | * **quiet**: It activates the module' | ||
- | * **module_ff_interval**: | ||
- | * **alert_template**: | ||
- | * **crontab**: | ||
- | * **min_ff_event_normal**: | ||
- | * **min_ff_event_warning**: | ||
- | * **min_ff_event_critical**: | ||
- | * **ff_timeout**: | ||
- | * **each_ff**: | ||
- | * **module_parent**: | ||
- | * **ff_type**: | ||
- | |||
- | * **name**: モジュール名。 | ||
- | * **description**: | ||
- | * **tags**: モジュールに関連付けられたタグ。 | ||
- | * **type**: モジュールタイプ(Pandora FMS データベースに存在するひつようがあります)。 | ||
- | * **data**: モジュールデータ。 | ||
- | * **max**: モジュール最大値。 | ||
- | * **min**: モジュール最小値。 | ||
- | * **post_process**: | ||
- | * **module_interval**: | ||
- | * **min_critical**: | ||
- | * **max_critical**: | ||
- | * **min_warning**: | ||
- | * **max_warning**: | ||
- | * **disabled**: | ||
- | * **min_ff_event**: | ||
- | * **status**: モジュールの状態(NORMAL, | ||
- | * **datalist**: | ||
- | * **unit**: モジュールの単位。timeticks フォーマットを '' | ||
- | * **timestamp**: | ||
- | * **module_group**: | ||
- | * **custom_id**: | ||
- | * **str_warning**: | ||
- | * **str_critical**: | ||
- | * **critical_instructions**: | ||
- | * **warning_instructions**: | ||
- | * **unknown_instructions**: | ||
- | * **critical_inverse**: | ||
- | * **warning_inverse**: | ||
- | * **quiet**: モジュールの静観モードを有効化。[0/ | ||
- | * **module_ff_interval**: | ||
- | * **alert_template**: | ||
- | * **crontab**: | ||
- | * **min_ff_event_normal**: | ||
- | * **min_ff_event_warning**: | ||
- | * **min_ff_event_critical**: | ||
- | * **ff_timeout**: | ||
- | * **each_ff**: | ||
- | * **module_parent**: | ||
- | * **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**: | ||
- | * **max_warning_forced**: | ||
- | * **min_critical_forced**: | ||
- | * **max_critical_forced**: | ||
- | * **str_warning_forced**: | ||
- | * **str_critical_forced**: | ||
- | * モジュールには、少なくとも 1 つの名前、型、およびデータ要素が必要です。 | ||
- | |||
- | For instance: | ||
- | |||
- | 例: | ||
- | |||
- | < | ||
- | |||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | |||
- | </ | ||
- | |||
- | There can be any number of elements in an XML data file. | ||
- | |||
- | XML データ ファイルには、任意の数の要素を含めることができます。 | ||
- | |||
- | <WRAP center round important 60%> | ||
- | |||
- | Do not forget to close the tag '' | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round important 60%> | ||
- | |||
- | '' | ||
- | |||
- | </ | ||
- | |||
- | 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: | ||
- | |||
- | リストモジュールもあり、1 つの値だけではなく、複数の値を含むことができます。これらは文字列に役立ちます。 次の例に示すように、このタイプのモジュールでは datalist タグを使用する必要があります。 | ||
- | |||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | |||
- | < | ||
- | </ | ||
- | </ | ||
- | Se puede especificar una marca de tiempo para cada valor: | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | </ | ||
- | </ | ||
- | |||
- | </ | ||
- | |||
- | Some more examples that include the use of thresholds and units: | ||
- | |||
- | しきい値と単位の指定を含むその他の例: | ||
- | |||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | < | ||
- | < | ||
- | < | ||
- | ]]></ | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | |||
- | </ | ||
- | |||
- | ===== プラグインツール ===== | ||
- | |||
- | Pandora FMS has a tool called plugintools, | ||
- | |||
- | Pandora FMS には、プラグインの開発を容易にする perl および python プログラミング言語で利用できる plugintools というツールがあります。これらは、プラグインの作成に必要なほとんどを処理を簡単に実現する機能が組み込まれています。 | ||
- | |||
- | * Agent creation. | ||
- | * Module creation. | ||
- | * Send files through [[: | ||
- | * Read configuration files. | ||
- | |||
- | * エージェント作成。 | ||
- | * モジュール作成。 | ||
- | * [[: | ||
- | * 設定ファイルの読み込み。 | ||
- | |||
- | ==== Python 版 plugintools ==== | ||
- | |||
- | <WRAP center round download 60%> | ||
- | |||
- | [[https:// | ||
- | |||
- | </ | ||
- | |||
- | ==== Perl 版 plugintools ==== | ||
- | |||
- | <WRAP center round download 60%> | ||
- | |||
- | [[https:// | ||
- | |||
- | </ | ||
- | |||
- | ===== パラメータと設定 ===== | ||
- | |||
- | A utility to consider, that is usually quite useful when interacting with a plugin, is the parameters and configuration files, since these give the option of being able to customize the plugin' | ||
- | |||
- | プラグインを使用する際に便利なものとして、パラメータと設定ファイルがあります。これらを使って、サービス IP や対象となる認証情報のような常に変動するデータを定義したり、モジュールやエージェントの名前をカスタマイズしたりすることができます。プラグインの設定にパラメータを使用することは、設定ファイルを使用することに比べて利点と欠点があります。パラメータを使うとプラグインの使用に多くの設定ファイルが必要なくなりますが、設定ファイルを使用した場合はプラグインの設定を確実にすばやく実行できます。各プラグインに最適なオプションを検討することが重要です。 | ||
- | |||
- | ===== プラグインヘルプ ===== | ||
- | |||
- | Another option that is usually quite useful in a plugin, is to include a parameter as its help option, to show all the plugin options and parameters and how to configure it. It is like a small digital documentation about the plugin included in its software. | ||
- | |||
- | 通常、プラグインで非常に便利なもう 1 つのオプションは、パラメータをヘルプに含めて、すべてのプラグインオプションとパラメータ、およびその設定方法を表示することです。 これは、ソフトウェアに含まれるプラグインに関する小さなデジタルドキュメントのようなものです。 | ||
- | |||
- | Example of a plugin help menu: | ||
- | |||
- | プラグインのヘルプメニューの例: | ||
- | |||
- | {{ : | ||
- | |||
- | ===== Pandora FMS プラグイン設定 ===== | ||
- | |||
- | The plugin settings may vary depending on whether this is an agent or server plugin. | ||
- | |||
- | プラグインの設定は、これがエージェントプラグインかサーバプラグインかによって異なる場合があります。 | ||
- | |||
- | ==== サーバプラグイン ==== | ||
- | |||
- | In order to monitor from Pandora FMS with a server agent plugin, go to the " | ||
- | |||
- | サーバプラグインを使用して Pandora FMS から監視するには、サーバメニューの " | ||
- | |||
- | {{ : | ||
- | |||
- | Click on " | ||
- | |||
- | " | ||
- | |||
- | {{ : | ||
- | |||
- | It should be given the name and description you prefer. | ||
- | |||
- | 好みの名前と説明を付ける必要があります。 | ||
- | |||
- | {{ : | ||
- | |||
- | As a command you should enter the execution with the plugin path: | ||
- | |||
- | コマンドとして、プラグインパスに実行コマンドを入力する必要があります。 | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | The recommended path for using server plugins is: | ||
- | < | ||
- | |||
- | / | ||
- | |||
- | </ | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | サーバプラグインを利用するための推奨パスは次のとおりです。 | ||
- | < | ||
- | |||
- | / | ||
- | |||
- | </ | ||
- | |||
- | </ | ||
- | |||
- | The execution with the plugin path must be entered as a command: | ||
- | |||
- | プラグインパスには、コマンドを入力する必要があります。 | ||
- | |||
- | {{ : | ||
- | |||
- | In plugin parameters enter them followed by the macro '' | ||
- | |||
- | プラグインパラメータでは、マクロ '' | ||
- | |||
- | '' | ||
- | |||
- | {{ : | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | Once this is done, click on " | ||
- | |||
- | 完了したら、" | ||
- | |||
- | Once the previous steps have been completed, call the plugin. Go to the agent view and create a plugin module: | ||
- | |||
- | 前の手順が完了したら、プラグインを呼び出します。 エージェント表示に移動し、プラグインモジュールを作成します。 | ||
- | |||
- | {{ : | ||
- | |||
- | A name must be given and in the " | ||
- | |||
- | 名前を指定する必要があります。" | ||
- | |||
- | Once done, click " | ||
- | |||
- | 完了したら、" | ||
- | |||
- | If the module is displayed with '' | ||
- | |||
- | モジュールの値が '' | ||
- | |||
- | {{ : | ||
- | |||
- | ==== エージェントプラグイン ==== | ||
- | |||
- | In order to monitor from Pandora FMS with an agent plugin, call it from the software agent '' | ||
- | |||
- | エージェントプラグインを使用して Pandora FMS で監視するには、GNU/ | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | The execution on the last conf line can be created with the '' | ||
- | |||
- | conf では '' | ||
- | |||
- | Example of a possible plugin execution: | ||
- | |||
- | プラグイン実行の例: | ||
- | |||
- | < | ||
- | module_plugin / | ||
- | |||
- | </ | ||
- | |||
- | This can also be done from the console if remote configuration is enabled. [[: | ||
- | |||
- | リモート設定が有効になっている場合は、コンソールからも設定を行えます。 | ||
- | [[: | ||
- | |||
- | {{ : | ||
- | |||
- | ===== 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. | ||
- | |||
- | プラグインデータの表示は通常、エージェント表示から行われます。 通常、データ構造はエージェントとモジュールにて定義されるため、プラグインがエージェントとモジュールを作成するのは普通のことです。したがって、これらのデータはエージェント自体の表示メニューに表示できます。 | ||
- | |||
- | {{ : | ||
- | |||
- | 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 ===== | ||
- | |||
- | 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 " | ||
- | |||
- | このファイル形式は、プラグインのインストールを簡素化するため、プラグインをパッケージ化するときに非常に便利です。 この形式を使用すると、Pandora FMS コンソールの " | ||
- | |||
- | Example of '' | ||
- | |||
- | プラグインの '' | ||
- | |||
- | < | ||
- | |||
- | [plugin_definition] | ||
- | name = Pandora Azure Storage | ||
- | description = "Take data from azure storage" | ||
- | timeout = 20 | ||
- | filename = pandora_azure | ||
- | execution_command = | ||
- | execution_postcommand = | ||
- | parameters = -c _field1_ –agent_name _field2_ -g _field3_ | ||
- | plugin_type = 0 | ||
- | total_modules_provided = 0 | ||
- | total_macros_provided = 8 | ||
- | [macro_1] | ||
- | hide = 0 | ||
- | description = "Conf path (obligatory)" | ||
- | help = "Path conf" | ||
- | value = | ||
- | [macro_2] | ||
- | hide = 0 | ||
- | description = "Agent name (optional)" | ||
- | help = "Name of the agent" | ||
- | value = _agentname_ | ||
- | [macro_3] | ||
- | hide = 0 | ||
- | description = "group (optional)" | ||
- | help = " | ||
- | value = | ||
- | |||
- | </ | ||
- | |||
- | **filename**: | ||
- | |||
- | **filename**: | ||
- | |||
- | **plugin_type**: | ||
- | |||
- | **plugin_type**: | ||
- | |||
- | **total_modules_provided**: | ||
- | |||
- | **total_modules_provided**: | ||
- | |||
- | **execution_command**: | ||
- | |||
- | **execution_command**: | ||
- | |||
- | **execution_postcommand**: | ||
- | |||
- | **execution_postcommand**: | ||
- | |||
- | **total_macros_provided**: | ||
- | |||
- | **total_macros_provided**: | ||
- | |||
- | **macro_****_value**: | ||
- | |||
- | **macro_****_value**: | ||
- | |||
- | And it must create a section for each dynamic macro, for example: | ||
- | |||
- | また、動的マクロごとにセクションを作成しなければいけません。例: | ||
- | |||
- | < | ||
- | [macro_< | ||
- | hide = 0 | ||
- | description = < | ||
- | help = < | ||
- | value = < | ||
- | |||
- | </ | ||
- | |||
- | ===== 互換性 ===== | ||
- | |||
- | 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. | ||
- | |||
- | 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. | ||
- | |||
- | 適切なエラー制御を行うと、プラグインの潜在的な将来起こりうるエラーを検出し、迅速に原因を見つけることができるため、長期にわたってプラグインを維持するのに役立ちます。 | ||
- | |||
- | 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. | ||
- | |||
- | 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. | ||
- | |||
- | === 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. | ||
- | |||
- | 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: | ||
- | |||
- | <WRAP center round download 60%> | ||
- | |||
- | [[https:// | ||
- | |||
- | </ | ||
- | |||
- | === Upload a plugin to the library === | ||
- | |||
- | The process when uploading a plugin to Pandora FMS library is very simple. Just access the " | ||
- | |||
- | {{ : | ||
- | |||
- | 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, | ||
- | |||
- | 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 " | ||
- | |||
- | {{ : | ||
- | |||
- | ===== 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: | ||
- | |||
- | * Leaving a good previous configuration well documented in case it is necessary to make some previous configurations on the system on the plugin itself. | ||
- | * Documenting an example of actual execution of the plugin that helps the user visualize its use. | ||
- | * Writing comments in the plugin code can help understand it better or faster. | ||
- | * Prioritizing code readability. The more complex it is, the more time and resources will be needed to deal with it. | ||
- | * Testing your code. It is important to test the plugin' | ||
- | |||
- | [[ja: | ||
- | |||