====== エンドポイントを使った監視 ======
{{indexmenu_n>2}}
[[:ja:documentation:pandorafms:start|Pandora FMS ドキュメント一覧に戻る]]
===== 概要 =====
EndPoints [[:en:documentation:pandorafms:installation:01_installing#ks2|are installed]] and are running on the operating systems from which they collect information, performing a **check** for each **module**.
エンドポイントは、情報を収集するオペレーティングシステム上で[[:ja:documentation:pandorafms:installation:01_installing#ks2|インストール]]、実行され、**モジュール**ごとに**チェック**を実行します。
The EndPoint's own //directives// serve to collect certain data directly from the operating system (such as CPU usage, memory, events, etc.), executing **operating system-specific commands** following predefined scripts instructions.
エンドポイント独自の//ディレクティブ//は、オペレーティングシステムから特定のデータ (CPU 使用率、メモリ、イベントなど) を直接収集するために使用され、事前定義されたスクリプトの指示に従って **オペレーティングシステム独自のコマンド** を実行します。
The [[:en:documentation:pandorafms:introduction:02_architecture#data_server|Pandora FMS Dataserver]] processes and stores in the database all the information generated and sent in [[:en:documentation:pandorafms:introduction:03_glossary#ficheros_de_datosxml_de_datos|XML files]] by the EndPoints.
[[:ja:documentation:pandorafms:introduction:02_architecture#data_server|Pandora FMS データサーバ]] は、エンドポイントによって [[:ja:documentation:pandorafms:introduction:03_glossary#ficheros_de_datosxml_de_datos|XML ファイル]] で生成および送信されたすべての情報を処理し、データベースに保存します。
==== エンドポイント設定 ====
All configuration and parameters are stored in the ''pandora_agent.conf'' file, which is also installed locally along with its EndPoint. Basic configuration is covered in [[:en:documentation:pandorafms:installation:05_configuration_agents|"Pandora FMS EndPoint Configuration"]] and, for WUX monitoring, in the [[:en:documentation:pandorafms:monitoring:13_user_monitorization#ks3_5_1|manual execution as plugin]] section. Advanced configuration is described below.
すべての設定とパラメータは、エンドポイントと一緒にローカルにインストールされる pandora_agent.conf ファイルに保存されます。基本設定は [[:ja:documentation:pandorafms:installation:05_configuration_agents|"Pandora FMS エンドポイントの設定"]] で説明されており、WUX 監視の場合は [[:ja:documentation:pandorafms:monitoring:13_user_monitorization#ks3_5_1|プラグインとして手動実行]] です。高度な設定については以下で説明します。
=== ローカル設定 ===
In the EndPoint configuration file the modules are defined with the following basic text structure:
エンドポイントの設定ファイルでは、以下のテキストの基本構造でモジュールが定義されています。
module_begin
module_name
module_type generic_data
module_exec
module_description
module_end
* ''module_name'': The module name.
* ''module_exec'': Command to be executed.
* ''module_description'': Description of the task to monitor.
* ''module_name'': モジュールの名前。
* ''module_exec'': 実行されるコマンド。
* ''module_description'': 監視タスクの説明。
**例 1**
module_begin
module_name Files in var spool
module_type generic_data
module_exec ls /var/spool | wc -l
module_description Number of files incoming dir
module_end
In [[:en:documentation:01_understanding:03_glossary#nix_environments|*nix environment]], the command **ls** lists directory files and is executed with the line //module_exec// to deliver the value to the **wc** command, which will count the amount of words received for the same number of files. The value returned by this last execution will be the data that the module will obtain and will be displayed in the monitoring.
[[:ja:documentation:pandorafms:understanding:03_glossary#nix_環境|*nix 環境]] では、コマンド **ls** はディレクトリファイルを一覧表示します。行 //module_exec// でそれを実行し、行数をカウントする **wc** コマンドに値を渡します。 この実行によって返される値は、モジュールが取得するデータであり、監視データとして表示されます。
* For the MS Windows® EndPoint and the ''module_name'' instruction, if you want or need to use extended ASCII characters (''áéíóú'', among others), **an external plugin or script must be used**. Consult the [[#ks8|EndPoint plugin section]].
* For the MS Windows® EndPoint, ''module_exec_powershell'' is also available for the native execution of checks with PowerShell®.
* MS Windows® のエンドポイントで、''module_name'' に拡張 ASCII 文字 (''áéíóú'' など) を使用したい、または使用する必要がある場合は、**外部プラグインまたはスクリプトを使用する必要があります**。 [[#ソフトウエアエージェントでのプラグインの利用|ソフトウェアエージェントプラグインの章]] を参照してください。
* MS Windows® 上のエンドポイントの場合、PowerShell® によるネイティブチェックの実行に ''module_exec_powershell'' も使用できます。
**例 2**
module_exec vmstat 1 2 | tail -1 | awk '{ print $13 }'
**vmstat** コマンドは、仮想メモリの統計をレポートします。この例では、必要な情報を "絞り込む" ための 2つの追加コマンドがあります。 最初にコマンドを手動で起動し、出力を分析することをお勧めします。
$> vmstat 1 2 | tail -1 | awk '{ print $13 }'
結果が要件を満たしていたら、設定ファイルに追加します。ソフトウェアエージェントを介した実行によって返される値は、モジュールデータとして XML に格納されます。
**例3**
出力が Pandora FMS で受け入れられる値(数値、英数字、または、ブール値)をサポートしていれば、//module_exec// を介して任意のコマンドまたはソフトウェアを実行できます。そのため、カスタムスクリプトを指定することができます。
module_exec myScript.pl --h 127.0.0.1 -v cpu
この場合も、エージェントはシェルを実行し、オペレーターによって実行されたかのように結果を取得します。
$> myScript.pl --h 127.0.0.1 -v cpu
=== リモート設定 ===
To enable remote configuration, the [[:en:documentation:pandorafms:installation:05_configuration_agents#remote_config|parameter]]: ''remote_config 1'' must be enabled and the EndPoint must be restarted.
リモート設定を有効にするには、[[:ja:documentation:pandorafms:installation:05_configuration_agents#remote_config|パラメータ]]: ''remote_config 1'' を有効にし、エンドポイントを再起動する必要があります。
It is possible to remotely manage EndPoint files from the Pandora FMS Web Console. The configuration for each EndPoint is stored on the Pandora FMS server in two files: ''.conf'' and ''.md5'', where '''' is the hash of the EndPoint name. These files are stored respectively in:
Pandora FMS Web コンソールからエンドポイントのファイルをリモートで管理できます。各エージェントの設定は、Pandora FMS サーバの 2 つのファイル (''<_md5_>.conf'' と ''<_md5_>.md5'') に保存されます。ここで、''<_md5_>'' はエンドポイント名のハッシュです。これらのファイルはそれぞれ次の場所に保存されます。
/var/spool/pandora/data_in/conf
and
および
/var/spool/pandora/data_in/md5
Once the remote configuration of the EndPoint is enabled, any changes made locally to the configuration file will be overwritten by the configuration stored in the console. To return to local administration of the EndPoint, stop your service, reset ''remote_config'' to zero and start the service again.
エンドポイントのリモート設定を有効にすると、設定ファイルにローカルで加えられた変更は、コンソールに保存されている設定によって上書きされます。エンドポイントのローカル管理に戻るには、サービスを停止し、''remote_config'' をゼロにリセットして、サービスを再度開始します。
=== カスタムフィールド ===
Custom fields allow you to add additional information to the EndPoint. Custom fields can be created with the PFMS 1.0 API and the command [[:en:documentation:pandorafms:technical_reference:02_annex_externalapi#set_create_custom_field|set create_custom_field]] or through the Web Console in the menu **Management → Resources → Custom fields → Create field**.
カスタムフィールドを使用すると、エンドポイントに追加情報を追加できます。 カスタムフィールドは、PFMS 1.0 API とコマンド [[:ja:documentation:pandorafms:technical_reference:02_annex_externalapi#set_create_custom_field|set create_custom_field]] を使用して作成するか、ウェブコンソールのメニュー **管理(Management) → リソース(Resources) → カスタムフィールド(Custom fields) → フィールドの作成(Create field)** を使用して作成できます。
* The **Enabled combo**, **Password type** and **Link type** options are mutually exclusive; that is, only one of them (or none, default value) can be used.
* When the **Display up front** field is activated, the custom field information will be shown, //if it has an established value//, in the EndPoint general view. **If no marked custom field has a value, the custom fields box will remain hidden**. Additionally, it will be necessary to activate this token to send the Custom Fields information to the **[[:en:documentation:pandorafms:command_center:05_visualization#ks1_3_2|Command Center]]**.
* **Enabled combo**: This parameter allows activating the configuration of parameters selectable from a dropdown. Once activated, a new field will appear in the corresponding **custom field** configuration window to enter the combo values separated by commas.
* **Password type**: The field value (password) will be shown through asterisks in the Web Console.
* **Link type**: Allows adding a custom field that will house a web link to be filled in via Web Console or in an [[:en:documentation:pandorafms:technical_reference:11_pfms_plugis#xml|XML received by an EndPoint]]. It is possible to include links in the custom fields of an XML in JSON format embedded with CDATA '''' instructions. If the JSON format of the link is:
* オプション **選択肢の有効化(Enabled combo)**、**パスワードタイプ(Password type)**、**リンクタイプ(Link type)** は相互に排他的です。つまり、いずれか 1 つだけを使用できます (または、デフォルト値のなし)。
* **前面に表示(Display up front)** フィールドを有効にすると、カスタムフィールドに値が設定されている場合、その情報はエンドポイントの概要に表示されます。**チェックされたカスタムフィールドに値が設定されていない場合、カスタムフィールドボックスは非表示のままになります**。さらに、このトークンを有効化して、カスタムフィールド情報を**[[:ja:documentation:pandorafms:command_center:05_visualization#ks1_3_2|コマンドセンター]]**に送信する必要があります。
* **選択肢の有効化(Enabled combo)**: このパラメーターを使用すると、ドロップダウンリストからのパラメータ選択を有効化できます。 有効化した場合、対応するカスタムフィールドの構成ウィンドウに新しいフィールドが表示され、カンマで区切で値を入力します。
* **パスワードタイプ(Password type)**: ウェブコンソールでは、フィールド (パスワード) の値がアスタリスクを使用して表示されます。
* **リンクタイプ(Link type)**: ウェブコンソールまたは [[:ja:documentation:pandorafms:technical_reference:11_pfms_plugis#xml|エンドポイントから受信した XML]] によって入力されるウェブリンクをホストするカスタムフィールドを追加できます。JSON 形式の CDATA 命令'''' が埋め込まれた XML にリンクを含めることができます。 たとえば、リンクの JSON 形式が次の場合、
["Web name","https://example.com"]
The XML would have this syntax:
XML は次のような書式になります。
![CDATA[web]]
![CDATA[["Web name","https://example.com"|]]]
Consult "[[:en:documentation:pandorafms:technical_reference:06_anexo_agent_plugins#ks3_5|XML Validation]]", the [[:en:documentation:pandorafms:cybersecurity:15_security_architecture#tentacle|Security Architecture for the Tentacle protocol]] (mechanism in charge of delivering data in XML format to the PFMS Data server), and the [[:en:documentation:pandorafms:cybersecurity:15_security_architecture#ks3_1_1|Security Architecture for the PFMS Data server]] (limiting EndPoint auto-creation and establishing a password for the EndPoint group to which each EndPoint belongs).
[[:ja:documentation:pandorafms:technical_reference:06_anexo_agent_plugins#xmlの確認|XML の確認]]、[[:ja:documentation:pandorafms:cybersecurity:15_security_architecture#tentacle|Tentacle プロトコルのセキュリティアーキテクチャ]](XML フォーマットでの Pandora FMS データサーバへのデータ送信の仕組)、[[:ja:documentation:pandorafms:cybersecurity:15_security_architecture#サーバ|Pandora FMS データサーバのセキュリティアーキテクチャ]](エンドポイントの自動作成の制限、各エンドポイントが属するエンドポイントグループのパスワード設定) を参照してください。
The custom fields can also be passed from the EndPoint configuration file, using the tokens [[:en:documentation:pandorafms:installation:05_configuration_agents#custom_fieldx_name|custom_fieldx_name]] and [[:en:documentation:pandorafms:installation:05_configuration_agents#custom_fieldx_value|custom_fieldx_value]]:
カスタムフィールドは、[[:ja:documentation:pandorafms:installation:05_configuration_agents#custom_fieldx_name|custom_fieldx_name]] および [[:ja:documentation:pandorafms:installation:05_configuration_agents#custom_fieldx_value|custom_fieldx_value]] トークンを用いて、エンドポイント設定ファイルから渡すこともできます。
例:
custom_field1_name Serial Number
custom_field1_value 56446456KS7000
The custom field called ''Serial Number'' is created by default when installing PFMS and you may create as many custom fields as needed and of each different type (simple value, web link, password type and option list type). The order of the numerical identifier of each custom field is irrelevant, you just have to ensure that the name is exactly the same:
''シリアル番号(Serial Number)'' と呼ばれるカスタムフィールドは、Pandora FMS のインストール時にデフォルトで作成されます。カスタムフィールドは必要に応じて必要なだけ作成でき、それぞれのタイプ (単一値、ウェブリンク、パスワードタイプ、およびオプションリストタイプ) を作成できます。 各カスタムフィールドの数値識別子の順序は関係ありません。名前がまったく同じであることを確認する必要があるだけです。
custom_field11_name Simple custom field name
custom_field11_value Simple custom field value
custom_field12_name Custom field Link type
custom_field12_value ["Pandora FMS web site","https://pandorafms.com"]
custom_field13_name Custom field Password type
custom_field13_value My;Password;
custom_field14_name Custom field Combo type
custom_field14_value Two
In the custom fields ''Combo type'', the value sent by the EndPoint must correspond exactly to one of its items, otherwise the value will not be changed.
カスタムフィールド ''Combo type'' では、エンドポイントによって送信される値がその項目の 1 つに正確に一致する必要があります。そうでない場合、値は変更されません。
=== 共通設定パラメータ ===
Most important parameters for the basic configuration of [[:en:documentation:pandorafms:installation:05_configuration_agents#ks2|EndPoints]]:
基本的なエージェント設定における、最も重要なパラメータ (より詳細は、[[:ja:documentation:pandorafms:installation:05_configuration_agents#ks2|Pandora FMS エンドポイント]] を参照してください):
* ''server_ip'': IP address of the Pandora FMS server.
* ''server_path'': Path to the Pandora FMS server //incoming// folder, by default /var/spool/pandora/data_in
* ''temporal'': Folder, by default ''/tmp''.
* ''interval'': EndPoint execution interval, by default ''300'' seconds.
* ''logfile'': EndPoint log file, by default: /var/log/pandora/pandora_agent.log
* **server_ip**: Pandora FMS サーバの IP アドレスです。
* **server_path**: Pandora FMS サーバの 'incoming' フォルダのパスです。デフォルトは、/var/spool/pandora/data_in です。
* **temporal**: テンポラリフォルダです。デフォルトは、''/tmp'' です。
* **interval**: エンドポイントの実行間隔です。デフォルトは、''300'' です。
* **logfile**: エンドポイントのログファイルです。デフォルトは、/var/log/pandora/pandora_agent.log です。
=== パスワード保護グループ ===
Menu **Management → {{:wiki:pfms-menu-resources_icon.svg?nolink&21x21}} Resources → Manage agent groups**.
By default, when an EndPoint sends data for the first time to the Pandora FMS server, it is automatically added to the group defined in the EndPoint configuration file.
メニュー **管理(Management) → {{:wiki:pfms-menu-resources_icon.svg?nolink&21x21}} リソース(Resources) → エージェントグループ管理(Manage agent groups)**.
デフォルトでは、エンドポイントが初めて Pandora FMS サーバにデータを送信すると、エンドポイント設定ファイルで定義されたグループに自動的に追加されます。
It is possible to [[:en:documentation:pandorafms:management_and_operation:11_managing_and_administration#ks1_2_3|configure a password]] (no spaces or symbols) for a group; this way, an EndPoint will not be added to a group unless the correct password has been specified in the EndPoint configuration file.
グループに対してパスワード(スペースや記号は使用しない)を設定することが可能です。この設定により、エンドポイント設定ファイルで正しいパスワードが指定されていない限り、エンドポイントはグループに追加されません。
To add a new EndPoint to this group, edit its [[:en:documentation:pandorafms:installation:05_configuration_agents#group_password|configuration file]], add the following configuration option ''group_password'', and restart the EndPoint.
このグループに新しいエンドポイントを追加するには、その [[:ja:documentation:pandorafms:installation:05_configuration_agents#group_password|設定ファイル]] を編集し、次の設定オプション ''group_password'' を追加して、エンドポイントを再起動します。
==== エージェントおよびエンドポイントのモジュール ====
=== モジュールの種類 ===
According to the [[:en:documentation:pandorafms:installation:05_configuration_agents#module_type|returned data]]:
[[:ja:documentation:pandorafms:installation:05_configuration_agents#module_type|データのタイプ]]により:
* ''generic_data'': Numerical.
* ''generic_data_inc'': Incremental.
* ''generic_data_inc_abs'': Absolute incremental.
* ''generic_proc'': Boolean.
* ''generic_data_string'': Alphanumerical.
* ''async_data'': Asynchronous numerical.
* ''async_string'': Asynchronous alphanumerical.
* ''async_proc'': Asynchronous Boolean.
* **Image module**: They use a string-type module (''generic_data_string'' or ''async_string'') as a base. If the data contained in the module is a **base64** encoded image (header ''data:image''), it will be identified as an image and will enable a link to a window to retrieve the image in the views. Additionally, a history of the different images that make up the stored strings will be displayed in their respective history.
* ''generic_data'': 数値型。
* ''generic_data_inc'': 増分型。
* ''generic_data_inc_abs'': 絶対増分型。
* ''generic_proc'': ブール型。
* ''generic_data_string'': 英数字型。
* ''async_data'': 非同期数値型。
* ''async_string'': 非同期英数字型。
* ''async_proc'': 非同期ブール型。
* **画像モジュール**: 文字列型モジュール(''generic_data_string'' または ''async_string'')をベースとして使用します。モジュールに含まれるデータが **base64** エンコードされた画像(ヘッダー ''data:image'')である場合、画像として識別され、表示画面で画像を取得するためのウィンドウへのリンクが有効になります。さらに、保存された文字列を構成するさまざまな画像の履歴が、それぞれの履歴に表示されます。
=== ローカルモジュールの実行間隔 ===
Local (or EndPoint) modules all have their EndPoint's interval as a "base". However, they can take values that are multiples of that base if you modify the [[:en:documentation:pandorafms:installation:05_configuration_agents#module_interval|parameter]] ''module_interval'' with an integer multiplier greater than zero.
ローカル(またはエンドポイント)モジュールはすべて、エンドポイントの間隔を「基準」としています。ただし、[[:ja:documentation:pandorafms:installation:05_configuration_agents#module_interval|パラメータ]] ''module_interval'' をゼロより大きい整数に設定すると、基準にそれを乗じた実行間隔とすることができます。
module_interval 2
この場合、エンドポイントの実行間隔が 300 のとき、モジュールの実行間隔は 300×2 (600) になります。
=== モジュール作成インタフェース ===
**Management → Resources → Manage agents** menu, direct access to **Modules** of the respective agent, button **Create module → EndPoint module → Create**.
Remote configuration of the respective EndPoint must be enabled.
**管理(Management) → リソース(Resources) → エージェント管理(Manage agents)** メニューから、各エージェントの **モジュール** に直接アクセスできます。ボタンは **モジュール作成(Create module) → エンドポイントモジュール(EndPoint module) → 作成(Create)** です。
各エンドポイントのリモート設定を有効にする必要があります。
The creation of local modules in the Web Console is done through a form where, in addition to the common configuration for all modules (thresholds, type, group, etc.), a text box is available where the data to be set in the EndPoint configuration file is specified.
Webコンソールでローカルモジュールを作成するには、フォームを使用します。このフォームには、すべてのモジュールに共通する設定(しきい値、タイプ、グループなど)に加えて、エンドポイント設定ファイルに設定するデータを指定するテキストボックスが用意されています。
{{ :wiki:pfms-local_module_editor-802_version.png }}
* By clicking the **Load basic** button, the content of **Data configuration** will be cleared with a basic template that must be modified according to the monitoring need.
* Once modified, clicking **Check** will verify that the template **syntax** is still correct (however, the rest of the commands will **not** be checked).
* **基本設定の読み込み(Load basic)** ボタンをクリックすると、**データ設定(Data configuration)** の内容がクリアされ、監視ニーズに合わせて変更する必要のある基本テンプレートが表示されます。
* 変更後、**チェック(Check)** ボタンをクリックすると、テンプレートの構文が正しいかどうかが検証されます(ただし、その他のコマンドはチェックされません)。
==== 状態にもとづくモニタリング ====
=== 事後処理 ===
The EndPoint supports the execution of commands and scripts in post-condition mode. This means that **actions can be performed depending on the value obtained in the module execution**. The [[:en:documentation:pandorafms:installation:05_configuration_agents#module_condition|parameter]] ''module_condition'' is used for this purpose.
エンドポイントは、事後条件モードでのコマンドとスクリプトの実行をサポートしています。これは、**モジュール実行で得られた値に応じてアクションを実行できる**ことを意味します。この目的のために、[[:ja:documentation:pandorafms:installation:05_configuration_agents#module_condition|パラメータ]] ''module_condition'' を使用します。
**例 1**
値または値の範囲を示す //module_condition// パラメータを使用して、取得したデータが条件(CPU 使用率が 200%未満)を満たす場合に、実行する内容を設定します。
//module_condition// パラメータにて、モジュールの実行の事後処理を定義します。モジュールから返される値にもとづいて実行されるコマンドを定義します。設定ファイルの例を次に示します。
module_begin
module_name CPU_Usage_Condition
module_type generic_data
module_exec get_cpu_usage.pl
module_condition <20 add_processes.sh
module_end
**例 2**
同じモジュールに対して、範囲内や最小しきい値を指定した複数の条件を指定できます(数学的には、両方のオプションのいずれかが実行されるか、まったく実行されません)。
module_begin
module_name CPU_Usage_Condition
module_type generic_data
module_exec get_cpu_usage.pl
module_condition (90, 100) remove_processes.sh
module_condition <20 add_processes.sh
module_end
**例 3**
前の例に似ていますが、両方の条件を実行することも、1つまたはまったく実行しないこともできます(選択した値で試してください: 5、15、または 30 の場合)。
module_begin
module_name CPU_Usage_Condition
module_type generic_data
module_exec get_cpu_usage.pl
module_condition < 10 start_new_server.sh
module_condition < 20 add_processes.sh
module_end
=== 事前処理 ===
The [[:en:documentation:pandorafms:installation:05_configuration_agents#module_precondition|parameter]] ''module_precondition'' allows evaluating a condition **before** the module execution and deciding with the result whether the module should be executed or not.
[[:ja:documentation:pandorafms:installation:05_configuration_agents#module_precondition|パラメータ]] ''module_precondition'' を使用すると、モジュールの実行**前に**条件を評価し、その結果に基づいてモジュールを実行するかどうかを決定できます。
**例 1**
アクティブなプロセスが 10 を超える場合、CPU 使用率のパーセンテージを取得し、Pandora FMS サーバにレポートします。
module_begin
module_name CPU_Usage
module_type generic_data
module_precondition> 10 number_active_processes.sh
module_exec get_cpu_usage.pl
module_end
**例 2**
同じモジュールに対して複数の前提条件を定義でき、それらすべてが満たされている必要があります。
module_begin
module_name CPU_Usage
module_type generic_data
module_precondition> 10 number_active_processes.sh
module_precondition> 1 important_service_enabled.sh
module_exec get_cpu_usage.pl
module_end
この場合、アクティブなプロセスが 10 を超えており、そのうちの少なくとも 1つが重要なプロセスである場合にのみモジュールが実行されます。
==== 高頻度モニタリング ====
There are certain modules of special importance, such as critical processes or services in execution. To have more controlled monitoring of these cases, [[:en:documentation:pandorafms:installation:05_configuration_agents#intensive_interval|intensive monitoring]] exists.
重要な実行プロセスやサービスなど、特に重要なモジュールが存在する場合があります。 これらのケース向けに、より制御された監視を可能にする[[:ja:documentation:pandorafms:installation:05_configuration_agents#intensive_interval|集中監視]]が利用できます。
It consists of warning in a shorter interval that a serious problem has appeared without the need to reduce the EndPoint's general interval.
エンドポイントの通常の実行間隔を短くすることなく、問題が発生した場合にのみ短い間隔で監視をします。
EndPoint Configuration:
エンドポイントの設定:
* ''interval'': Mandatory, EndPoint sampling time in seconds, it is the general interval for all local modules.
* ''intensive_interval'': Time in which it will notify if there is a problem, it will always be executed in this period, and if it matches the condition, it will be notified in this time period (otherwise, data will be sent in the ''interval'').
* ''interval'': 必須。エンドポイントのサンプリング間隔(秒単位)。これはすべてのローカルモジュールに共通する間隔です。
* ''intensive_interval'': 問題が発生した場合に実行する間隔。この期間内に必ず実行され、条件に一致した場合、この期間内に通知されます(そうでない場合は、''interval''で指定された間隔でデータが送信されます)。
Module Configuration:
モジュール設定:
* ''module_intensive_condition = '': If the module obtains the value indicated in this parameter as a result, it will notify in the previously defined intensive interval.
* Other operators that can be used are: ''<'', ''>'', ''!='', a range of values ''(m,n)'' and ''=~''.
* **module_intensive_condition = <値>**: モジュールの値がこのパラメータで指定した値の場合、エージェントで定義された高頻度の間隔で監視します。
* 使用できる演算子は、''<''、''>''、''!=''、値の範囲 ''(m,n)'' 、および ''=~'' です。
=== 例 ===
The **[[:en:documentation:pandorafms:introduction:03_glossary#openssh|sshd]]** service is very important as it is used to connect via //shell// remotely and its operation needs to be monitored.
**[[:ja:documentation:pandorafms:introduction:03_glossary#openssh|sshd]]** サービスは、シェルでリモート接続するために使用されるため非常に重要です。その動作を監視する必要があります。 次の例は、sshd プロセスの監視を通常は 5分ごとに実施しますが、障害時は 10秒ごとに監視したい場合の例です。
EndPoint configuration file:
エンドポイント設定ファイル:
interval 300
intensive_interval 10
Module:
モジュール:
module_begin
module_name SSH Daemon
module_type generic_data
module exec ps aux | grep sshd | grep -v grep | wc -l
module_intensive_condition = 0
module_end
If the service is missing, it will be notified within the next 10 seconds; if it is functioning, it will notify every 5 minutes (normal interval, 300 seconds).
サービスがダウンすると、次の 10秒で再度チェックされます。サービスが起動していれば、次のチェックは通常通り 5分後です。
==== 指定時間モニタリング ====
The EndPoint supports the definition of scheduled modules that run at defined times. The syntax used is the same as that of the **crontab** file.
エンドポイントは、モジュールを指定時間に実行する設定ができます。書式は crontab と同じです。モジュールの設定例は次の通りです。以下は、モジュールを毎月曜の 12 から 15時の間に実行する例です。
module_begin
module_name crontab
module_type generic_data
module_exec script.sh
module_crontab * 12-15 * * 1
module_end
モジュールを毎時 10分に実行したい場合は、次のようにします。
module_begin
module_name crontab
module_type generic_data
module_exec script.sh
module_crontab 10 * * * *
module_end
モジュールがデータを出力しない期間を設定した場合、モジュールは "不明" 状態になります。このような場合は非同期モジュールを利用します。
===== エンドポイントでのリモートチェック =====
A EndPoint is capable of performing remote checks, substituting the main PFMS server and even distributing them to broker agents.
Pandora FMS サーバが(セキュリティ上の理由などから)直接アクセスできないシステムに対してリモートチェックを行う場合に使用します。エンドポイントをインストールし、そこからリモートチェックを実行し、ブローカエージェントで配布することができます。
==== ICMP チェック ====
ICMP or **[[:en:documentation:pandorafms:installation:05_configuration_agents#module_advanced_options|ping]]** checks are very useful to know if a machine is connected or not to a network.
ICMP または **[[:ja:documentation:pandorafms:installation:05_configuration_agents#module_advanced_options|ping]]** チェックは、マシンがネットワークに接続されているかどうかを知るのに非常に役立ちます。
**Unix**
module_exec ping -c 1 dir_IP> /dev/null 2>&1; if [ $? -eq 0 ]; then echo 1; else echo 0; fi
**MS Windows®**:
module_ping dir_IP
Note: ''[[:en:documentation:pandorafms:installation:05_configuration_agents#module_advanced_options|module_advanced_options]]'' allows advanced options for ''ping.exe''.
注意: ''[[ja:documentation:pandorafms:installation:05_configuration_agents#module_advanced_options|module_advanced_options]]'' で、''ping.exe'' の高度なオプションを指定できます。
==== TCP チェック ====
TCP checks are useful for verifying that a machine's ports remain open and allowing knowledge of whether an application connects to the network or not.
TCP チェックは、ホストのポートが開いているかを確認するのに便利です。アプリケーションがネットワーク上で応答するかどうかを確認することができます。
**Unix**
With the **nmap** command and its configuration parameters on the command line, it checks if port 80 is open at an IP address (response timeout of 5 seconds):
**nmap** コマンドとその設定パラメータをコマンドラインで指定すると、IP アドレスのポート 80 が開いているかどうかを確認します(応答タイムアウトは 5秒)。
module_begin
module_name PortOpen
module_type generic_proc
module_exec nmap 192.168.100.54 -p 80 | grep open > /dev/null 2>&1; echo $?; if [ $? == 0 ]; then echo 1; else echo 0; fi
module_timeout 5
module_end
**MS Windows®**:
Parameters must be specified in:
パラメータは以下で指定する必要があります。
* ''[[:en:documentation:pandorafms:installation:05_configuration_agents#module_tcpcheck|module_tcpcheck]]'': Device IP address.
* ''module_port'': Port number.
* ''module_timeout'': Wait time for the response, must be located between ''module_begin'' and ''module_end''.
* ''[[:ja:documentation:pandorafms:installation:05_configuration_agents#module_tcpcheck|module_tcpcheck]]'': デバイスの IP アドレス
* ''module_port'': ポート番号
* ''module_timeout'': タイムアウト値。''module_begin'' と ''module_end'' の間に配置する必要があります。
Given case:
例:
module_begin
module_name TcpCheck
module_type generic_proc
module_tcpcheck 192.168.100.54
module_port 80
module_timeout 5
module_end
==== SNMP チェック ====
SNMP checks are common in network device monitoring to check the status of interfaces, input/output bytes, etc.
SNMP チェックは、一般的にネットワークデバイスのインタフェースのステータス、送受信トラフィックなどをチェックするのに利用します。
**Unix**
module_exec snmpget dir_IP -v 1 -c public .1.3.6.1.2.1.2.2.1.1.148 | awk '{print $4}'
**MS Windows®**:
module_snmpget
module_snmpversion 1
module_snmp_community public
module_snmp_agent 192.168.100.54
module_snmp_oid .1.3.6.1.2.1.2.2.1.1.148
module_end
===== プロキシモード =====
To use the Pandora FMS EndPoint //proxy// mode in Linux/Unix®, the **//root// user cannot be used for its execution**, therefore a special installation of the Pandora FMS EndPoint is necessary. For this, consult the [[:en:documentation:pandorafms:technical_annexes:32_pfms_install_software_agent#ks6_2|EndPoint Personalized Installation]].
Linux/Unix® で、Pandora FMS エンドポイントのプロキシモードを利用するためには、**エンドポイントを root 以外のユーザで実行** する必要があります。そのため、Pandora FMS エンドポイントのカスタムインストールが必要です。カスタムインストールの詳細については、[[:ja:documentation:pandorafms:installation:01_installing#ks1_12|エンドポイントのカスタムインストール]]を参照してください。
This mode allows redirecting data files generated by other EndPoints to the Pandora FMS server. The EndPoint acting in Proxy Mode can also perform monitoring tasks.
このモードでは、他のエンドポイントによって生成されたデータファイルを Pandora FMS サーバにリダイレクトできます。プロキシモードで動作するエンドポイントは、監視タスクも実行できます。
{{ :wiki:pfms-proxy_agent_mode.png?800 }}
Parameter configuration:
設定パラメータ:
* ''server_ip'': Pandora FMS server IP address.
* ''proxy_mode'': Activated (1) or deactivated (0).
* ''proxy_max_connection'': Number of simultaneous //proxy// connections, by default ''10''.
* ''proxy_timeout'': Wait time for response for the //proxy//, by default ''1'' second.
* ''proxy_address'': IP address on which the //proxy// listens.
* ''proxy_port'': Port number on which the //proxy// listens.
* ''server_ip'': Pandora FMS サーバの IP アドレスです。
* ''proxy_mode'': 有効(1) または 無効(0)。
* ''proxy_max_connection'': プロキシへの最大接続数です。デフォルトは 10です。
* ''proxy_timeout'': プロキシのタイムアウトです。デフォルトは 1秒です。
* ''proxy_address'': プロキシのアドレスです。
* ''proxy_port'': プロキシのポート番号です。
===== ブローカーモード =====
The EndPoint Broker Mode allows a single EndPoint to perform checks and manage configuration as if it were several different EndPoints.
エンドポイントには、複数のエンドポイントがインストールされているかのように一つのエンドポイントを設定し、モニターするブローカーモードがあります。
{{ :wiki:pfms-broker_agent_mode.png?800 }}
When Broker Mode is activated in an EndPoint, a new configuration file is created. From that moment on, the original EndPoint and the new Broker will be managed separately with their independent configuration files, as if they were two totally separate EndPoints on the same machine.
ブローカーモードを有効にしたエンドポイントは、新たな設定ファイルを生成します。同一のマシンで複数のエンドポイントを動かすのと同じように、オリジナルのエンドポイントと新たなブローカーがそれぞれの設定ファイルで動作します。
To create a Broker, one or more lines with the parameter ''broker_agent '' are added (one line for each Broker).
ブローカーを作成するには、パラメータ ''broker_agent '' を含む行を1つ以上追加します(ブローカーごとに 1行)。
In the Pandora FMS Web Console, **Brokers are seen and managed as independent EndPoints**.
Pandora FMS Webコンソールでは、**ブローカーは独立したエンドポイントとして表示および管理されます。**
* Modules that store data in memory between executions (''module_logevent'' and ''module_regexp'' in MS Windows®) do not work when Broker EndPoints are configured.
* Instances of Broker mode cannot use [[:en:documentation:pandorafms:complex_environments_and_optimization:02_policy#ks5|collections]].
* 実行の際にメモリにデータを保存するモジュール (MS Windows® では ''module_logevent'' および ''module_regexp'') は、ブローカーエージェントが設定されている場合は動作しません。
* ブローカーモードのインスタンスは [[:ja:documentation:pandorafms:complex_environments_and_optimization:02_policy#ks5|コレクション]] を使用できません。
==== 利用例 ====
=== 異なるエージェントとしてのローカルデータベースのモニタリング ===
マシンの基本的な情報(CPU、メモリ、ディスク)および、インストールされているデータベースの情報を分けてモニタリングしたいとします。
このモニタリングを行うには次のような手段をとります。
* インストールしたエンドポイント: CPU、メモリ、ディスクをモニタします。
* データベース用のブローカー: データベース内の状態をモニタします。
これを行うには、エンドポイントを CPU、メモリ、ディスクをモニタするマシンにインストールします。エンドポイントの設定で次の行を追加します。
broker_agent DBApp
この設定を追加することにより、DBApp というブローカーエージェントを作成します。それにより、dbapp.conf という設定ファイルができます。この設定ファイルには、データベースの状態をチェックするモジュールを追加します。
module_begin
module_name Num Users
module_type generic_data
module_exec get_db_users.pl
module_end
module_begin
module_name Num slows queries
module_type generic_data
module_exec get_db_slows_queries.pl
module_end
これにより、Pandora ウェブコンソールに 2つのエージェントが現れます。一つはマシン名で CPU、メモリ、ディスクのモジュールがあり、もう一つは、DBApp という名前で Num Users および Num slow queries というモジュールがあります。
=== ブローカーを使ったリモートデバイスのモニタリング ===
この例では、Windows マシンにエンドポイントをインストールし、(CPU、メモリ、ディスクを)モニタリングしています。また、エンドポイントのインストールなしに 192.168.100.54 の IP を持ったルータをモニタリングしたいとします。この問題を解決するためにブローカーを利用できます。
次の設定で、ブローカーを作成します。
broker_agent routerFloor5
これにより、routerFloor5 という名のブローカーエージェントを作成します。エンドポイントが Windows マシンにインストールされているので、Windows のエンドポイントの機能で ping および snmp でルータをモニタできます。それには、routerFloor5.conf ファイルに次の設定を行います。
module_begin
module_name Ping
module_type generic_proc
module_ping 192.168.100.54
module_ping_count 2
module_ping_timeout 500
module_end
module_begin
module_name Eth 1 up
module_type generic_data
module_snmpget
module_snmpversion 1
module_snmp_community public
module_snmp_agent 192.168.100.54
module_snmp_oid .1.3.6.1.2.1.2.2.1.1.1
module_end
module_begin
module_name Eth 2 up
module_type generic_data
module_snmpget
module_snmpversion 1
module_snmp_community public
module_snmp_agent 192.168.100.54
module_snmp_oid .1.3.6.1.2.1.2.2.1.1.2
module_end
この例では、Pandora FMS のウェブコンソールには 2つのエージェントが表示されます。一つは CPU、メモリ、ディスクのモジュールを持った Windows マシン、もう一つは、Ping、Eth 1 up、Eth 2 up というモジュールを持った //routerFloor5// です。
=== 直接通信できないネットワークのリモートモニタリング ===
デバイスをリモートからモニタする必要があるが、Pandora FMS のリモートサーバがそれらに直接通信できない場合があります。
{{ :wiki:broker_example_no_access.png?790 }}
この例では、本社からある会社のサイトのデバイスをリモートからモニタする必要があるとします。Pandora FMS サーバは本社にあり、他の会社のサイトに VPN で接続しています。何らかの制限により Pandora のリモートサーバはリモートでアクセスできません。会社のサイトをモニタリングするには、ブローカーモードを使います。エンドポイントは、異なるデバイスとして Pandora サーバに XML を送信できます。
エンドポイントの設定ファイルでは、モニタするデバイスの数だけブローカーを追加します。設定例は次の通りです。
broker_agent device_1
broker_agent device_2
broker_agent device_3
broker_agent device_4
...
ブローカーが作成されると、それぞれのデバイスのモニタリングをそれぞれのブローカーの設定ファイルで設定できます。例えば、Windows マシンで、device_1 の設定は次の通りです。
module_begin
module_name Ping
module_type generic_proc
module_ping 192.168.100.54
module_ping_count 2
module_ping_timeout 500
module_end
module_begin
module_name CPU_Load
module_type generic_data
module_wmiquery SELECT LoadPercentage FROM Win32_Processor
module_wmicolumn LoadPercentage
module_end
module_begin
module_name Mem_Free
module_type generic_data
module_wmiquery SELECT LoadPercentage FROM Win32_Memory
module_wmicolumn FreeMemory
module_end
module_begin
module_name Disk_Free
module_type generic_data
module_wmiquery SELECT LoadPercentage FROM Win32_Disk
module_wmicolumn FreeSpace
module_end
この設定で、異なる会社のサイト間で通信に制限があったとしても、リモート設定機能を利用でき、また、モニタした情報を Pandora FMS サーバへ送信することができます。
=== ブローカーを使ったモニタリング負荷分散 ===
ブローカーモードは、複数のネットワークでモニタリングの負荷を分散するのにとても便利です。
{{ :wiki:broker_scalation_example.png?800 }}
この例では、A から Z の複数のネットワークがあり、それぞれ 1000のデバイスがあります。Pandora FMS のリモートサーバの許容量は、役 2000エージェントです。そのため、負荷分散のためにブローカーモードでエンドポイントを利用することにします。ブローカーモードを有効にしたエンドポイントは、リモートでネットワークから全てのデバイスをモニタし、データを XML で Pandora FMS の中央サーバへ送ります。
それぞれのネットワークに、ブローカーモードを有効にしたエンドポイントがあります。モニタするデバイスの分だけブローカーを作成します。エンドポイントの //Broker_Agent_Net_A// の設定は次のようになります。
broker_agent device_1
broker_agent device_2
broker_agent device_3
broker_agent device_4
...
さらに、それぞれのブローカーには、モニタするデバイスのモジュールを追加します。例えば、ブローカー //device_1// はルータで、次のような設定です。
module_begin
module_name Ping
module_type generic_proc
module_ping 192.168.100.54
module_ping_count 2
module_ping_timeout 500
module_end
module_begin
module_name Eth 1 up
module_type generic_data
module_snmpget
module_snmpversion 1
module_snmp_community public
module_snmp_agent 192.168.100.54
module_snmp_oid .1.3.6.1.2.1.2.2.1.1.1
module_end
module_begin
module_name Eth 2 up
module_type generic_data
module_snmpget
module_snmpversion 1
module_snmp_community public
module_snmp_agent 192.168.100.54
module_snmp_oid .1.3.6.1.2.1.2.2.1.1.2
module_end
他の例として、ブローカー //device_2// は次のようなモジュールで Windows マシンをモニタします。
module_begin
module_name Ping
module_type generic_proc
module_ping 192.168.100.54
module_ping_count 2
module_ping_timeout 500
module_end
module_begin
module_name CPU_Load
module_type generic_data
module_wmiquery SELECT LoadPercentage FROM Win32_Processor
module_wmicolumn LoadPercentage
module_end
module_begin
module_name Mem_Free
module_type generic_data
module_wmiquery SELECT LoadPercentage FROM Win32_Memory
module_wmicolumn FreeMemory
module_end
module_begin
module_name Disk_Free
module_type generic_data
module_wmiquery SELECT LoadPercentage FROM Win32_Disk
module_wmicolumn FreeSpace
module_end
ソフトウエアエージェントをブローカーモードを有効にして使うことで、数千のデバイスからのデータを簡単に負荷分散して収集することができます。
===== エンドポイントを使ったインベントリ =====
For more information, visit the [[:en:documentation:pandorafms:management_and_operation:04_inventory#ks2_3_1|Local Inventory with EndPoints]] section.
詳細については、[[:ja:documentation:pandorafms:management_and_operation:04_inventory#ks2_3_1|エンドポイントを使用したローカルインベントリ]] の章をご覧ください。
===== エンドポイントを使ったログ収集 =====
For more information, visit the [[:en:documentation:pandorafms:monitoring:09_log_monitoring#ks3_2|Log Collection and Monitoring]] topic.
詳細に関しては、[[:ja:documentation:pandorafms:monitoring:09_log_monitoring#ks3_2|ログ収集と監視]] を参照してください。
===== UDP でのリモートアクション =====
An EndPoint is capable of receiving remote requests and executing orders.
エンドポイントは、リモートリクエストを受信して処理を実行することができます。
Always keep in mind that UDP is inherently insecure (and efficient for sending messages without compromising a certain response).
UDP は本質的に安全ではないことに注意してください(ただし、応答を損なうことなくメッセージを送信するには効率的です)。
To allow the PFMS server to send orders to the EndPoints under its charge, the following must be configured:
Pandora FMS サーバが担当するエンドポイントに要求を送信できるようにするには、以下を設定します。
* ''udp_server'': Zero ''0'' by default, set to one ''1'' to activate this functionality.
* ''udp_server_port'': Listening port number on EndPoint.
* ''udp_server_auth_address'': IP address of the Pandora FMS Server.
* ''udp_server'': この機能を有効化(1)または無効化(0)します。
* ''udp_server_port'': エンドポイントの UDP サーバのリスニングポートです。
* ''udp_server_auth_address'': UDP サーバがリクエストを受け付ける IP アドレスです。0.0.0.0 に設定すると、すべての発信元からのリクエストを受け付けます。
The EndPoint must be restarted for the changes to apply.
変更を適用するためにエンドポイントを再起動します。
* Although it can be set to ''0.0.0.0'' to accept from all sources, **this practice is not recommended**.
* If you have several PFMS Servers and/or use IPv6, you can place different IP addresses separated by commas.
* In the case that you have the IPv6 address ''2001:0db8:0000:130F:0000:0000:087C:140B'', whose abbreviation is ''2001:0db8:0:130F::87C:140B'', both addresses separated by commas should be used.
* すべての送信元からのアクセスを受け入れるように ''0.0.0.0'' に設定することもできますが、**この方法は推奨されません**。
* PFMS サーバが複数ある場合、または IPv6 を使用している場合は、異なる IP アドレスをカンマで区切って指定できます。
* IPv6アドレスが ''2001:0db8:0000:130F:0000:0000:087C:140B'' で、その略称が ''2001:0db8:0:130F::87C:140B'' の場合、カンマで区切って両方のアドレスを指定する必要があります。
==== エンドポイントへのサービス再起動要求の送信方法 ====
The script located in must be used:
以下のスクリプトを利用する必要があります。
/usr/share/pandora_server/util/udp_client.pl
It can be executed from the command line or used in an alert, using the command that comes [[:en:documentation:pandorafms:management_and_operation:01_alerts#ks2_3|pre-configured]] in the console **Remote agent control**.
コマンドラインやから実行したり、コンソールの [[:ja:documentation:pandorafms:management_and_operation:01_alerts#ks2_3|設定済のコマンド]] **"Remote agent control"** を使ったアラートで使うことができます。
{{ :wiki:pfms-endpoint_restart_action-802_version.png }}
==== カスタムリモートアクション ====
In addition to the action of restarting the EndPoint service, [[:en:documentation:pandorafms:installation:05_configuration_agents#ks5|custom actions]] of the following type can be specified:
エンドポイントサービスの再起動に加えて、[[:ja:documentation:pandorafms:installation:05_configuration_agents#ks5|カスタムアクション]] のような以下のタイプのアクションを指定できます。
process__start command
Orders can also be created that call scripts to perform multiple remote actions with just the press of a button.
また、ボタンを押すだけで複数のリモート操作を実行するスクリプトを呼び出すような処理を作成することもできます。
===== エンドポイントでのプラグインの利用 =====
Unlike server plugins, executed by Pandora FMS server, [[:en:documentation:pandorafms:installation:05_configuration_agents#module_plugin|EndPoint plugins]] report one **or several modules at the same time**.
Pandora FMS サーバによって実行されるサーバプラグインとは異なり、[[:ja:documentation:pandorafms:installation:05_configuration_agents#module_plugin|エンドポイントプラグイン]] は 1 つのモジュールまたは複数のモジュールを同時に報告します。
==== Windows システムでの実行 ====
In MS Windows®, all plugins registered by default are programmed in **VBScript**, to execute them the ''cscript.exe'' interpreter is used.
Windows では、デフォルトの全プラグインは、**VBScript** でプログラムされています。これらを実行するには、フルパスで適切なインタプリタを使用する必要があります。
以下に、Windows エンドポイントにデフォルトで含まれているプラグインのいくつかの使い方を示します。
module_plugin cscript.exe //B "%ProgramFiles%\pandora_agent\util\logevent_log4x.vbs" Aplication System 300
module_plugin cscript.exe //B "%ProgramFiles%\pandora_agent\util\df.vbs"
module_plugin cscript.exe //B "%ProgramFiles%\pandora_agent\util\ps.vbs" iexplore.exe myapp.exe
=== PowerShell チェックの利用 ===
From version 776 onwards, ''module_exec_powershell'' is available, which allows introducing more complex commands in PowerShell® with special characters and complex instructions (one instruction delivers results to the next) that are impossible through the ''module_exec'' module.
バージョン 776 以降には、''module_exec_powershell'' があり、''module_exec'' モジュールの使用ではサポートされていない特殊文字や複雑な命令 (1 つの命令が次の命令に結果を渡す) を含む、より複雑なコマンドを PowerShell に入力できるようになります。
# Example of Powershell execution module
module_begin
module_name Powershell
module_type generic_data_string
module_exec_powershell | | … |
module_end
Commands are entered as they are, without the need for quotation marks to be processed by the PFMS EndPoint (PowerShell commands, on the other hand, may need quotation marks).
コマンドはそのまま入力され、PFMS エンドポイントで処理するために引用符は必要ありません(一方、PowerShell コマンドには引用符が必要な場合があります)。
If the command is not valid, an error is added to the EndPoint log (''pandora_agent.log'' file).
コマンドが無効な場合、エンドポイントログ(''pandora_agent.log'' ファイル)にエラーが追記されます。
==== Unix システムでの実行 ====
Unix plugins are located by default in the EndPoint directory:
Unix プラグインは、デフォルトではエンドポイントディレクトリにあります。
/usr/share/pandora_agent/plugins
==== コンソールからのエンドポイントプラグインの管理 ====
By having its remote configuration activated, an EndPoint in its administration view will have the plugin editor tab available. Although all plugins present edit and delete actions, some of them are read-only ([[:en:documentation:pandorafms:management_and_operation:04_inventory|inventory]], [[:en:documentation:pandorafms:cybersecurity:20_hardening|security]]) so they will throw error messages if manipulated.
リモート設定を有効にすると、エンドポイントの管理画面でプラグインエディタタブが使用できるようになります。すべてのプラグインには編集および削除アクションがありますが、一部のプラグインは読み取り専用([[:ja:documentation:pandorafms:management_and_operation:04_inventory|インベントリ]]、[[:ja:documentation:pandorafms:cybersecurity:20_hardening|セキュリティ]])であるため、操作するとエラーメッセージが表示されます。
{{ :wiki:pfms-plugin_editor-802_version.png }}
==== コンソールからの高度なエンドポイントプラグイン管理 ====
It is possible to add a token in the EndPoint plugins configuration that when enabled allows the option to 'encapsulate' the plugin definitions inside the ''module_begin'' and ''module_end'' tags.
''module_begin'' タグと ''module_end'' タグ内にプラグイン定義を 'カプセル化' すると、エンドポイントのプラグイン設定にトークンを追加することができます。
This enabled token allows you to insert configuration blocks such as ''module_interval'' or ''module_crontab'', among others.
''module_interval'' や ''module_crontab'' などを、設定に入れることができるようになります。
==== 独自エンドポイントプラグインの作成方法 ====
plugins can be created in any programming language. You only need to take into account the [[:en:documentation:pandorafms:technical_reference:04_anexo_plugins_considerations|general rules]] and the [[:en:documentation:pandorafms:technical_reference:06_anexo_agent_plugins|specific rules]] for their development.
プラグインは、任意のプログラミング言語で作成することができます。[[:ja:documentation:pandorafms:technical_reference:04_anexo_plugins_considerations|一般的なルール]] と開発の[[:ja:documentation:pandorafms:technical_reference:06_anexo_agent_plugins|特別なルール]]に気を付けてください。
Make sure to end the output of the new plugin (if it is a script) with an ''errorlevel 0'' or the EndPoint will interpret that the plugin has had an error and could not execute the task.
カスタムプラグインの終了コードは 0 になるようにしてください。そうでないと、Pandora FMS エージェントはプラグインでエラーが発生したものと認識し、出力を無視します。
=== シェルスクリプト(Linux/Unix)によるプラグインの例 ===
#!/bin/bash
# Detect if local Mysql is without password
# First, do we have a running MySQL?
CHECK_MYSQL=`netstat -an | grep LISTEN | grep ":3306 "`
if [ ! -z "$CHECK_MYSQL" ]
then
CHECK_MYSQL_ROOT=`echo "select 1234" | mysql -u root 2> /dev/null | grep 1234`
if [ -z "$CHECK_MYSQL_ROOT" ]
then
echo ""
echo "generic_proc"
echo "mysql_without_pass"
echo "1"
echo "MySQL have a password"
echo ""
else
echo ""
echo "generic_proc"
echo "mysql_without_pass"
echo "0"
echo "MySQL do not have a password"
echo ""
fi
fi
exit 0
=== VBScript (Windows) によるプラグインの例 ===
' df.vbs
' Returns free space for avaible drives.
' --------------------------------------
Option Explicit
On Error Resume Next
' Variables
Dim objWMIService, objItem, colItems, argc, argv, i
' Parse command line parameters
argc = Wscript.Arguments.Count
Set argv = CreateObject("Scripting.Dictionary")
For i = 0 To argc - 1
argv.Add Wscript.Arguments(i), i
Next
' Get drive information
Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery ("Select * from Win32_LogicalDisk")
For Each objItem in colItems
If argc = 0 Or argv.Exists(objItem.Name) Then
If objItem.FreeSpace <> "" Then
Wscript.StdOut.WriteLine ""
Wscript.StdOut.WriteLine " "
Wscript.StdOut.WriteLine " "
Wscript.StdOut.WriteLine " "
Wscript.StdOut.WriteLine ""
Wscript.StdOut.flush
End If
End If
Next
==== エンドポイントでの nagios プラグインの利用 ====
Nagios has a large number of plugins that can be used with Pandora FMS. One way to do it is to use remote plugins with the [[:en:documentation:pandorafms:introduction:02_architecture#heavy_server|Heavy Server]], using [[:en:documentation:pandorafms:technical_reference:05_anexo_server_plugins_development#ks3|Nagios compatibility]].
Nagiosには、Pandora FMS で使用できるプラグインが多数あります。その方法の 1つは、[[:ja:documentation:pandorafms:introduction:02_architecture#heavy_server|ヘビーサーバ]]でリモートプラグインを使用し、[[:ja:documentation:pandorafms:technical_reference:05_anexo_server_plugins_development#ks3|Nagios 互換性]]を使用することです。
=== 例 ===
実行権限がついた pop3 プラグイン (/tmp/check_pop3_login) があったとします。これは、pop3 アクセスが正常かどうかチェックします。リモートホストに接続し、ユーザ名とパスワードを送信し、問題ないかを確認します。コマンドラインからは、次のように実行できます。
/tmp/check_pop3_login mail.artica.es sanler@artica.es mypass
次のような結果が返ってきます。
OK: successfully logged in.
異常の場合はつぎのようになります。
Critical: unable to log on
ラッパーの利用は簡単で、コマンドの前に、ラッパーとモジュール名を設定します。
/etc/pandora/plugins/nagios_plugin_wrapper sancho_test /tmp/check_pop3_login mail.artica.es sanler@artica.es mypass
これで、エンドポイントプラグイン用に完全な XML を生成します。
sancho_test
generic_proc
0
または、
sancho_test
generic_proc
1
pandora_agent.conf の全設定は次のようになります。
module_plugin nagios_plugin_wrapper POP3_artica.es /tmp/check_pop3_login mail.artica.es sanler@artica.es mypass
これは、モジュール内で次のように表示されます。(障害時)
{{ :wiki:sample_plugin_wrapper.png }}
===== KeepAlive によるモニタリング =====
A unique module in Pandora FMS is the type called ''keep_alive'', used to alert if an EndPoint has stopped sending information.
Pandora FMS のユニークなモジュールの一つに ''keep_alive'' と呼ばれるタイプがあり、エンドポイントが情報の送信を停止した場合にアラートを発するために使用されます。
The KeepAlive module can only be created from the Web Console, **even if remote configuration is not enabled**, and it leaves no trace in the ''pandora_agent.conf'' file.
KeepAlive モジュールは、**リモート設定が有効になっていない場合でも** コンソールから作成することができます。また、''pandora_agent.conf'' ファイルの変更は発生しません。
You must go to the agent administration menu in **Management → Resources → Manage agents** and click on **Modules** of an agent.
エージェント管理メニューの**管理(Management) → リソース(Resources) → エージェント管理(Manage agents)**に移動し、エージェントの**モジュール(Modules)**をクリックする必要があります。
Once the module list of the selected agent is visible, you must press the **Create module** button and select **Endpoint module** in the **Select module type** list and press **Create**. The module must be created as follows:
選択したエージェントのモジュール一覧が表示されたら、**モジュール作成(Create module)** ボタンを押し、**モジュールタイプ選択(Select module type)** リストから **エンドポイントモジュール(Endpoint module)** を選択して、**作成(Create)** ボタンを押してください。モジュールは次のように作成する必要があります。
{{ :wiki:pfms-endpoint_keep_alive.png }}
===== コマンドスナップショット監視(コマンドスナップショット表示) =====
Commands that present extensive outputs, such as ''top'' or ''netstat -n'', can be completely captured by a module and reproduced as they are. The module must be configured as a text type in the remote configuration similarly to the following code:
''top'' や ''netstat -n'' などの複数行の出力を持つコマンドは、モジュールによって完全にキャプチャできます。 モジュールはテキストタイプとして設定する必要があります。
module_begin
module_name process_table
module_type generic_data_string
module_exec ps aux
module_description Command snapshot of running processes
module_group System
module_end
* For this to work this way, both the Pandora console (//setup//) and the EndPoint that collects that information must be properly configured, ensuring it is //raw text//.
* In the [[:en:documentation:pandorafms:management_and_operation:12_console_setup#ks1_1|Web Console configuration]], the **Command line snapshot** option must be activated.
* 動作させるには、Pandora FMS コンソール (セットアップ) とこの情報を収集するエンドポイントの両方を適切に設定し、情報が //未処理// テキストであることを確認する必要があります。
* [[:ja:documentation:pandorafms:management_and_operation:12_console_setup#ks1_1|Web コンソールの設定]] で、オプション **コマンドラインスナップショット(Command line shapshot)** を有効にする必要があります。
In the main agent editing view, module bottom section, the **Data** column will present an icon with the description **Command Snapshot view** where clicking will open a new window:
メインエージェント編集画面のモジュール下部セクションの **データ(Data)** 列には、**コマンドスナップショット表示(Command Snapshot view)** という説明付きのアイコンが表示され、クリックすると新しいウィンドウが開きます。
{{ :wiki:pfms-command_snapshot-802_version.png }}
===== 画像の監視と表示 =====
This method allows defining string-type modules (''generic_data_string'' or ''async_string'') that contain images in text format with base64 encoding, being able to show said image instead of a specific result.
この監視では、base64 エンコードを使用したテキスト形式の画像を含む文字列型 (''generic_data_string'' または ''async_string'') のモジュールを定義でき、特定の文字列の代わりにその画像を表示できます。
A script file is created such as:
次のようなスクリプトファイルを作成します。
#!/bin/bash
echo ""
echo "Actual leader"
echo "async_string"
echo ""
echo ""
Save that content to a file on the EndPoint (or distribute it by [[:en:documentation:pandorafms:complex_environments_and_optimization:02_policy#ks5|collections]]) and execute it as follows:
そのコンテンツをエンドポイント上のファイルに保存するか(または[[:ja:documentation:pandorafms:complex_environments_and_optimization:02_policy#ks5|コレクション]]で配布する)、次のように実行します。
module_plugin
===== Windows における特定の監視 =====
* If the process name contains blank spaces, **do not use** **''“ ”''**.
* The process name must be the same as shown in the MS Windows® Task Manager (''taskmngr''), including the ''.exe'' extension.
* It is important to **respect upper and lower case**.
* プロセスの名前に空白が含まれている場合は、 **''" "'' を使用しない** でください。
* プロセスの名前は、拡張子 ''.exe'' を含め、Windows のタスク管理 ( ''taskmngr'' ) に表示されているものと同じである必要があります。
* **大文字と小文字を尊重する** ことが重要です。
==== プロセスモニタリングと、プロセスウォッチドック ====
=== プロセスモニタリング ===
The ''[[:en:documentation:pandorafms:installation:05_configuration_agents#module_proc|module_proc]]'' parameter checks if a certain process name is operating on this machine. It should be configured similarly:
''[[:ja:documentation:pandorafms:installation:05_configuration_agents#module_proc|module_proc]]'' パラメータは、特定のプロセス名がこのマシン上で動作しているかどうかを確認します。以下のように設定する必要があります。
module_begin
module_name CMDProcess
module_type generic_proc
module_proc cmd.exe
module_description Process Command line
module_end
The ''[[#ks12_1_2|module_async yes]]'' parameter must be added:
''[[#ks12_1_2|module_async yes]]'' パラメータを指定する必要があります。
module_begin
module_name CMDProcess
module_type generic_proc
module_proc cmd.exe
module_async yes
module_description Process Command line
module_end
=== プロセスウォッチドック ===
he Watchdog functionality for MS Windows® allows restarting an interrupted process.
MS Windows® のウォッチドッグ機能を使用すると、中断されたプロセスを再起動できます。
In the following code, it is configured so that the **Notepad** program runs //persistently// through the installed EndPoint:
以下のコードでは、**メモ帳**プログラムがインストールされたエンドポイントを介して//永続的に//実行されるように設定されています。
module_begin
module_name Notepad
module_type generic_data
module_proc notepad.exe
module_description Notepad
module_async yes
module_watchdog yes
module_user_session yes
module_start_command "%SystemRoot%\notepad.exe"
module_startdelay 3000
module_retrydelay 2000
module_retries 5
module_end
==== サービスモニタリングと、サービスウォッチドック ====
=== サービスモニタリング ===
The ''module_service'' parameter checks if a certain service is running on the machine. The definition of a module using this parameter would be:
''module_service'' パラメータは、指定したサービスがマシンで動作しているかどうかをチェックします。モジュールの設定例を以下に示します。
module_begin
module_name Service_Dhcp
module_type generic_proc
module_service Dhcp
module_description Service DHCP Client
module_end
The ''[[:en:documentation:pandorafms:installation:05_configuration_agents#module_proc|module_async yes]]'' parameter should be added to notify **immediately** when a process stops working:
プロセスが動作を停止したときに**即座に**通知するために、''[[:ja:documentation:pandorafms:installation:05_configuration_agents#module_proc|module_async yes]]'' パラメータを追加する必要があります。
module_begin
module_name Service_Dhcp
module_type generic_proc
module_service Dhcp
module_description Service DHCP Client
module_async yes
module_end
=== サービスウォッチドック ===
It works similarly to the [[#ks12_1_2|Process Watchdog]]:
これは、[[#ks12_1_2|プロセスウォッチドッグ]]と似たような働きをします。
module_begin
module_name ServiceSched
module_type generic_proc
module_service Schedule
module_description Service Task scheduler
module_async yes
module_watchdog yes
module_end
The Watchdog definition for services does not require any additional parameters like the one for processes //because that information is already within the service definition//.
サービスに対するウォッチドッグ定義では、プロセスに対するもののような追加のパラメータは必要ありません。//なぜなら、その情報は既にサービス定義内に含まれているからです//。
==== 基本リソースのモニタリング ====
When installing the PFMS EndPoint for MS Windows®, the basic necessary modules are included.
MS Windows® 用の PFMS エンドポイントをインストールする際に、必要な基本モジュールはすべて含まれています。
Some modules come active and others must be activated via **Remote Configuration** (or by locally editing the EndPoint's ''.conf'' file).
一部のモジュールは最初から有効になっていますが、その他のモジュールは**リモート設定**(またはエンドポイントの ''.conf'' ファイルをローカルで編集する)によって有効にする必要があります。
=== CPU のモニタリング ===
CPU をモニタするには、CPU 使用率を返す **module_cpuusage** パラメータを利用します。
次のような設定で、CPU の ID を元に CPU をモニタすることができます。
module_begin
module_name CPU_1
module_type generic_data
module_cpuusage 1
module_description CPU usage for CPU 1
module_end
また、次のように、すべての CPU の平均使用率をモニタすることもできます。
module_begin
module_name CPU Usage
module_type generic_data
module_cpuusage all
module_description CPU Usage for all system
module_end
=== メモリのモニタリング ===
メモリをモニタするには、システムの空きメモリ容量を返す **module_freememory** と、空き率をパーセンテージで返す **module_freepercentmemory** の 2つのパラメータを利用できます。
**module_freememory** を使ったモジュールの例を以下に示します。
module_begin
module_name FreeMemory
module_type generic_data
module_freememory
module_description Non-used memory on system
module_end
**module_freepercentmemory** を使ったモジュールの例を以下に示します。
module_begin
module_name FreePercentMemory
module_type generic_data
module_freepercentmemory
module_end
=== ディスクのモニタリング ===
ディスクスペースをモニタするには、空き容量を返す **module_freedisk** と、空き率をパーセンテージで返す **module_freepercentdisk** の 2つのパラメータを利用できます。両方のパラメータには、モニタするドライブ名の指定が必要で、**":" を忘れないように** してください。
**module_freedisk** を使ったモジュールの設定例を以下に示します。
module_begin
module_name FreeDisk
module_type generic_data
module_freedisk C:
module_end
**module_freepercentdisk** を使ったモジュールの設定例を以下に示します。
module_begin
module_name FreePercentDisk
module_type generic_data
module_freepercentdisk C:
module_end
=== WMI クエリ ===
Pandora FMS のエンドポイントは、システムに関連した情報や外部の情報を保持するのに使われる共通の技術である WMI クエリおよび ODBC 接続を使って情報を取得することができます。
**module_wmiquery** パラメータを使って、エンドポイントはローカルで WMI クエリを実行することができます。クエリを実行するには、実行するクエリを **module_wmiquery** パラメータで設定し、取得したい情報を持つカラムを **module_wmicolumn** で指定します。
例えば、次の設定ではインストールされているサービス一覧を取得できます。
module_begin
module_name Services
module_type generic_data_string
module_wmiquery Select Name from Win32_Service
module_wmicolumn Name
module_end
WMI を使って、CPU ロードも取得できます。
module_begin
module_name CPU_Load
module_type generic_data
module_wmiquery SELECT LoadPercentage FROM Win32_Processor
module_wmicolumn LoadPercentage
module_end
[[:ja:documentation:pandorafms:start|Pandora FMS ドキュメント一覧に戻る]]
===== (OBSOLETE) バージョン 7 NG 以前 =====
==== エージェントの名前 ====
Pandora FMS バージョン 7 以降では、エージェントには、別名と名前(またはユニークな識別子)があります。デフォルトでは、エージェントはランダムの 16進数から成る文字列の名前(または識別子)を生成します。また、マシンのホスト名から成る別名(または表示名)を生成します。
以前のバージョンでは、マシンの "名前" しかありませんでしたが、以前のシステムは Pandora FMS の最新バージョンと完全に互換性があります。同じPandora FMS インストールで同じ識別子(または名前)両方のエージェントのデータが混在し、上書きされます。 そのため、バージョン7以降では、異なる名前のエージェントが同じ別名を持つ可能性があります。
以下の設定トークンにより、この動作を変更できます。
pandora_agent
pandora_alias
デフォルトでは、設定ファイルのいずれかを使用しないので、マシンのホスト名を別名として取得し、非常に大きなランダムな16進数を名前または識別子として取得します。エージェント名は表示されなくなり(エージェント詳細表示を除く)、変更することはできません。 エージェントの一意の識別子はエージェントの「名前」であるため、エージェントの別名はソフトウェアエージェントの設定を心配することなく、いつでも変更できます。