ja:documentation:pandorafms:technical_reference:01_development_and_extension

文書の過去の版を表示しています。


Pandora FMS 開発リファレンス

For a separate and detailed explanation about the Pandora FMS database structure see the article Pandora FMS engineering.

Pandora FMS データベースの構造に関する詳細については、 Pandora FMS の技術情報 を参照してください。

For all links, it is necessary to use the function ui_get_full_url. Before calling the function, it is necessary to include functions_ui.php.

すべてのリンクでは、関数 ui_get_full_url を使用する必要があります。関数を呼び出す前に、functions_ui.php をインクルードする必要があります。

  • When the URL is needed for refreshing, for example:
  • 更新に URL が必要な場合、たとえば次のようになります。
$url_refresh = ui_get_full_url();
  • When a URL is needed for a relative path, for example:
  • 相対パスに URL が必要な場合、たとえば次のようになります。
$url = ui_get_full_url("/relative/path/file_script.php");
  • JavaScript:
  • javascript の場合。
<?php
  ...
  $url = ui_get_full_url("/relative/path/file_script.php");
  ...
?>
 
<script type="text/javascript">
  ...
  jQuery.post ('<?php $url; ?>',
    {
     ...
    });
 ...
</script>
  • In special cases it is not necessary to use this function, for example direct links to the index.php:
  • 特別な場合には、この関数を使用する必要はありません。たとえば、index.php への直接リンクなどです。
echo '<form method="post" action="index.php?param=111?param=222?param=333?param=444?param=555?param=666">';

PFMS Web console only has a few web application execution entry points, unlike other web applications, for example:

PFMS Web コンソールには少しの実行エントリ ポイントしかありません。例えば、次のような他の Web アプリケーションとは異なります。

  • WordPress only has one frontend entry point and one backend entry point for administration.
  • SME web development that normally every PHP file is a possible entry point.
  • WordPress には、管理用のフロントエンド エントリ ポイントとバックエンド エントリ ポイントがそれぞれ 1 つずつあります。
  • 小規模の Web 開発では、すべての PHP ファイルがエントリ ポイントになる可能性があります。

インストール

This entry point is to perform an installation of PFMS Web console and the database. Once the installation is finished PFMS Web console requests the deletion of the file for security.

この実行開始ポイントは、Pandora コンソールおよびデータベースのインストール処理のためのものです。インストールが終了したら、Pandora コンソールはセキュリティのためにこのファイルを削除するように求めます。

install.php

通常実行

All user interaction on the console is done through this entry point.

ブラウザからユーザが利用するコンソールでは、すべての操作がこの実行開始ポイントです。

index.php

AJAX リクエスト

In all AJAX requests the user permissions are checked: To make them consistent and easy to maintain they are done through this file by passing by GET or POST method the parameter page the relative address of the script to execute.

セキュリティの必要性(ユーザの権限チェック)および、構造およびメンテナンスを簡単にするために、すべての AJAX リクエストはこのファイルにアクセスします。実行処理では、このファイルに GETPOST で実際に実行するスクリプトの相対ディレクトリを page パラメータで渡します。

ajax.php

モバイルコンソール

For mobile terminals that have a significantly smaller screen than a computer monitor, Pandora FMS has a reduced version of the console for these devices, reduced both in visual aspect and simplified in its functionality.

コンピュータのモニタよりもはるかに小さい画面のモバイル端末の場合、Pandora FMS はこれらのデバイス用にコンソールの縮小バージョンを提供し、視覚的にも機能的にも簡素化されています。

mobile/index.php

API

Pandora FMS has an API with which third party applications can interact through a simple channel through port 80 and with the HTTP/HTTPS protocol.

Pandora FMS には API があり、サードパーティのアプリケーションはポート 80 経由のシンプルなチャネルと HTTP/HTTPS プロトコルを使用して対話できます。

The strengthening of this script is by means of two parameters, validating both:

