ja:documentation:pandorafms:technical_reference:01_development_and_extension

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:technical_reference:01_development_and_extension [2024/09/01 06:17] – [状態関数] junichija: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:documentation:pandorafms:complex_environments_and_optimization:09_pandorafms_engineering#ks1_2|Pandora FMS engineering]].+For a separate and detailed explanation about Pandora FMS database structure see the article [[:en:documentation:pandorafms:complex_environments_and_optimization:09_pandorafms_engineering#ks1_2|Pandora FMS engineering]].
  
 Pandora FMS データベースの構造に関する詳細については、 [[:ja:documentation:pandorafms:complex_environments_and_optimization:09_pandorafms_engineering#ks1_2|Pandora FMS の技術情報]] を参照してください。 Pandora FMS データベースの構造に関する詳細については、 [[:ja:documentation:pandorafms:complex_environments_and_optimization:09_pandorafms_engineering#ks1_2|Pandora FMS の技術情報]] を参照してください。
行 352: 行 352:
  
 === 補助関数 === === 補助関数 ===
 +
 +These functions perform agent-related tasks for some views:
  
 これらの関数は、いくつかの場面でエージェントに関連した処理を実行します。 これらの関数は、いくつかの場面でエージェントに関連した処理を実行します。
  
-  * **agents_tree_view_alert_img ($alert_fired)**: 発生したアラートの数に依存したツリービューのアラート画像のパスを返します。+----
  
-  * **agetns_tree_view_status_img ($critical, $warning, $unknown)**: ツリービュの状態画像のパスを返します。+<code php> 
 +agents_tree_view_alert_img ($alert_fired) 
 + 
 +</code> 
 + 
 +Returns the path to the alert image used in the Tree View. 
 + 
 +ツリー表示で使用されるアラート画像へのパスを返します。 
 + 
 +---- 
 + 
 +<code php> 
 +agetns_tree_view_status_img ($critical, $warning, $unknown) 
 + 
 +</code> 
 + 
 +Returns the path of the image for the agent status used in the Tree View. 
 + 
 +ツリー表示で使用されるエジェントステータス画像のパスを返します。 
 + 
 +----
  
 ==== グループ ==== ==== グループ ====
行 369: 行 391:
 === サーバ関数 === === サーバ関数 ===
  
-  * **pandora_group_statistics**この関数は、**リアルタイム更新**が off のときグループの状態を計算します。+<code php> 
 +pandora_group_statistics 
 + 
 +</code> 
 + 
 +This function calculates group statistics if the **Use realtime statistics** parameter is disabled. 
 + 
 +この関数は、**リアルタイム統計を使用する(Use realtime statistics)** パラメータ無効になっている場合にグループ統計を計算します。
  
 === コンソール関数 === === コンソール関数 ===
  
-コンソール関数は、エージェントグループの構造に基づいて状態を計算します。これらの関数は、無効化されたエージェントやモジュールは返しません。+== グループ ==
  
-  * **groups_agent_unknown ($group_array)**: 指定したグループの不明状態のエージェント数を返します。+The console functions calculate statistics based on a matrix of agent groups.
  
-  * **groups_agent_ok ($group_array)**: 指定したグルプの正常状態のエージェントします。+コンソル関数は、エージェントグループのマトリックスに基づいて統計計算します。
  
-  * **groups_agent_critical ($group_array)**: 指定したグループの障害状態のエージェント数を返します。+**These functions do not use the disabled agents or modules:**
  
-  * **groups_agent_warning ($group_array)**: 指定したグループの警告状態のエージェントします。+**これら機能は、無効なエージェントまたはモジュール使用しません:**
  
-これらの関数はモジュールの状態を計算します。無効化されたモジュールやエージェントには使えません。+----
  
-  * **groups_monitor_not_init ($group_array)**: 指定したグループの未初期化状態のエージェント数を返します。+<code php> 
 +groups_agent_unknown ($group_array)
  
-  * **groups_monitor_ok ($group_array)**: 指定したグループの正常状態のモジュール数を返します。+</code>
  
-  * **groups_monitor_critical ($group_array)**: 指定したグループの障害状態のモジュール数を返します。+Returns the number of agents in unknown state for the given groups.
  
-  * **groups_monitor_warning ($group_array)**: 指定たグループの警告状態のモュール数を返します。+指定されたグループの不明状態にあるエーェント数を返します。
  
-  * **groups_monitor_unknown ($group_array)**: 指定したグループの不明状態のモジュール数を返します。+----
  
-  * **groups_monitor_alerts ($group_array)**: 指定したグループのアラートがついているモジュール数を返します。+<code php> 
 +groups_agent_ok ($group_array)
  
-  * **groups_monitor_fired_alerts ($group_array)**: 指定したグループのアラートが発生ているモジュール数を返します。+</code> 
 + 
 +Returns the number of agents in normal state for the given groups. 
 + 
 +指定されたグループの正常状態のエージェント数を返します。 
 + 
 +---- 
 + 
 +<code php> 
 +groups_agent_critical ($group_array) 
 + 
 +</code> 
 + 
 +Returns the number of agents in critical state for the given groups. 
 + 
 +指定されたグループの障害状態にあるエージェント数を返します。 
 + 
 +---- 
 + 
 +<code php> 
 +groups_agent_warning ($group_array) 
 + 
 +</code> 
 + 
 +Returns the number of agents in warning status for the given groups. 
 + 
 +指定されたグループの警告状態にあるエージェント数を返します。 
 + 
 +---- 
 + 
 +== モジュール == 
 + 
 +**These functions calculate statistics for modules. They do not use the disabled modules or agents:** 
 + 
 +**これらの関数はモジュールの統計を計算します。無効なモジュールやエージェントは使用しません:** 
 + 
 +---- 
 + 
 +<code php> 
 +groups_monitor_not_init ($group_array) 
 + 
 +</code> 
 + 
 +Returns the number of modules with uninitialized status for the given groups. 
 + 
 +指定されたグループの未初期化状態のモジュール数を返ます。 
 + 
 +---- 
 + 
 +<code php> 
 +groups_monitor_ok ($group_array) 
 + 
 +</code> 
 + 
 +Returns the number of modules with normal status for the given groups. 
 + 
 +指定されたグループの正常状態のモジュール数を返します。 
 + 
 +---- 
 + 
 +<code php> 
 +groups_monitor_critical ($group_array) 
 + 
 +</code> 
 + 
 +Returns the number of modules with critical status for the given groups. 
 + 
 +指定されたグループの障害状態のモジュール数を返します。 
 + 
 +---- 
 + 
 +<code php> 
 +groups_monitor_warning ($group_array) 
 + 
 +</code> 
 + 
 +Returns the number of modules with warning status for the given groups. 
 + 
 +指定されたグループの警告状態のモジュール数を返します。 
 + 
 +---- 
 + 
 +<code php> 
 +groups_monitor_unknown ($group_array) 
 + 
 +</code> 
 + 
 +Devuelve el número de módulos con estado desconocido para los grupos dados. 
 + 
 +指定されたグループの不明状態のモジュール数を返します。 
 + 
 +---- 
 + 
 +<code php> 
 +groups_monitor_alerts ($group_array) 
 + 
 +</code> 
 + 
 +Returns the number of modules with alerts for the given groups. 
 + 
 +指定されたグループのアラートが設定されたモジュール数を返ます。 
 + 
 +---- 
 + 
 +<code php> 
 +groups_monitor_fired_alerts ($group_array) 
 + 
 +</code> 
 + 
 +Returns the number of modules with triggered alerts for the given groups. 
 + 
 +指定されたグループの発報されたアラートがあるモジュール数を返します。
  
 ==== モジュール ==== ==== モジュール ====
  
-これらの関数は、モジュール名をもとにした情報を返します。無効化したエージェントやモジュールには使えません。+These functions return statistics based on the module name. They do not take into account disabled agents and modules.
  
-  * **modules_agents_unknown ($module_name)**: 指定したモジュール名が不明状態のエージェント数を返し+これらの関数は、モジュール名に基づいて統計を返します。無効なエージェントとモジュールは考慮されせん
  
-  * **modules_agents_ok ($module_name)**: 指定したモジュール名が正常状態のエージェント数を返します。+<code php> 
 +modules_agents_unknown ($module_name)
  
-  * **modules_agents_critical ($module_name)**: 指定したモジュール名が障害状態のエージェント数を返します。 
  
-  * **modules_agents_warning ($module_name)**: 指定したモジュール名が警告状態のエージェント数を返します。+</code>
  
-これらの関すは、モジュールグループみ基づいた状態を返します。無効化したエージェントやモジュールには使えません。+Returns the number of agents in unknown status that have a module with the given name.
  
-  * **modules_group_agent_unknown ($module_group)**: 指定たモジュールグループに所属しているモジュールが不明状態のエージェント数を返します。+指定され名前のモジュールを持つ不明状態のエージェント数を返します。
  
-  * **modules_group_agent_ok ($module_group)**: 指定したモジュールグループに所属しているモジュールが正常状態のエージェント数を返します。+----
  
-  * **modules_group_agent_critical ($module_group)**: 指定したモジュールグループに所属しているモジュールが障害状態のエージェント数を返します。+<code php> 
 +modules_agents_ok ($module_name)
  
-  * **modules_group_agent_warning ($module_group)**: 指定したモジュールグループに所属しているモジュールが警告状態のエージェント数を返します。 
  
-==== ポリシー ====+</code>
  
-これらの関数は、指定したポリシーのそれぞれの状態にあるエージェント数を返します。無効化したエージェントやモジュールには使えません。+Returns the number of agents in normal state that have a module with the given name.
  
-  * **policies_agents_critical ($id_policy)**: 指定ポリシに属する障害状態のエージェント数を返します。+指定され名前のモジュルを持つ、正常状態のエージェント数を返します。
  
-  * **policies_agents_ok ($id_policy)**: 指定したポリシーに属する正常状態のエージェント数を返します。+----
  
-  * **policies_agents_unknown ($id_policy)**: 指定したポリシーに属する不明状態のエージェント数を返します。+<code php> 
 +modules_agents_critical ($module_name)
  
-  * **policies_agents_warning ($id_policy)**: 指定したポリシーに属する警告状態のエージェント数を返します。 
  
-==== OS ====+</code>
  
-これらの関数は、OS に基づいたエージェントの状態を返します。無効化したエージェントやモジュールには使えません。+Returns the number of agents in critical status that have a module with the given name.
  
-  * **os_agents_critical ($id_os)**: 指定た OS で障害状態のエージェント数を返します。+指定され名前のモジュールを持つ、障害状態のエージェント数を返します。
  
-  * **os_agents_ok($id_os)**: 指定した OS で正常状態のエージェント数を返します。+----
  
-  * **os_agents_warning ($id_os)**: 指定した OS で障害状態のエージェント数を返します。+<code php> 
 +modules_agents_warning ($module_name)
  
-  * **os_agents_unknown ($id_os)**: 指定した OS で不明状態のエージェント数を返します。 
  
-===== 開発 =====+</code>
  
-ほとんどの拡張は、サーバプラグイン、Unix エージェントプラグイン、コンソール拡張といったそれぞれの章で説明しています。この章では、Pandora FMS との連携および、Windows エージェントのソースからのコンパイル方法について説明します。今後も、特定の章に属さない開発に関わる内容については、この章に記載していきます。+Returns the number of agents in warning status that have a module with the given name.
  
-==== Pandora FMS プロジェへの協力 ====+指定された名前のモジュールを持つ警告状態のエージェ数を返します。
  
-このプロジェクトは、プロジェクトを支えるボランティアの開発者によって成り立っています。新たな開発者、ドキュメント作成者や、その他協力したいと考えている方は、常に歓迎です。まず最初は、メーリングリストやフォーラムに参加いただくのが良いです。+----
  
 +**These functions return statistics using the module group as a filter. It does not take into account disabled agents or modules:**
  
 +**これらの関数は、モジュール グループをフィルターとして使用して統計情報を返します。無効なエージェントやモジュールは考慮されません。**
  
-==== バグ / エラー ====+----
  
-不具合報告は、Pandora FMS の拡張の助けになります。なお、不具合報告を送信する前に、我々の不具合に関するデータベースを確認し、同様の報告がすでにあがっていないかを確認してください。不具合報告は、我々のプロジェクトページ http://sourceforge.net/projects/pandora/ から、Sourceforge のバグトラッキングシステムを使って送信することができます。+<code php> 
 +modules_group_agent_unknown ($module_group)
  
-==== メーリングリスト ==== 
  
-メーリングリストは、簡単に最新情報をメールで受け取るには良い手段です。ユーザ向けのお知らせを送信する public メーリングリスト (流量は少ないです) と、技術的な議論を行う develop メーリングリストを用意しています。また、SVN システムから自動的に通知される変更情報を受け取るためのメーリングリスト (ほぼ毎日) があります。+</code>
  
-===== Windows エージェントのソースからのコンパイル =====+Returns the number of agents with unknown status that have modules belonging to the given module group.
  
-==== 最新ソ入手 ====+指定されたモジュルグループに属するモジュールを持つ、不明状態エージェント数を返します。
  
-我々のリポジトリから最新のソースを入手するには、Subversion クライアントが必要です。そして、次のように実行します。+----
  
-  svn co https://svn.sourceforge.net/svnroot/pandora pandora+<code php> 
 +modules_group_agent_ok ($module_group)
  
-==== Windows ==== 
  
-ソースからビルドするには、MinGW tools を含む最新の Dev-Cpp IDE 版が必要です。[[http://www.bloodshed.net/devcpp.html|こちらからダウンロードできます。]]+</code>
  
-''PandoraAgent.dev'' を Dev-Cpp で開き、プロジェクトを作成します。デフォルトのインストールですべてコンパイル可能です。+Returns the number of agents with normal status that have modules belonging to the given module group.
  
-スからのビドで問題けた場合はメール (ramon.novoa@artica.es) もしくは [[http://pandora.sourceforge.net|SourceForge 上プロジェページ]] にてお知らせください+指定されたモジュールグループに属するモジュールをつ、正常状態エージェ数を返します
  
-==== Linux でのクロスコンパイル ====+----
  
-Linux で Pandora FMS Windows エージェントをクロスコンパイルするには、次のようにします。+<code php> 
 +modules_group_agent_critical ($module_group)
  
-=== Linux への MinGW のインストール === 
  
-Ubuntu/Debian の場合:+</code>
  
-  sudo aptitude install mingw32+Returns the number of agents with critical status that have modules belonging to the given module group.
  
-SUSE まは RPM 管理の環境の場合 (手動での Zypper の利用) は以下の RUL より:+指定されモジュールグループに属するモジュールを持つ障害状態エージェント数を返します。
  
-  http://download.opensuse.org/repositories/CrossToolchain:/mingw/openSUSE_11.1/+----
  
-=== エージェントに必要な追加ライブラリのインストール ===+<code php> 
 +modules_group_agent_warning ($module_group)
  
-  * win32api 
-  * odbc++ 
-  * curl 
-  * openssl 
-  * zlib 
-  * Boost C++ libraries (http://sourceforge.net/projects/boost/files/) 
  
-例えば、Openssl パッケージをインストールするには次のようにします。+</code>
  
-http://sourceforge.net/projects/devpaks/files/ へ行き、ファイルをダウンロードします。+Returns the number of agents with warning status that have modules belonging to the given module group.
  
-  openssl-0.9.8e-1cm.DevPak+指定されたモジュールグループに属するモジュールを持つ、警告状態のエージェント数を返します。
  
-openssl-0.9.8e-1cm.DevPak を展開します。+==== ポリシー ====
  
-  tar jxvf openssl-0.9.8e-1cm.DevPak+These functions return the number of agents for each given state and policyThey do not use the disabled agents and modules to calculate the result.
  
-ライブラおよびインクルドファイルを MinGW のあるクロスコンパイル環境コピーします。+これらの関数は、指定された状態とポごとジェントの数を返します。無効なエージェントとモジュールは結果の計算に使用されません。 
 + 
 +<code php> 
 +policies_agents_critical ($id_policy)
  
-<code> 
- cp lib/*.a /usr/i586-mingw32msvc/lib/ 
- cp -r include/* /usr/i586-mingw32msvc/include/ 
 </code> </code>
  
-依存関係やライブラリの問題は、ご自身で解決する必要があります。 +Returns the number of agents with critical status that belong to a given policy.
-これらを簡単にできるように、Pandora FMS の公式ダウンロードサイトに必要なライブラリとインクルードファイルを tar で固めたファイルを //mingw_pandorawin32_libraries_9Oct2009.tar.gz// +
-という名前で置いてあります。+
  
-=== コンパイルおよびリンク ===+指定されたポシーに属する、障害状態のエージェト数を返します。
  
-コンパイラおよび、インクルードファイル、ライブラリのインストール後、Pandora FMS エージェントのソースディレクトリへ行き、以下を実行します。+----
  
-  ./configure --host=i586-mingw32msvc && make+<code php> 
 +policies_agents_ok ($id_policy)
  
-これで、実行可能な .exe ファイルが生成されます。+</code>
  
-===== 外部 API =====+Returns the number of agents with normal status that belong to a given policy.
  
-Pandora FMS には、他のアプションとの連携をとり、Pandora FMS から情報を取得したり Pandora FMS 情報を提供するため外部 API があります。これに関するドキュメントは、補足資料の Pandora FMS 外部 API にあります。+指定されたポーにする、正常状態エージェント数を返します。
  
-===== Pandora FMS XML データファイルフォーマット =====+---- 
 + 
 +<code php> 
 +policies_agents_unknown ($id_policy) 
 + 
 +</code> 
 + 
 +Returns the number of agents with unknown status that belong to a given policy. 
 + 
 +指定されたポリシーに属する不明状態のエージェント数を返します。 
 + 
 +---- 
 + 
 +<code php> 
 +policies_agents_warning ($id_policy) 
 + 
 +</code> 
 + 
 +Returns the number of agents with warning status that belong to a given policy. 
 + 
 +指定されたポリシーに属する警告状態のエージェント数を返します。 
 + 
 +==== OS ==== 
 + 
 +**These functions calculate the statistics for the agents based on the Operating Systems they belong to. They do not use disabled agents or modules.** 
 + 
 +**これらの関数は、エージェントが属するオペレーティング システムに基づいてエージェントの統計を計算します。無効なエージェントやモジュールは使用しません。** 
 + 
 +<code php> 
 +os_agents_critical ($id_os) 
 + 
 +</code> 
 + 
 +Returns the number of agents in critical state that belong to the given Operating System. 
 + 
 +指定されたオペレーティングシステムに属する、障害状態のエージェント数を返します。 
 + 
 +---- 
 + 
 +<code php> 
 +os_agents_ok($id_os) 
 + 
 +</code> 
 + 
 +Returns the number of agents in normal state that belong to the given Operating System. 
 + 
 +指定されたオペレーティングシステムに属する、正常状態のエージェント数を返します。 
 + 
 +---- 
 + 
 +<code php> 
 +os_agents_warning ($id_os) 
 + 
 +</code> 
 + 
 +Returns the number of agents in warning status that belong to the given Operating System. 
 + 
 +指定されたオペレーティングシステムに属する警告状態のエージェント数を返します。 
 + 
 +---- 
 + 
 +<code php> 
 +os_agents_unknown ($id_os) 
 + 
 +</code> 
 + 
 +Returns the number of agents in unknown state that belong to the given Operating System. 
 + 
 +指定されたオペレーティングシステムに属する不明状態のエージェント数を返します。 
 + 
 +===== 開発 ===== 
 + 
 +Most of the extensions have been described as independent annexes, specialized for server plugin creation, Unix agent plugins, and Web Console extensions. This chapter describes how to collaborate in Pandora FMS and how to compile the Windows agent from the sources. 
 + 
 +ほとんどの拡張は、サーバプラグイン、Unix エージェントプラグイン、コンソール拡張といったそれぞれの章で説明しています。この章では、Pandora FMS との連携および、Windows エージェントのソースからのコンパイル方法について説明します。 
 + 
 +==== Pandora FMS プロジェクトへの協力 ==== 
 + 
 +This project is maintained by volunteer developers with their contributions. New developers, documentation writers, or people who want to help are always welcome. A good way to get started is by subscribing to our mailing lists and/or [[https://pandorafms.com/community/|forum]]. 
 + 
 +このプロジェクトはボランティア開発者の貢献によって維持されています。新しい開発者、ドキュメント作成者、または協力したい人はいつでも歓迎します。始めるには、メーリングリストや [[https://pandorafms.com/community/|フォーラム]] を購読するのが良い方法です。 
 + 
 +==== バグ ==== 
 + 
 +Inform about possible errors helps us improve Pandora FMS. Please, before forwarding a bug report [[https://github.com/pandorafms/pandorafms/issues|check our bug database]]//.// 
 + 
 +考えられるエラーを報告することは、Pandora FMS の改善に役立ちます。バグレポートを送信する前に、[[https://github.com/pandorafms/pandorafms/issues|バグデータベースを確認してください]]。 
 + 
 +==== メーリングリスト ==== 
 + 
 +Mailing lists are a great way to keep up to date by email. We have a public mailing list for users and announcements (with low traffic) and a development mailing list for technical discussions and (sometimes daily) development notifications via our GIT (Code Version Control System) automatic notification system. 
 + 
 +メーリング リストは、電子メールで最新情報を入手するのに最適な方法です。ユーザーとお知らせ用の公開メーリング リスト (トラフィックは少ない) と、技術的な議論や (場合によっては毎日の) GIT (コード バージョン コントロール システム) 自動通知システム経由の開発通知用の開発メーリング リストがあります。 
 + 
 + 
 +===== Windows エージェントのソースからのコンパイル ===== 
 + 
 +==== 最新ソースの入手 ==== 
 + 
 +To get the latest version of the code it is essential to download the sources from the code repository [[http://github.com/pandorafms/pandorafms/issues|GitHub]], where the official Pandora FMS repository is published. 
 + 
 +最新バージョンのコードを入手するには、公式の Pandora FMS リポジトリが公開されているコードリポジトリ [[http://github.com/pandorafms/pandorafms/issues|GitHub]] からソースをダウンロードすることが不可欠です。 
 + 
 + 
 +===== 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:documentation:pandorafms:technical_reference:02_annex_externalapi|appendix of Pandora FMS External API]]. 
 + 
 +Pandora FMS 外部 API を使用すると、サードパーティのアプリケーションを Pandora FMS にリンクして、Pandora FMS から情報を取得したり、Pandora FMS 内に情報を取り込んだりすることができます。このドキュメントはすべて [[ja:documentation:pandorafms:technical_reference:02_annex_externalapi|Pandora FMS 外部 API]] にあります。 
 + 
 +===== XML データファイルフォーマット ===== 
 + 
 +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.
  
 Pandora FMS の XML データファイルのフォーマットを理解することで、エージェントプラグインの拡張や、独自エージェントの作成、Pandora FMS データサーバへの独自 XML ファイルの送信などができるようになります。 Pandora FMS の XML データファイルのフォーマットを理解することで、エージェントプラグインの拡張や、独自エージェントの作成、Pandora FMS データサーバへの独自 XML ファイルの送信などができるようになります。
 +
 +Like any XML document, the data file must begin with an XML declaration:
  
 すべての XML ドキュメントど同じように、データファイルは次のような XML の宣言で始まります。  すべての XML ドキュメントど同じように、データファイルは次のような XML の宣言で始まります。 
  
-   <?xml version='1.0' encoding='UTF-8'?>+<code xml> 
 +<?xml version='1.0' encoding='UTF-8'?> 
 + 
 +</code> 
 + 
 +Next comes the **agent_data** element that defines the agent that sends the data. It supports the following attributes:
  
 次に、エージェントが送るデータを定義する **agent_data** 要素が来ます。次に示す属性に対応しています。 次に、エージェントが送るデータを定義する **agent_data** 要素が来ます。次に示す属性に対応しています。
  
-   * //description//: Agent description+  * //description//: Description of the agent
-  * //group//: Name of the group the agent belongs to (it must exist in Pandora FMS database). +  * //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
-  * //os_name//: Name of the operating system the agent runs in (it must exist in Pandora FMS database). +  * //os_name//: Name of the operating system where the agent runs (must exist in the Pandora FMS database). 
-  * //os_version//: Free string describing the version of the operating system.+  * //os_version//: Free string describing the operating system version.
   * //interval//: Agent interval (in seconds).   * //interval//: Agent interval (in seconds).
-  * //version//: Agent version string+  * //version//: String with the agent'version. 
-  * //timestamp//: Timestamp indicating when the XML file was generated (YYYY/MM/DD HH:MM:SS). +  * //timestamp//: Timestamp that indicates when the XML (''YYYY/MM/DD HH:MM:SS''). 
-  * //agent_name//: Name of the agent. +  * //agent_name//: Name of agent. 
-  * //timezone_offset//: Offset that will be added to the timestamp (in hours). Useful if you are working with UTC. +  * //timezone_offset//: Offset that is added to the timestamp (in hours). Useful when working with UTC. 
-  * //address//: Agent IP address (or FQN). +  * //address//: Agent IP address (or FQDN). 
-  * //parent_agent_name//: Name of the agent's parent.+  * //parent_agent_name//: Name of agent's parent.
   * //agent_alias//: Agent's alias.   * //agent_alias//: Agent's alias.
   * //agent_mode//: Agent's working mode (0: Normal mode, 1: Learning mode, 2: Autodisable mode) .   * //agent_mode//: Agent's working mode (0: Normal mode, 1: Learning mode, 2: Autodisable mode) .
   * //secondary_groups//: Secondary groups added to the agent.   * //secondary_groups//: Secondary groups added to the agent.
-  * //custom_id//: Custom agent ID. +  * //custom_id//: Personalized agent ID. 
-  * //url_address//: Agent access URL.+  * //url_address//: URL of access to the agent.
  
   * //description//: エージェントの説明   * //description//: エージェントの説明
行 582: 行 839:
  
    <agent_data description= group= os_name='linux' os_version='Ubuntu 10.10' interval='30' version='3.2(Build 101227)' timestamp='2011/04/20 12:24:03' agent_name='foo' timezone_offset='0' parent_agent_name='too' address='192.168.1.51' custom_id='BS4884' url_address='http://mylocalhost:8080'>    <agent_data description= group= os_name='linux' os_version='Ubuntu 10.10' interval='30' version='3.2(Build 101227)' timestamp='2011/04/20 12:24:03' agent_name='foo' timezone_offset='0' parent_agent_name='too' address='192.168.1.51' custom_id='BS4884' url_address='http://mylocalhost:8080'>
 +
 +A **module** element is then required for each module, and the following elements can be nested to define the module:
  
 そして、モジュールごとに、**module** という要素が必要です。モジュールの定義のために、次の要素を入れることができます。 そして、モジュールごとに、**module** という要素が必要です。モジュールの定義のために、次の要素を入れることができます。
行 587: 行 846:
   * **name**: Module name.   * **name**: Module name.
   * **description**: Module description.   * **description**: Module description.
-  * **tags**: Tags associated to the module. +  * **tags**: Tags associated with the module. 
-  * **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**: Module's maximum value. +  * **max**: Maximum value of the module
-  * **min**: Module's minimum value. +  * **min**: Minimum module value. 
-  * **post_process**: Post-process value. +  * **post_process**: Post-processing value. 
-  * **module_interval**: Module interval (interval in seconds/agent interval). +  * **module_interval**: Module interval (interval in seconds / agent interval). 
-  * **min_critical**: Minimum value for critical status+  * **min_critical**: Minimum value for the critical state
-  * **max_critical**: Maximum value for critical status+  * **max_critical**: Maximum value for the critical state
-  * **min_warning**: Minimum value for warning status+  * **min_warning**: Minimum value for the alert state
-  * **max_warning**: Maximum value for warning status+  * **max_warning**: Maximum value for the alert state
-  * **disabled**: It disables (0) or enables (1) the module. Disabled modules are not processed. +  * **disabled**: Disable (0) or enable the module. Disabled modules are not processed. 
-  * **min_ff_event**: FF threshold. +  * **min_ff_event**: Minimum FF threshold. 
-  * **status**: Module status (NORMAL, WARNING or CRITICAL). Warning and critical thresholds are ignored if the status is set+  * **status**: Module status (NORMAL, WARNING or CRITICAL). The critical and warning status limits are ignored if the status is specified
-  * **datalist**: Sends the module data in datalist format (one database entry for each of the values received) [0/1]. +  * **datalist**: Sends the module data in datalist format (one database entry for each of the values received)[0/1]. 
-  * **unit**: Module unit. Supports the _Timeticks_ macro to transform a data in timeticks format to dd/hh/mm/ss.+  * **unit**: Module unit. Supports the ''_timeticks_'' macro to transform a data in //timeticks// format to dd/hh/mm/ss.
   * **timestamp**: Sets a timestamp on the data received from the module.   * **timestamp**: Sets a timestamp on the data received from the module.
   * **module_group**: Group of modules to which the module will be added.   * **module_group**: Group of modules to which the module will be added.
-  * **custom_id**: Module custom ID.+  * **custom_id**: Custom ID of the module.
   * **str_warning**: Warning threshold for string modules.   * **str_warning**: Warning threshold for string modules.
   * **str_critical**: Critical threshold for string modules.   * **str_critical**: Critical threshold for string modules.
-  * **critical_instructions**: Module Critical instructions. +  * **critical_instructions**: module Critical instructions. 
-  * **warning_instructions**: Module Warning instructions. +  * **warning_instructions**: module Warning instructions. 
-  * **unknown_instructions**: Module Unknown instructions.+  * **unknown_instructions**: module Unknown instructions.
   * **critical_inverse**: Activates the Inverse interval at the critical threshold of the module. [0/1].   * **critical_inverse**: Activates the Inverse interval at the critical threshold of the module. [0/1].
-  * **warning_inverse**: Activates the Inverse interval at the warning threshold of the module. [0/1].+  * **warning_inverse**: Activates the Inverse interval on the module warning threshold [0/1].
   * **quiet**: Activates the Quiet mode of the module [0/1].   * **quiet**: Activates the Quiet mode of the module [0/1].
   * **module_ff_interval**: Specifies a value of FF Interval of the module.   * **module_ff_interval**: Specifies a value of FF Interval of the module.
行 618: 行 877:
   * **crontab**: Specifies a crontab in the module.   * **crontab**: Specifies a crontab in the module.
   * **min_ff_event_normal**: FF threshold value on change of state to NORMAL.   * **min_ff_event_normal**: FF threshold value on change of state to NORMAL.
-  * **min_ff_event_warning**: FF threshold value on change of state to WARNING. +  * **min_ff_event_warning**: FF threshold value on state change to WARNING. 
-  * **min_ff_event_critical**: FF threshold value on change of state to CRITICAL.+  * **min_ff_event_critical**: FF threshold value on state change to CRITICAL.
   * **ff_timeout**: FlipFlop timeout value.   * **ff_timeout**: FlipFlop timeout value.
-  * **each_ff**: Activate option “Change each status”.+  * **each_ff**: Habilita la opción “Change each status”.
   * **module_parent**: Name of the module in the same agent that will be the parent of this module.   * **module_parent**: Name of the module in the same agent that will be the parent of this module.
-  * **ff_type**: Activates the Keep counter of the FF threshold[0/1].+  * **ff_type**: Activa el Keep counters del FF threshold [0/1]
 +  * **min_warning_forced**: Forces min_warning to the new specified value even if the module exists, takes precedence over **min_warning**. 
 +  * **max_warning_forced**: Forces max_warning to the new specified value even if the module exists, takes precedence over **max_warning**. 
 +  * **min_critical_forced**: Forces min_critical to the new value indicated even if the module exists, takes precedence over **min_critical**. 
 +  * **max_critical_forced**: Forces max_critical to the new specified value even if the module exists, it takes precedence over **max_critical**. 
 +  * **str_warning_forced**: Forces str_warning to the new specified value even if the module exists, takes precedence over **str_warning**. 
 +  * **str_critical_forced**: Forces str_critical to the new specified value even if the module exists, takes precedence over **str_critical**.
  
   * **name**: モジュールの名前。   * **name**: モジュールの名前。
行 664: 行 929:
   * **module_parent**: 同一エージェントでこのモジュールの親となるモジュールの名前。   * **module_parent**: 同一エージェントでこのモジュールの親となるモジュールの名前。
   * **ff_type**: 連続障害検知抑制のカウンタ維持の有効化。[0/1]   * **ff_type**: 連続障害検知抑制のカウンタ維持の有効化。[0/1]
 +  * **min_warning_forced**: モジュールが存在する場合でも、min_warning を新しい指定値に強制し、**min_warning** よりも優先されます。
 +  * **max_warning_forced**: モジュールが存在する場合でも、max_warning を新しい指定値に強制し、**max_warning** よりも優先されます。
 +  * **min_critical_forced**: モジュールが存在する場合でも、min_critical を指定された新しい値に強制し、**min_critical** よりも優先されます。
 +  * **max_critical_forced**: モジュールが存在する場合でも、max_critical を新しく指定された値に強制し、**max_critical** よりも優先されます。
 +  * **str_warning_forced**: モジュールが存在する場合でも、str_warning を新しい指定値に強制し、**str_warning** よりも優先されます。
 +  * **str_critical_forced**: モジュールが存在する場合でも、str_critical を新しい指定値に強制し、**str_critical** よりも優先されます。
  
-Pandora FMS バージョン 749 から、しきい値を強制するための新たなトークンが追加されました。+<WRAP center round important 90%>
  
-  * **min_warning_forced**: モジュールに設定が存在する場合でも、警告の最小値を新しい値にします。min_warningよりも優先されます。 +These tokens will only work for **dataserver plugins**.
-  * **max_warning_forced**: モジュールに設定が存在する場合でも、警告の最大値を新しい値にします。max_warningよりも優先されます。 +
-  * **min_critical_forced**: モジュールに設定が存在する場合でも、障害の最小値を新しい値にします。min_critical よりも優先されます。 +
-  * **max_critical_forced**: モジュールに設定が存在する場合でも、障害の最大値を新しい値にします。max_critical よりも優先されます。 +
-  * **str_warning_forced**: モジュールに設定が存在する場合でも、文字列の警告条件を新しい値にします。str_warning よりも優先されます。 +
-  * **str_critical_forced**: モジュールに設定が存在する場合でも、文字列の障害条件を新しい値にします。str_critical よりも優先されます。+
  
-<WRAP center round important 60%> 
-これらのトークンは、**データサーバプラグイン** のみで動作します。 
 </WRAP> </WRAP>
  
-その他の要素は、モジュールの拡張情報として Pandora FMS のデータベースに保存されます。+<WRAP center round important 90%>
  
-{{  :wiki:module_extended_info.png?900  }}+これらのトークンは、**データサーバプラグイン** のみで動作します。
  
-モジュールは、少なくとも **name**, **type**, および **data** の要素を持たなければいけません。+</WRAP>
  
-:+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:
  
-<code>+その他の要素は、モジュールの拡張情報として Pandora FMS データベースに保存されます。モジュールには、少なくとも 1 つの要素 **name**、**type**、**data** が必要です。例: 
 + 
 +その他の要素は、モジュールの拡張情報として Pandora FMS のデータベースに保存されます。 
 + 
 +<code xml>
   <module>   <module>
     <name>CPU</name>     <name>CPU</name>
行 693: 行 961:
     <data>21</data>     <data>21</data>
   </module>   </module>
 +
 </code> </code>
 +
 +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 は次のようになります。 
  
-<code>+<code xml>
 <module> <module>
-<type>async_string</type> + <type>async_string</type> 
-<datalist>+ <datalist>
    <data><value><![CDATA[xxxxx]]></value></data>    <data><value><![CDATA[xxxxx]]></value></data>
    <data><value><![CDATA[yyyyy]]></value></data>    <data><value><![CDATA[yyyyy]]></value></data>
    <data><value><![CDATA[zzzzz]]></value></data>    <data><value><![CDATA[zzzzz]]></value></data>
-</datalist>+ </datalist>
 </module> </module>
 +
 </code> </code>
 +
 +A time stamp can be specified for each value:
  
 タイムスタンプは、それぞれの値ごとに定義できます。 タイムスタンプは、それぞれの値ごとに定義できます。
  
-<code> +<code xml
-  <module> +<module> 
-  <type>async_string</type> + <type>async_string</type> 
-  <datalist> + <datalist> 
-    <data> +   <data> 
-      <value><![CDATA[xxxxx]]></value> +     <value><![CDATA[xxxxx]]></value> 
-      <timestamp>1970-01-01 00:00:00</timestamp> +     <timestamp>1970-01-01 00:00:00</timestamp> 
-    </data> +   </data> 
-    <data> +   <data> 
-      <value><![CDATA[yyyyy]]></value> +     <value><![CDATA[yyyyy]]></value> 
-      <timestamp>1970-01-01 00:00:01</timestamp> +     <timestamp>1970-01-01 00:00:01</timestamp> 
-    </data> +   </data> 
-    <data> +   <data> 
-      <value><![CDATA[zzzzz]]></value> +     <value><![CDATA[zzzzz]]></value> 
-      <timestamp>1970-01-01 00:00:02</timestamp> +     <timestamp>1970-01-01 00:00:02</timestamp> 
-    </data> +   </data> 
-  </datalist> + </datalist> 
-  </module>+ </module> 
 </code> </code>
  
-さら、使用量の単位と閾値の定義を含んだ例を見てみましょう。+[[ja:documentation:start|Pandora FMS ドキュメント一覧戻る]]
  
-<code> +===== (OBSOLETE) =====
-<module> +
- <name><![CDATA[Cache mem free]]></name> +
- <description><![CDATA[Free cache memory in MB]]></description> +
-        <tags>tag</tags> +
- <type>generic_data</type> +
- <module_interval>1</module_interval> +
- <min_critical>100</min_critical> +
- <max_critical>499</max_critical> +
- <min_warning>500</min_warning> +
- <max_warning>600</max_warning> +
- <unit><![CDATA[MB]]></unit> +
- <data><![CDATA[3866]]></data> +
-</module>+
  
-<module> +==== Windows ==== 
- <name><![CDATA[Load Average]]></name> + 
- <description><![CDATA[Average process in CPU (Last minute) ]]></description> +ソースからビルドするには、MinGW tools を含む最新の Dev-Cpp IDE 版が必要です。[[http://www.bloodshed.net/devcpp.html|こちらからダウンロードできます。]] 
-        <tags>tag</tags> + 
- <type>generic_data</type> +''PandoraAgent.dev'' を Dev-Cpp で開き、プロジェクトを作成します。デフォルトのインストールですべてコンパイル可能です。 
- <module_interval>1</module_interval> + 
- <data><![CDATA[1.89]]></data> +ソースからのビルドで問題を見つけた場合は、メール (ramon.novoa@artica.esもしくは [[http://pandora.sourceforge.net|SourceForge 上のプロジェクトページ]] にてお知らせください。 
-</module>+ 
 +==== Linux でのクロスコンパイル ==== 
 + 
 +Linux で Pandora FMS Windows エージェントをクロスコンパイルするには、次のようにします。 
 + 
 +=== Linux への MinGW のインストール === 
 + 
 +Ubuntu/Debian の場合: 
 + 
 +  sudo aptitude install mingw32 
 + 
 +SUSE または RPM 管理の環境の場合 (手動での Zypper の利用) は、以下の RUL より: 
 + 
 +  http://download.opensuse.org/repositories/CrossToolchain:/mingw/openSUSE_11.1
 + 
 +=== エージェントに必要な追加ライブラリのインストール === 
 + 
 +  * win32api 
 +  * odbc++ 
 +  * curl 
 +  * openssl 
 +  * zlib 
 +  * Boost C++ libraries (http://sourceforge.net/projects/boost/files/) 
 + 
 +例えば、Openssl パッケージをインストールするには次のようにします。 
 + 
 +http://sourceforge.net/projects/devpaks/files/ へ行き、ファイルをダウンロードします。 
 + 
 +  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 /usr/i586-mingw32msvc/lib
 + cp -r include/* /usr/i586-mingw32msvc/include/
 </code> </code>
 +
 +依存関係やライブラリの問題は、ご自身で解決する必要があります。
 +これらを簡単にできるように、Pandora FMS の公式ダウンロードサイトに必要なライブラリとインクルードファイルを tar で固めたファイルを //mingw_pandorawin32_libraries_9Oct2009.tar.gz//
 +という名前で置いてあります。
 +
 +=== コンパイルおよびリンク ===
 +
 +コンパイラおよび、インクルードファイル、ライブラリのインストール後、Pandora FMS エージェントのソースディレクトリへ行き、以下を実行します。
 +
 +  ./configure --host=i586-mingw32msvc && make
 +
 +これで、実行可能な .exe ファイルが生成されます。
  
  • ja/documentation/pandorafms/technical_reference/01_development_and_extension.1725171459.txt.gz
  • 最終更新: 2024/09/01 06:17
  • by junichi