差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:documentation:pandorafms:technical_reference:01_development_and_extension [2024/09/01 06:51] – [メーリングリスト] junichi | ja:documentation:pandorafms:technical_reference:01_development_and_extension [2024/10/11 23:01] (現在) – [Pandora FMS コードのアーキテクチャ] junichi | ||
---|---|---|---|
行 9: | 行 9: | ||
===== Pandora FMS コードのアーキテクチャ ===== | ===== Pandora FMS コードのアーキテクチャ ===== | ||
- | For a separate and detailed explanation about the Pandora FMS database structure see the article [[en: | + | For a separate and detailed explanation about Pandora FMS database structure see the article [[:en: |
Pandora FMS データベースの構造に関する詳細については、 [[: | Pandora FMS データベースの構造に関する詳細については、 [[: | ||
行 755: | 行 755: | ||
このプロジェクトはボランティア開発者の貢献によって維持されています。新しい開発者、ドキュメント作成者、または協力したい人はいつでも歓迎します。始めるには、メーリングリストや [[https:// | このプロジェクトはボランティア開発者の貢献によって維持されています。新しい開発者、ドキュメント作成者、または協力したい人はいつでも歓迎します。始めるには、メーリングリストや [[https:// | ||
- | ==== バグ | + | ==== バグ ==== |
- | Informar acerca de posibles errores nos ayuda a mejorar | + | Inform about possible errors helps us improve |
考えられるエラーを報告することは、Pandora FMS の改善に役立ちます。バグレポートを送信する前に、[[https:// | 考えられるエラーを報告することは、Pandora FMS の改善に役立ちます。バグレポートを送信する前に、[[https:// | ||
行 772: | 行 772: | ||
==== 最新ソースの入手 ==== | ==== 最新ソースの入手 ==== | ||
- | 我々のリポジトリから最新のソースを入手するには、Subversion クライアントが必要です。そして、次のように実行します。 | + | To get the latest version of the code it is essential to download the sources from the code repository [[http:// |
- | svn co https://svn.sourceforge.net/svnroot/pandora pandora | + | 最新バージョンのコードを入手するには、公式の Pandora FMS リポジトリが公開されているコードリポジトリ [[http://github.com/ |
- | ==== Windows ==== | ||
- | ソースからビルドするには、MinGW tools を含む最新の Dev-Cpp IDE 版が必要です。[[http:// | + | ===== Pandora FMS API ===== |
- | '' | + | There is a Pandora FMS external API to be able to link third party applications with Pandora FMS, both to obtain information from Pandora FMS and to introduce information inside Pandora FMS. All this documentation is in the [[en: |
- | ソースからのビルドで問題を見つけた場合は、メール (ramon.novoa@artica.es) もしくは [[http:// | + | Pandora FMS 外部 API を使用すると、サードパーティのアプリケーションを Pandora FMS にリンクして、Pandora FMS から情報を取得したり、Pandora FMS 内に情報を取り込んだりすることができます。このドキュメントはすべて |
- | ==== Linux でのクロスコンパイル ==== | + | ===== XML データファイルフォーマット ===== |
- | Linux で Pandora FMS Windows エージェントをクロスコンパイルするには、次のようにします。 | + | Knowing the Pandora FMS data XML format can help to improve agent plugins, create customized agents or simply send customized XML files to the Pandora FMS data server. |
- | === Linux への MinGW のインストール | + | Pandora FMS の XML データファイルのフォーマットを理解することで、エージェントプラグインの拡張や、独自エージェントの作成、Pandora FMS データサーバへの独自 XML ファイルの送信などができるようになります。 |
- | Ubuntu/ | + | Like any XML document, the data file must begin with an XML declaration: |
- | sudo aptitude install mingw32 | + | すべての XML ドキュメントど同じように、データファイルは次のような XML の宣言で始まります。 |
- | SUSE または RPM 管理の環境の場合 (手動での Zypper の利用) は、以下の RUL より: | + | <code xml> |
+ | <?xml version=' | ||
- | http:// | ||
- | |||
- | === エージェントに必要な追加ライブラリのインストール === | ||
- | |||
- | * win32api | ||
- | * odbc++ | ||
- | * curl | ||
- | * openssl | ||
- | * zlib | ||
- | * Boost C++ libraries (http:// | ||
- | |||
- | 例えば、Openssl パッケージをインストールするには次のようにします。 | ||
- | |||
- | http:// | ||
- | |||
- | openssl-0.9.8e-1cm.DevPak | ||
- | |||
- | openssl-0.9.8e-1cm.DevPak を展開します。 | ||
- | |||
- | tar jxvf openssl-0.9.8e-1cm.DevPak | ||
- | |||
- | ライブラリおよびインクルードファイルを MinGW のあるクロスコンパイル環境にコピーします。 | ||
- | |||
- | < | ||
- | cp lib/*.a / | ||
- | cp -r include/* / | ||
</ | </ | ||
- | 依存関係やライブラリの問題は、ご自身で解決する必要があります。 | + | Next comes the **agent_data** element that defines the agent that sends the data. It supports the following attributes: |
- | これらを簡単にできるように、Pandora FMS の公式ダウンロードサイトに必要なライブラリとインクルードファイルを tar で固めたファイルを // | + | |
- | という名前で置いてあります。 | + | |
- | + | ||
- | === コンパイルおよびリンク === | + | |
- | + | ||
- | コンパイラおよび、インクルードファイル、ライブラリのインストール後、Pandora FMS エージェントのソースディレクトリへ行き、以下を実行します。 | + | |
- | + | ||
- | ./configure --host=i586-mingw32msvc && make | + | |
- | + | ||
- | これで、実行可能な .exe ファイルが生成されます。 | + | |
- | + | ||
- | ===== 外部 API ===== | + | |
- | + | ||
- | Pandora FMS には、他のアプリケーションとの連携をとり、Pandora FMS から情報を取得したり Pandora FMS に情報を提供するための外部 API があります。これに関するドキュメントは、補足資料の Pandora FMS 外部 API にあります。 | + | |
- | + | ||
- | ===== Pandora FMS XML データファイルフォーマット ===== | + | |
- | + | ||
- | Pandora FMS の XML データファイルのフォーマットを理解することで、エージェントプラグインの拡張や、独自エージェントの作成、Pandora FMS データサーバへの独自 XML ファイルの送信などができるようになります。 | + | |
- | + | ||
- | すべての XML ドキュメントど同じように、データファイルは次のような XML の宣言で始まります。 | + | |
- | + | ||
- | <? | + | |
次に、エージェントが送るデータを定義する **agent_data** 要素が来ます。次に示す属性に対応しています。 | 次に、エージェントが送るデータを定義する **agent_data** 要素が来ます。次に示す属性に対応しています。 | ||
- | * // | + | |
- | * //group//: Name of the group the agent belongs | + | * //group//: Name of the group to which the agent belongs (it must exist in the Pandora FMS database). If it is left empty and there is no default group configured in the server, the agent will not be created. |
- | * // | + | * // |
- | * // | + | * // |
* // | * // | ||
- | * // | + | * // |
- | * // | + | * // |
- | * // | + | * // |
- | * // | + | * // |
- | * // | + | * // |
- | * // | + | * // |
* // | * // | ||
* // | * // | ||
* // | * // | ||
- | * // | + | * // |
- | * // | + | * // |
* // | * // | ||
行 887: | 行 839: | ||
< | < | ||
+ | |||
+ | A **module** element is then required for each module, and the following elements can be nested to define the module: | ||
そして、モジュールごとに、**module** という要素が必要です。モジュールの定義のために、次の要素を入れることができます。 | そして、モジュールごとに、**module** という要素が必要です。モジュールの定義のために、次の要素を入れることができます。 | ||
行 892: | 行 846: | ||
* **name**: Module name. | * **name**: Module name. | ||
* **description**: | * **description**: | ||
- | * **tags**: Tags associated | + | * **tags**: Tags associated |
- | * **type**: Module type (it must exist in Pandora FMS database). | + | * **type**: Module type (must exist in Pandora FMS database). |
* **data**: Module data. | * **data**: Module data. | ||
- | * **max**: | + | * **max**: |
- | * **min**: | + | * **min**: |
- | * **post_process**: | + | * **post_process**: |
- | * **module_interval**: | + | * **module_interval**: |
- | * **min_critical**: | + | * **min_critical**: |
- | * **max_critical**: | + | * **max_critical**: |
- | * **min_warning**: | + | * **min_warning**: |
- | * **max_warning**: | + | * **max_warning**: |
- | * **disabled**: | + | * **disabled**: |
- | * **min_ff_event**: | + | * **min_ff_event**: |
- | * **status**: Module status (NORMAL, WARNING or CRITICAL). | + | * **status**: Module status (NORMAL, WARNING or CRITICAL). |
- | * **datalist**: | + | * **datalist**: |
- | * **unit**: Module unit. Supports the _Timeticks_ | + | * **unit**: Module unit. Supports the '' |
* **timestamp**: | * **timestamp**: | ||
* **module_group**: | * **module_group**: | ||
- | * **custom_id**: | + | * **custom_id**: |
* **str_warning**: | * **str_warning**: | ||
* **str_critical**: | * **str_critical**: | ||
- | * **critical_instructions**: | + | * **critical_instructions**: |
- | * **warning_instructions**: | + | * **warning_instructions**: |
- | * **unknown_instructions**: | + | * **unknown_instructions**: |
* **critical_inverse**: | * **critical_inverse**: | ||
- | * **warning_inverse**: | + | * **warning_inverse**: |
* **quiet**: Activates the Quiet mode of the module [0/1]. | * **quiet**: Activates the Quiet mode of the module [0/1]. | ||
* **module_ff_interval**: | * **module_ff_interval**: | ||
行 923: | 行 877: | ||
* **crontab**: | * **crontab**: | ||
* **min_ff_event_normal**: | * **min_ff_event_normal**: | ||
- | * **min_ff_event_warning**: | + | * **min_ff_event_warning**: |
- | * **min_ff_event_critical**: | + | * **min_ff_event_critical**: |
* **ff_timeout**: | * **ff_timeout**: | ||
- | * **each_ff**: | + | * **each_ff**: |
* **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**: | ||
* **name**: モジュールの名前。 | * **name**: モジュールの名前。 | ||
行 969: | 行 929: | ||
* **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**: | ||
- | Pandora FMS バージョン 749 から、しきい値を強制するための新たなトークンが追加されました。 | + | <WRAP center round important 90%> |
- | | + | These tokens will only work for **dataserver plugins**. |
- | * **max_warning_forced**: | + | |
- | * **min_critical_forced**: | + | |
- | * **max_critical_forced**: | + | |
- | * **str_warning_forced**: | + | |
- | * **str_critical_forced**: | + | |
- | <WRAP center round important 60%> | ||
- | これらのトークンは、**データサーバプラグイン** のみで動作します。 | ||
</ | </ | ||
- | その他の要素は、モジュールの拡張情報として Pandora FMS のデータベースに保存されます。 | + | <WRAP center round important 90%> |
- | {{ : | + | これらのトークンは、**データサーバプラグイン** のみで動作します。 |
- | モジュールは、少なくとも **name**, **type**, および **data** の要素を持たなければいけません。 | + | </ |
- | 例: | + | Any other element will be saved as extended information of the module in the Pandora FMS database. A module must have at least one element **name**, **type** and **data**, for example: |
- | < | + | その他の要素は、モジュールの拡張情報として Pandora FMS データベースに保存されます。モジュールには、少なくとも 1 つの要素 **name**、**type**、**data** が必要です。例: |
+ | |||
+ | その他の要素は、モジュールの拡張情報として Pandora FMS のデータベースに保存されます。 | ||
+ | |||
+ | < | ||
< | < | ||
< | < | ||
行 998: | 行 961: | ||
< | < | ||
</ | </ | ||
+ | |||
</ | </ | ||
+ | |||
+ | There can be any number of elements in an XML data file before closing the **agent_data** tag. | ||
XML データファイルは任意の数のモジュール要素を持つことができます。最後に、**agent_data** タグをクローズするのを忘れないでください。 | XML データファイルは任意の数のモジュール要素を持つことができます。最後に、**agent_data** タグをクローズするのを忘れないでください。 | ||
+ | |||
+ | There is a special case of multi-item XML, based on a list of data. This applies only to string data. The XML would look something like this: | ||
アイテムリストによる、複数の XML データを含む特別なケースがあります。これは、文字列タイプの場合にのみ有効です。XML は次のようになります。 | アイテムリストによる、複数の XML データを含む特別なケースがあります。これは、文字列タイプの場合にのみ有効です。XML は次のようになります。 | ||
- | < | + | < |
< | < | ||
- | < | + | < |
- | < | + | < |
< | < | ||
< | < | ||
< | < | ||
- | </ | + | </ |
</ | </ | ||
+ | |||
</ | </ | ||
+ | |||
+ | A time stamp can be specified for each value: | ||
タイムスタンプは、それぞれの値ごとに定義できます。 | タイムスタンプは、それぞれの値ごとに定義できます。 | ||
- | < | + | < |
- | < | + | < |
- | < | + | < |
- | < | + | < |
- | < | + | |
- | < | + | |
- | < | + | |
- | </ | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | </ | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | </ | + | |
- | </ | + | </ |
- | </ | + | </ |
</ | </ | ||
- | さらに、使用量の単位と閾値の定義を含んだ例を見てみましょう。 | + | [[ja: |
- | < | + | ===== (OBSOLETE) ===== |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | </ | + | |
- | < | + | ==== Windows ==== |
- | < | + | |
- | < | + | ソースからビルドするには、MinGW tools を含む最新の Dev-Cpp IDE 版が必要です。[[http:// |
- | < | + | |
- | < | + | '' |
- | < | + | |
- | <data>< | + | ソースからのビルドで問題を見つけた場合は、メール |
- | </module> | + | |
+ | ==== Linux でのクロスコンパイル ==== | ||
+ | |||
+ | Linux で Pandora FMS Windows エージェントをクロスコンパイルするには、次のようにします。 | ||
+ | |||
+ | === Linux への MinGW のインストール === | ||
+ | |||
+ | Ubuntu/Debian の場合: | ||
+ | |||
+ | sudo aptitude install mingw32 | ||
+ | |||
+ | SUSE または RPM 管理の環境の場合 (手動での Zypper の利用) は、以下の RUL より: | ||
+ | |||
+ | http:// | ||
+ | |||
+ | === エージェントに必要な追加ライブラリのインストール === | ||
+ | |||
+ | * win32api | ||
+ | * odbc++ | ||
+ | * curl | ||
+ | * openssl | ||
+ | * zlib | ||
+ | * Boost C++ libraries (http:// | ||
+ | |||
+ | 例えば、Openssl パッケージをインストールするには次のようにします。 | ||
+ | |||
+ | http:// | ||
+ | |||
+ | openssl-0.9.8e-1cm.DevPak | ||
+ | |||
+ | openssl-0.9.8e-1cm.DevPak を展開します。 | ||
+ | |||
+ | tar jxvf openssl-0.9.8e-1cm.DevPak | ||
+ | |||
+ | ライブラリおよびインクルードファイルを MinGW のあるクロスコンパイル環境にコピーします。 | ||
+ | |||
+ | <code> | ||
+ | cp lib/*.a / | ||
+ | cp -r include/* / | ||
</ | </ | ||
+ | |||
+ | 依存関係やライブラリの問題は、ご自身で解決する必要があります。 | ||
+ | これらを簡単にできるように、Pandora FMS の公式ダウンロードサイトに必要なライブラリとインクルードファイルを tar で固めたファイルを // | ||
+ | という名前で置いてあります。 | ||
+ | |||
+ | === コンパイルおよびリンク === | ||
+ | |||
+ | コンパイラおよび、インクルードファイル、ライブラリのインストール後、Pandora FMS エージェントのソースディレクトリへ行き、以下を実行します。 | ||
+ | |||
+ | ./configure --host=i586-mingw32msvc && make | ||
+ | |||
+ | これで、実行可能な .exe ファイルが生成されます。 | ||