このスクリプトの強化は、次の 2 つのパラメータによって行われ、両方が検証されます。

  • The IP address of the running client is in the list of configured valid IP addresses of PFMS Web console or matches the regular expression also stored in the same place.
  • The token API configured by PFMS Web console has been passed as a parameter.
  • 実行中のクライアントの IP アドレスは、PFMS Web コンソールの設定された有効な IP アドレスのリストに含まれているか、同じ場所に保存されている正規表現と一致する。
  • PFMS Web コンソールによって構成された token API がパラメーターとして渡されます。
include/api.php

特別ケース

Within PFMS Web console there are several special cases for entry points, usually to avoid login or general processing being done at the main entry point (index.php of the root).

PFMS Web コンソール内には、エントリポイントに関する特別なケースがいくつかあります。これは通常、メインエントリポイント (ルートの index.php) でログインや一般的な処理が実行されないようにするためです。

Cron タスクの実行

This extension by means of a wget command in the cron can execute the cron tasks assigned to it without asking for login interactively. Of course the set of tasks is bounded and known preventing the execution of malicious code without login.

これは、cron から wget コマンドを呼び出すことにより実行されます。また、ログインすることなくタスクを実行することができます。もちろん、マルウェアでの実行を避けるために、タスクのグループで制限されています。

enterprise/extensions/cron/cron.php
ビジュアルコンソールの外部表示

This generates a page with a full screen visual console view without requiring a login, although for authentication a hash generated for each view published in this way is required.

このスクリプトは、ビジュアルコンソールをログインせずに(メニューなしで)全画面表示するものです。ただしハッシュ認証が必要です。ハッシュはそれぞれのビジュアルコンソールで生成します。

operation/visual_console/public_console.php
ネットワークマップコンソールのポップアップ

A popup form that shows the detail view of an agent that has an item in the Networkmap Console. To authenticate it uses the session of the authenticated user in the PFMS Web console.

ネットワークマップのアイテムからエージェント詳細をポップアップウインドウで表示します。これは Pandora コンソールにログインしているユーザのセッション情報を認証に使います。

enterprise/operation/agentes/networkmap_enterprise.popup.php
モジュールグラフのポップアップ

A pop-up form that displays a detailed graph of a module and also allows configuring various display parameters. For authentication it uses the data of the user logged into the PFMS Web console.

モジュールグラフをポップアップウインドウ表示するものです。そのウインドウの中で表示するグラフを変更するパラメータ設定もできます。これは、Pandora コンソールにログインしているユーザのセッション情報を認証に使います。

operation/agentes/stat_win.php
静的グラフ

The static graphs are image files that are generated by PHP scripts, the data to be shown, if they are extensive, are saved serialized in a special file that the script processes, this file has a life time to avoid malicious accesses and DoS attacks. For the execution of this script it is not necessary to be authenticated in Pandora FMS.

データを表示する画像ファイルを生成する PHP スクリプトです。大量のデータがある場合、データはスクリプトにより特定のファイルの保存されます。ファイルは、不正アクセスや DOS アタックを防ぐために、有効期限があります。このスクリプトの実行には、Pandora FMS の認証は不要です。

include/graphs/fgraph.php
レポート

CSV レポート

The script generates a text file containing the CSV data, for authentication it uses the data of the logged in user.

CSV フォーマットでデータが書かれたテキストファイルを生成するスクリプトです。このスクリプトはログインユーザの認証を利用します。

enterprise/operation/reporting/reporting_viewer_csv.php

PDF レポート

The script generates a text file containing the PDF data, for authentication it uses the data of the logged in user.

このスクリプトは PDF ファイルを生成します。このスクリプトはログインユーザの認証を利用します。

enterprise/operation/reporting/reporting_viewer_pdf.php
イベント

サウンドイベントポップアップ

Popup window that is periodically checking if there is any event to show it in an audible and visual way. The authentication is by means of the user's data that has logged into PFMS Web console.

このポップアップウインドウは、サウンドイベントを表示するために新たなイベント定期的に確認します。このスクリプトはログインユーザの認証を使います。

operation/events/sound_events.php

CSV イベント

The script generates a text file containing the CSV data, for authentication it uses the data of the logged in user.

このスクリプトは CSV フォーマットでデータが書かれたテキストファイルを生成します。このスクリプトはログインユーザの認証を使います。

operation/events/export_csv.php

RSS イベント

The script generates a text file containing the CSV data, for authentication it uses the data of the logged in user with a hash as a parameter.

このスクリプトは RSS フォーマットでイベントをテキストファイルに書き出します。このスクリプトはハッシュ認証を使います。

operation/events/events_rss.php

状態は次の通りです。

  • 障害(赤): 1つまたはそれ以上のモジュールが障害状態の場合
  • 警告(黄色): 1つまたはそれ以上のモジュールが警告状態で、障害状態のものが無い場合
  • 不明(グレー): 1つまたはそれ以上のモジュールが不明状態で、障害状態や警告状態のものが無い場合
  • 正常(緑): すべてのモジュールが正常状態の場合

DB 内部の状態を表すレコードは次の通りです。

  • 障害: 1
  • 警告: 2
  • 不明: 3
  • 正常: 0

状態関数

These functions return the number of modules and alerts triggered from an agent by applying an optional filter.

これらの関数は、エージェントの状態またはアラートの発生状況でフィルタリングしたモニター数を取得するものです。

All functions have the filter option which was added to make the function more flexible. The filter content is added to the end of the SQL query in all functions. With the filter you can add specific SQL clauses to create filters using the tables: status_tag, tag and module_tag.

すべての関数には、関数をより柔軟にするために追加された filter オプションがあります。フィルター コンテンツは、すべての関数の SQL クエリの末尾に追加されます。フィルターを使用すると、status_tagtag、および module_tag の各テーブルを使用してフィルターを作成するための特定の SQL 句を追加できます。


agents_monitor_critical($id_agent, $filter='')

Returns the number of modules in critical state for the agent.

エージェントの障害状態にあるモジュール数を返します。


agents_monitor_warning ($id_agent, $filter ='')

Returns the number of modules in warning status for the agent.

エージェントの警告状態にあるモジュール数を返します。


agents_monitor_unknown ($id_agent, $filter ='')

Returns the number of modules in unknown status for the agent.

エージェントの不明状態のモジュール数を返します。


agents_monitor_ok ($id_agent, $filter ='')

Returns the number of modules in normal state for the agent.

エージェントの正常状態にあるモジュール数を返します。


agents_get_alerts_fired ($id_agent, $filter ='')

Returns the number of alerts triggered for the agent.

エージェントの発報されたアラートの数を返します。

補助関数

これらの関数は、いくつかの場面でエージェントに関連した処理を実行します。

  • agents_tree_view_alert_img ($alert_fired): 発生したアラートの数に依存したツリービューのアラート画像のパスを返します。
  • agetns_tree_view_status_img ($critical, $warning, $unknown): ツリービューの状態画像のパスを返します。

これらの関数は、Pandora に定義されたエージェントグループにもとづいて、エージェントおよびモジュールの状態を返します。

サーバとコンソールの関数は、出力結果が同じになるように同じ sql クエリを利用しなければいけないことに注意してください。

サーバ関数

  • pandora_group_statistics: この関数は、リアルタイム更新が off のときに、グループの状態を計算します。

コンソール関数

コンソール関数は、エージェントグループの構造に基づいて状態を計算します。これらの関数は、無効化されたエージェントやモジュールは返しません。

  • groups_agent_unknown ($group_array): 指定したグループの不明状態のエージェント数を返します。
  • groups_agent_ok ($group_array): 指定したグループの正常状態のエージェント数を返します。
  • groups_agent_critical ($group_array): 指定したグループの障害状態のエージェント数を返します。
  • groups_agent_warning ($group_array): 指定したグループの警告状態のエージェント数を返します。

これらの関数はモジュールの状態を計算します。無効化されたモジュールやエージェントには使えません。

  • groups_monitor_not_init ($group_array): 指定したグループの未初期化状態のエージェント数を返します。
  • groups_monitor_ok ($group_array): 指定したグループの正常状態のモジュール数を返します。
  • groups_monitor_critical ($group_array): 指定したグループの障害状態のモジュール数を返します。
  • groups_monitor_warning ($group_array): 指定したグループの警告状態のモジュール数を返します。
  • groups_monitor_unknown ($group_array): 指定したグループの不明状態のモジュール数を返します。
  • groups_monitor_alerts ($group_array): 指定したグループのアラートがついているモジュール数を返します。
  • groups_monitor_fired_alerts ($group_array): 指定したグループのアラートが発生しているモジュール数を返します。

これらの関数は、モジュール名をもとにした情報を返します。無効化したエージェントやモジュールには使えません。

  • modules_agents_unknown ($module_name): 指定したモジュール名が不明状態のエージェント数を返します。
  • modules_agents_ok ($module_name): 指定したモジュール名が正常状態のエージェント数を返します。
  • modules_agents_critical ($module_name): 指定したモジュール名が障害状態のエージェント数を返します。
  • modules_agents_warning ($module_name): 指定したモジュール名が警告状態のエージェント数を返します。

これらの関すは、モジュールグループみ基づいた状態を返します。無効化したエージェントやモジュールには使えません。

  • modules_group_agent_unknown ($module_group): 指定したモジュールグループに所属しているモジュールが不明状態のエージェント数を返します。
  • modules_group_agent_ok ($module_group): 指定したモジュールグループに所属しているモジュールが正常状態のエージェント数を返します。
  • modules_group_agent_critical ($module_group): 指定したモジュールグループに所属しているモジュールが障害状態のエージェント数を返します。
  • modules_group_agent_warning ($module_group): 指定したモジュールグループに所属しているモジュールが警告状態のエージェント数を返します。

これらの関数は、指定したポリシーのそれぞれの状態にあるエージェント数を返します。無効化したエージェントやモジュールには使えません。

  • policies_agents_critical ($id_policy): 指定したポリシーに属する障害状態のエージェント数を返します。
  • policies_agents_ok ($id_policy): 指定したポリシーに属する正常状態のエージェント数を返します。
  • policies_agents_unknown ($id_policy): 指定したポリシーに属する不明状態のエージェント数を返します。
  • policies_agents_warning ($id_policy): 指定したポリシーに属する警告状態のエージェント数を返します。

これらの関数は、OS に基づいたエージェントの状態を返します。無効化したエージェントやモジュールには使えません。

  • os_agents_critical ($id_os): 指定した OS で障害状態のエージェント数を返します。
  • os_agents_ok($id_os): 指定した OS で正常状態のエージェント数を返します。
  • os_agents_warning ($id_os): 指定した OS で障害状態のエージェント数を返します。
  • os_agents_unknown ($id_os): 指定した OS で不明状態のエージェント数を返します。

ほとんどの拡張は、サーバプラグイン、Unix エージェントプラグイン、コンソール拡張といったそれぞれの章で説明しています。この章では、Pandora FMS との連携および、Windows エージェントのソースからのコンパイル方法について説明します。今後も、特定の章に属さない開発に関わる内容については、この章に記載していきます。

このプロジェクトは、プロジェクトを支えるボランティアの開発者によって成り立っています。新たな開発者、ドキュメント作成者や、その他協力したいと考えている方は、常に歓迎です。まず最初は、メーリングリストやフォーラムに参加いただくのが良いです。

不具合報告は、Pandora FMS の拡張の助けになります。なお、不具合報告を送信する前に、我々の不具合に関するデータベースを確認し、同様の報告がすでにあがっていないかを確認してください。不具合報告は、我々のプロジェクトページ http://sourceforge.net/projects/pandora/ から、Sourceforge のバグトラッキングシステムを使って送信することができます。

メーリングリストは、簡単に最新情報をメールで受け取るには良い手段です。ユーザ向けのお知らせを送信する public メーリングリスト (流量は少ないです) と、技術的な議論を行う develop メーリングリストを用意しています。また、SVN システムから自動的に通知される変更情報を受け取るためのメーリングリスト (ほぼ毎日) があります。

我々のリポジトリから最新のソースを入手するには、Subversion クライアントが必要です。そして、次のように実行します。

svn co https://svn.sourceforge.net/svnroot/pandora pandora

ソースからビルドするには、MinGW tools を含む最新の Dev-Cpp IDE 版が必要です。こちらからダウンロードできます。

PandoraAgent.dev を Dev-Cpp で開き、プロジェクトを作成します。デフォルトのインストールですべてコンパイル可能です。

ソースからのビルドで問題を見つけた場合は、メール (ramon.novoa@artica.es) もしくは SourceForge 上のプロジェクトページ にてお知らせください。

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/

エージェントに必要な追加ライブラリのインストール

例えば、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 のあるクロスコンパイル環境にコピーします。

 cp lib/*.a /usr/i586-mingw32msvc/lib/
 cp -r include/* /usr/i586-mingw32msvc/include/

依存関係やライブラリの問題は、ご自身で解決する必要があります。 これらを簡単にできるように、Pandora FMS の公式ダウンロードサイトに必要なライブラリとインクルードファイルを tar で固めたファイルを mingw_pandorawin32_libraries_9Oct2009.tar.gz という名前で置いてあります。

コンパイルおよびリンク

コンパイラおよび、インクルードファイル、ライブラリのインストール後、Pandora FMS エージェントのソースディレクトリへ行き、以下を実行します。

./configure --host=i586-mingw32msvc && make

これで、実行可能な .exe ファイルが生成されます。

Pandora FMS には、他のアプリケーションとの連携をとり、Pandora FMS から情報を取得したり Pandora FMS に情報を提供するための外部 API があります。これに関するドキュメントは、補足資料の Pandora FMS 外部 API にあります。

Pandora FMS の XML データファイルのフォーマットを理解することで、エージェントプラグインの拡張や、独自エージェントの作成、Pandora FMS データサーバへの独自 XML ファイルの送信などができるようになります。

すべての XML ドキュメントど同じように、データファイルは次のような XML の宣言で始まります。

 <?xml version='1.0' encoding='UTF-8'?>

次に、エージェントが送るデータを定義する agent_data 要素が来ます。次に示す属性に対応しています。

  • description: Agent description.
  • group: Name of the group the agent belongs to (it must exist in Pandora FMS database).
  • os_name: Name of the operating system the agent runs in (it must exist in Pandora FMS database).
  • os_version: Free string describing the version of the operating system.
  • interval: Agent interval (in seconds).
  • version: Agent version string.
  • timestamp: Timestamp indicating when the XML file was generated (YYYY/MM/DD HH:MM:SS).
  • agent_name: Name of the agent.
  • timezone_offset: Offset that will be added to the timestamp (in hours). Useful if you are working with UTC.
  • address: Agent IP address (or FQN).
  • parent_agent_name: Name of the agent's parent.
  • agent_alias: Agent's alias.
  • agent_mode: Agent's working mode (0: Normal mode, 1: Learning mode, 2: Autodisable mode) .
  • secondary_groups: Secondary groups added to the agent.
  • custom_id: Custom agent ID.
  • url_address: Agent access URL.
  • description: エージェントの説明
  • group: エージェントが属するグループ名 (Pandora FMS のデータベースに存在する必要があります)
  • os_name: エージェントで動作している OS 名 (Pandora FMS のデータベースに存在する必要があります)
  • os_version: OS のバージョンを示す任意の文字列
  • interval: エージェントの実行間隔 (秒で)
  • version: エージェントのバージョン文字列
  • timestamp: XML ファイルが生成された日時 (YYYY/MM/DD HH:MM:SS)
  • agent_name: エージェントの名前
  • timezone_offset: 日時に追加する時間の差分(時間単位)。UTC にて動作している場合に便利です。
  • address: エージェントの IP アドレス(または FQDN)
  • parent_agent_name: エージェントの親の名前
  • agent_alias: エージェントの別名
  • agent_mode: エージェントの動作モード(0: 通常モード, 1: 学習モード, 2: 自動無効化モード)
  • secondary_groups: エージェントに追加するセカンダリグループ
  • custom_id: カスタムエージェント ID
  • url_address: エージェントアクセス URL

XML ヘッダの例を見てみましょう。

 <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'>

そして、モジュールごとに、module という要素が必要です。モジュールの定義のために、次の要素を入れることができます。

  • name: Module name.
  • description: Module description.
  • tags: Tags associated to the module.
  • type: Module type (it must exist in Pandora FMS database).
  • data: Module data.
  • max: Module's maximum value.
  • min: Module's minimum value.
  • post_process: Post-process value.
  • module_interval: Module interval (interval in seconds/agent interval).
  • min_critical: Minimum value for critical status.
  • max_critical: Maximum value for critical status.
  • min_warning: Minimum value for warning status.
  • max_warning: Maximum value for warning status.
  • disabled: It disables (0) or enables (1) the module. Disabled modules are not processed.
  • min_ff_event: FF threshold.
  • status: Module status (NORMAL, WARNING or CRITICAL). Warning and critical thresholds are ignored if the status is set.
  • 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.
  • timestamp: Sets a timestamp on the data received from the module.
  • module_group: Group of modules to which the module will be added.
  • custom_id: Module custom ID.
  • str_warning: Warning threshold for string modules.
  • str_critical: Critical threshold for string modules.
  • critical_instructions: Module Critical instructions.
  • warning_instructions: Module Warning instructions.
  • unknown_instructions: Module Unknown instructions.
  • 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].
  • quiet: Activates the Quiet mode of the module [0/1].
  • module_ff_interval: Specifies a value of FF Interval of the module.
  • alert_template: It associates an alert template to 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_warning: FF threshold value on change of state to WARNING.
  • min_ff_event_critical: FF threshold value on change of state to CRITICAL.
  • ff_timeout: FlipFlop timeout value.
  • each_ff: Activate option “Change each status”.
  • 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].
  • name: モジュールの名前。
  • description: モジュールの説明。
  • tags: モジュールに関連付けられたタグ。
  • type: モジュールのタイプ。(Pandora FMS のデータベースに存在する必要があります)
  • data: モジュールのデータ。
  • max: モジュールの最大値。
  • min: モジュールの最小値。
  • post_process: データ保存倍率。
  • module_interval: モジュールの実行間隔。(秒間の実行間隔 / エージェントの実行間隔)
  • min_critical: 障害状態となる最小値。
  • max_critical: 障害状態となる最大値。
  • min_warning: 警告状態となる最小値。
  • max_warning: 警告状態となる最大値。
  • disabled: モジュールの無効化(0)、有効化(1)。無効化されているモジュールは処理されません。
  • min_ff_event: 連続抑制回数
  • status: モジュールの状態(正常、警告、障害)。status が設定されている場合は、警告および障害のしきい値は無視されます。
  • datalist: datalist フォーマットでモジュールデータを送信します。(受信した値ごとに 1つのデータベースエントリ) [0/1]
  • unit: モジュールの単位。timeticks 形式のデータを dd/hh/mm/ss に変換する _Timeticks_マクロをサポートします。
  • timestamp: モジュールから受信したデータにタイムスタンプを設定します。
  • module_group: モジュールが追加されるモジュールグループ。
  • custom_id: モジュールカスタム ID。
  • str_warning: 文字列モジュールの警告閾値。
  • str_critical: 文字列モジュールの障害閾値。
  • critical_instructions: モジュール障害時手順。
  • warning_instructions: モジュール警告時手順。
  • unknown_instructions: モジュール不明時手順。
  • critical_inverse: モジュールの障害閾値を反転。[0/1]
  • warning_inverse: モジュールの警告閾値を反転。[0/1]
  • quiet: モジュールの静観モードを有効化。[0/1]
  • module_ff_interval: モジュールの連続障害検知抑制回数の指定。
  • alert_template: モジュールに関連付けるアラートテンプレート。
  • crontab: モジュールの crontab 指定。
  • min_ff_event_normal: 状態が正常に変わる際の連続障害検知抑制回数。
  • min_ff_event_warning: 状態が警告に変わる際の連続障害検知抑制回数。
  • min_ff_event_critical: 状態が障害に変わる際の連続障害検知抑制回数。
  • ff_timeout: 連続障害検知抑制のタイムアウト値。
  • each_ff: 個々の状態ごとの連続障害検知抑制の有効化。
  • module_parent: 同一エージェントでこのモジュールの親となるモジュールの名前。
  • ff_type: 連続障害検知抑制のカウンタ維持の有効化。[0/1]

Pandora FMS バージョン 749 から、しきい値を強制するための新たなトークンが追加されました。

  • min_warning_forced: モジュールに設定が存在する場合でも、警告の最小値を新しい値にします。min_warningよりも優先されます。
  • 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 よりも優先されます。

これらのトークンは、データサーバプラグイン のみで動作します。

その他の要素は、モジュールの拡張情報として Pandora FMS のデータベースに保存されます。

モジュールは、少なくとも name, type, および data の要素を持たなければいけません。

例:

  <module>
    <name>CPU</name>
    <description>CPU usage percentage</description>
    <type>generic_data</type>
    <data>21</data>
  </module>

XML データファイルは任意の数のモジュール要素を持つことができます。最後に、agent_data タグをクローズするのを忘れないでください。

アイテムリストによる、複数の XML データを含む特別なケースがあります。これは、文字列タイプの場合にのみ有効です。XML は次のようになります。

<module>
<type>async_string</type>
<datalist>
   <data><value><![CDATA[xxxxx]]></value></data>
   <data><value><![CDATA[yyyyy]]></value></data>
   <data><value><![CDATA[zzzzz]]></value></data>
</datalist>
</module>

タイムスタンプは、それぞれの値ごとに定義できます。

  <module>
  <type>async_string</type>
  <datalist>
    <data>
      <value><![CDATA[xxxxx]]></value>
      <timestamp>1970-01-01 00:00:00</timestamp>
    </data>
    <data>
      <value><![CDATA[yyyyy]]></value>
      <timestamp>1970-01-01 00:00:01</timestamp>
    </data>
    <data>
      <value><![CDATA[zzzzz]]></value>
      <timestamp>1970-01-01 00:00:02</timestamp>
    </data>
  </datalist>
  </module>

さらに、使用量の単位と閾値の定義を含んだ例を見てみましょう。

<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>
	<name><![CDATA[Load Average]]></name>
	<description><![CDATA[Average process in CPU (Last minute) ]]></description>
        <tags>tag</tags>
	<type>generic_data</type>
	<module_interval>1</module_interval>
	<data><![CDATA[1.89]]></data>
</module>
  • ja/documentation/pandorafms/technical_reference/01_development_and_extension.1725171459.txt.gz
  • 最終更新: 2024/09/01 06:17
  • by junichi