差分
このページの2つのバージョン間の差分を表示します。
ja:documentation:03_monitoring:09_log_monitoring [2023/03/29 06:46] – [表示と高度な検索] junichi | ja:documentation:03_monitoring:09_log_monitoring [Unknown date] (現在) – 削除 - 外部編集 (Unknown date) 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== ログの監視と収集 ====== | ||
- | |||
- | {{indexmenu_n> | ||
- | |||
- | [[ja: | ||
- | |||
- | ===== 概要 ===== | ||
- | |||
- | {{ : | ||
- | |||
- | {{: | ||
- | |||
- | {{: | ||
- | |||
- | - **モジュールベース**: | ||
- | - ログの中で正規表現にマッチする数を数えるモジュールの作成 | ||
- | - ログメッセージの行および内容を取得 | ||
- | - **複合表示ベース**: | ||
- | |||
- | <WRAP center round info 60%> | ||
- | |||
- | From version 7.0 NG 712, Pandora FMS incorporates [[https:// | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round info 60%> | ||
- | |||
- | バージョン 7.0NG 712 からは、Pandora FMS に、ログ情報を保存するための [[https:// | ||
- | |||
- | </ | ||
- | |||
- | ===== 動作の仕組み ===== | ||
- | 処理は単純です。 | ||
- | |||
- | {{ : | ||
- | |||
- | * The logs analyzed by the [[: | ||
- | * Pandora FMS data server receives the XML agent, which contains information about both monitoring and logs. | ||
- | * When the DataServer processes XML data, it identifies log information, | ||
- | * Pandora FMS stores the data in Elasticsearch indexes generating a daily index for each Pandora FMS instance. | ||
- | * Pandora FMS server has a maintenance task that deletes indexes in the interval defined by the system admin (90 days by default). | ||
- | |||
- | * [[: | ||
- | * Pandora FMS データサーバは、エージェントから XML を受け取ります。そこには、監視とログの両方の情報が含まれています。 | ||
- | * データサーバが XML データを処理する時に、ログ情報を識別し、報告されたエージェントに関する情報やログのソースをプライマリデータベースに保存し、ログの保存には情報を自動的に ElasticSearch に送信します。 | ||
- | * Pandora FMS はデータを Elasticsearch インデックスに保存し、各 Pandora FMS インスタンスの日次インデックスを生成します。 | ||
- | * Pandora FMS サーバには、システム管理者が定義した間隔(デフォルトでは90日)でインデックスを削除するメンテナンスタスクがあります。 | ||
- | |||
- | ===== サーバの必要条件 ===== | ||
- | |||
- | It is recommended to distribute Pandora, FMS Server and Elasticsearch in independent servers. | ||
- | |||
- | Pandora FMS サーバと Elasticsearch は別々のサーバに展開することをお勧めします。 | ||
- | |||
- | * Rocky Linux 8 or RHEL 8. | ||
- | * At least 4 GB of RAM, although 6 GB of RAM are recommended for each Elasticsearch instance. | ||
- | * Disable SWAP on the node(s) where Elasticsearch is located. | ||
- | * At least 2 CPU cores. | ||
- | * At least 20 GB of disk space for the system. | ||
- | * At least 50GB of disk space for Elasticsearch data (the amount can be different depending on the amount of data to be stored). Elasticsearch disk usage is very intensive, so the faster the read and write speed, **the better the performance of the environment**. | ||
- | * Connectivity from Pandora FMS server to Elasticsearch API (port 9200/TCP by default). | ||
- | |||
- | * Rocky Linux 8 または RHEL 8。 | ||
- | * 最低 4GB のメモリ、ただし ElasticSearch インスタンスでは、6GB のメモリを推奨します。 | ||
- | * Elastic が動作するサーバでの SWAP の無効化。 | ||
- | * 最低 2 CPUコア。 | ||
- | * 最低 20GB のシステムディスク空き領域。 | ||
- | * 最低 50GB の ElasticSearch データディスク空き領域(保存されるデータの量に応じて、異なる場合があります)。 Elasticsearch のディスク使用量は非常に多いため、読み取りと書き込みの速度が速いほど、**環境のパフォーマンスが向上します**。 | ||
- | * Pandora FMS サーバから、Elasticsearch API (デフォルトポートは 9200/TCP) への接続性。 | ||
- | |||
- | With a single node environment with these characteristics, | ||
- | |||
- | 上記の最低条件のシングルノード環境では、毎日最大 1 GB のデータを保存し、デフォルトで 8日間保存できます。 | ||
- | |||
- | In the case of requiring greater data resilience and fault tolerance, it will be necessary to configure an Elasticsearch cluster (minimum 3 nodes to guarantee data integrity). When moving to a cluster environment it is also possible to distribute the load among the nodes, doubling (in the case of 3 nodes) the processing capacity of the environment. **A load balancing system will be necessary** | ||
- | |||
- | より高いデータ復元力とフォールトトレランスが必要な場合は、Elasticsearch クラスターを構成する必要があります(データの整合性を保証するために最低 3つのノード)。 クラスタ環境に移行する場合、ノード間で負荷を分散し、環境の処理能力を 2倍(3ノードの場合)にすることもできます。 // | ||
- | |||
- | ===== Elasticsearch のインストールと設定 ===== | ||
- | |||
- | Elasticsearch official documentation: | ||
- | |||
- | Elasticsearch の公式ドキュメントは以下にあります。 | ||
- | |||
- | * [[https:// | ||
- | |||
- | ==== インストール ==== | ||
- | |||
- | For Rocky Linux 8 it is recommended to install using the RPM package, it is a single package that contains everything needed to install the Elasticsearch database. | ||
- | |||
- | Rocky Linux 8 の場合、RPM パッケージを使用してインストールすることをお勧めします。これは、Elasticsearch データベースのインストールに必要なものすべてを含んだ単一のパッケージです。 | ||
- | |||
- | For download go to [[https:// | ||
- | |||
- | ダウンロードには、[[https:// | ||
- | |||
- | Once you have downloaded the package, you must upload it to the server where you will install Eleasticsearch, | ||
- | |||
- | パッケージをダウンロードしたら、Eleasticsearch をインストールするサーバにアップロードし、そのディレクトリに移動して、必要な権限を持ったユーザで次のように実行します。 | ||
- | |||
- | < | ||
- | |||
- | dnf install ./ | ||
- | |||
- | </ | ||
- | |||
- | You will get an output similar to: | ||
- | |||
- | 次のような出力が表示されます。 | ||
- | |||
- | {{ : | ||
- | |||
- | To verify that the service was installed correctly you can run the command: | ||
- | |||
- | サービスが正しくインストールされたことを確認するには、次のコマンドを実行します。 | ||
- | |||
- | < | ||
- | systemctl status elasticsearch.service | ||
- | |||
- | </ | ||
- | |||
- | You will get an output similar to: | ||
- | |||
- | 次のような出力が表示されます。 | ||
- | |||
- | {{ : | ||
- | |||
- | Note that the Elasticsearch service is inactive. | ||
- | |||
- | Elasticsearch サービスが無効になっていることに注意してください。 | ||
- | |||
- | ==== ノードの設定 ==== | ||
- | |||
- | <WRAP center round important 60%>\\ | ||
- | You must first edit the configuration file\\ | ||
- | ''/ | ||
- | **and then start the Elasticsearch service.** \\ | ||
- | </ | ||
- | |||
- | <WRAP center round important 60%>\\ | ||
- | 最初に、設定ファイル ''/ | ||
- | </ | ||
- | |||
- | This file contains the configuration of all the parameters of the Elasticsearch service, see the official documentation for more information: | ||
- | |||
- | このファイルには、Elasticsearch サービスのすべてのパラメータ設定が含まれています。詳細については、公式ドキュメントを参照してください。 | ||
- | |||
- | * [[https:// | ||
- | |||
- | Next, the minimum configurations required to start the service and its use with Pandora FMS will be described. | ||
- | |||
- | 次に、サービスを開始するために必要最小限の設定と、Pandora FMS での使用について説明します。 | ||
- | |||
- | * Set the port number, data location and location of the event log file: | ||
- | |||
- | * ポート番号、データの場所、イベントログファイルの場所を設定します: | ||
- | < | ||
- | |||
- | # ---------------------------------- Network ----------------------------------- | ||
- | # Set a custom port for HTTP: | ||
- | | ||
- | # ----------------------------------- Paths ------------------------------------ | ||
- | # Path to directory where to store the data (separate multiple locations by a comma): | ||
- | | ||
- | # Path to log files: | ||
- | | ||
- | |||
- | </ | ||
- | |||
- | * Configure '' | ||
- | |||
- | * '' | ||
- | < | ||
- | xpack.security.enabled: | ||
- | xpack.security.enrollment.enabled: | ||
- | |||
- | </ | ||
- | |||
- | {{ : | ||
- | |||
- | * // | ||
- | |||
- | * この行を[[: | ||
- | < | ||
- | |||
- | #http.host: [_local_] | ||
- | # | ||
- | |||
- | </ | ||
- | |||
- | It will also be necessary // | ||
- | |||
- | また、以下の行の // | ||
- | |||
- | < | ||
- | cluster.name: | ||
- | node.name: ${HOSTNAME} | ||
- | network.host: | ||
- | |||
- | </ | ||
- | |||
- | **cluster.name** | ||
- | |||
- | This will be the name of the group or cluster. | ||
- | |||
- | これは、グループまたはクラスタの名前です。 | ||
- | |||
- | **node.name** | ||
- | |||
- | To name the node using the '' | ||
- | |||
- | システムの環境変数 '' | ||
- | |||
- | **network.host** | ||
- | |||
- | For '' | ||
- | |||
- | '' | ||
- | |||
- | In case of working with a cluster you need to complete the '' | ||
- | |||
- | クラスターを使用する場合は、'' | ||
- | |||
- | < | ||
- | |||
- | discover.seed_hosts : [" | ||
- | |||
- | </ | ||
- | |||
- | Or (format example): | ||
- | |||
- | または(フォーマット例): | ||
- | |||
- | < | ||
- | | ||
- | - 192.168.1.10: | ||
- | - 192.168.1.11 | ||
- | - seeds.mydomain.com | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round info 60%> \\ In the most recent versions of Elasticsearch the memory management of the Java® virtual machine is done automatically and it is recommended to let it be managed this way in production environments, | ||
- | |||
- | <WRAP center round info 60%> \\ Elasticsearch の最新バージョンでは、Java® 仮想マシンのメモリ管理は自動的に行われるため、本番環境ではこれを利用することをお勧めします。したがって、Elasticsearch の JVM の値を変更する**必要はありません**。</ | ||
- | |||
- | Once finished, it will be necessary to execute: | ||
- | |||
- | 完了したら、以下を実行します: | ||
- | |||
- | < | ||
- | systemctl start elasticsearch.service | ||
- | |||
- | </ | ||
- | |||
- | Wait a few moments while Elasticsearch starts, be patient. The command to query the status is: | ||
- | |||
- | Elasticsearch が起動するまでしばらくお待ちください。ステータスを照会するコマンドは次のとおりです。 | ||
- | |||
- | < | ||
- | systemctl status elasticsearch.service | ||
- | |||
- | </ | ||
- | |||
- | You will see something similar to this: | ||
- | |||
- | 次のような出力が見られます。 | ||
- | |||
- | {{ : | ||
- | |||
- | <WRAP center round tip 60%> If the service fails to start, check the logs located in ''/ | ||
- | |||
- | <WRAP center round tip 60%> サービスの開始に失敗した場合は、''/ | ||
- | |||
- | To test the installation of Elasticsearch run the following command in a terminal window: | ||
- | |||
- | Elasticsearch のインストールをテストするには、ターミナルウィンドウで次のコマンドを実行します。 | ||
- | |||
- | < | ||
- | curl -q http:// | ||
- | |||
- | </ | ||
- | |||
- | Replace '' | ||
- | |||
- | '' | ||
- | |||
- | You will receive a response similar to the following: | ||
- | |||
- | 次のような応答が得られます。 | ||
- | |||
- | < | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | } | ||
- | |||
- | </ | ||
- | |||
- | It is recommended to visit the Elasticsearch best practices link for production environments: | ||
- | |||
- | 本番環境に向けては、Elasticsearch のベストプラクティスを参照することをお勧めします。 | ||
- | |||
- | * [[https:// | ||
- | |||
- | === Elasticsearch クラスタ設定 === | ||
- | * The minimum size of an Elasticsearch cluster is 3 nodes and it must always grow in odd numbers in order to make use of the // | ||
- | * Ensure that you have connectivity between all 3 nodes and that ports 9200 and 9300 are accessible between each and every node. | ||
- | |||
- | * Elasticsearch クラスターの最小サイズは 3ノードであり、// | ||
- | * 3つのノードすべての間で通信が可能であり、各ノード間でポート 9200 および 9300 へアクセスできることを確認してください。 | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | Stop the Elasticsearch service on each and every node: | ||
- | |||
- | 全ノードの Elasticsearch サービスを停止します。 | ||
- | |||
- | < | ||
- | |||
- | systemctl stop elasticsearch.service | ||
- | |||
- | </ | ||
- | |||
- | Modify the following lines in the configuration file ''/ | ||
- | |||
- | 設定ファイル ''/ | ||
- | |||
- | < | ||
- | # | ||
- | # | ||
- | |||
- | </ | ||
- | |||
- | // | ||
- | |||
- | 該当行を // | ||
- | |||
- | < | ||
- | |||
- | discovery.seed_hosts: | ||
- | cluster.initial_master_nodes: | ||
- | |||
- | </ | ||
- | |||
- | Example with IP addresses: | ||
- | |||
- | IP アドレスでの例: | ||
- | |||
- | < | ||
- | discovery.seed_hosts: | ||
- | cluster.initial_master_nodes: | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round important 60%>Make sure that the line '' | ||
- | |||
- | <WRAP center round important 60%>'' | ||
- | |||
- | Before starting the service, because the nodes were started for the first time on their own (standalone), | ||
- | |||
- | ノードは初回に単独で(スタンドアロンで)開始されたため、サービスを開始する前にデータフォルダーの内容(デフォルトでは ''/ | ||
- | |||
- | < | ||
- | rm -rf / | ||
- | |||
- | </ | ||
- | |||
- | Now it is time to start the services on each and every node. Start and check that they are running with the commands: | ||
- | |||
- | 次に、すべてのノードでサービスを開始します。 次のコマンドで開始し、実行されていることを確認します。 | ||
- | |||
- | < | ||
- | systemctl start elasticsearch.service && systemctl status elasticsearch.service | ||
- | |||
- | </ | ||
- | |||
- | You should get an output similar to: | ||
- | |||
- | 次のような出力を得られます。 | ||
- | |||
- | {{ : | ||
- | |||
- | Once the services have been started, you must confirm that the 3 nodes are joined to the cluster correctly, so when executing the following command on any of the nodes, the same response should be given: | ||
- | |||
- | サービスが開始されたら、3つのノードがクラスターに正しく参加していることを確認する必要があります。任意のノードで次のコマンドを実行すると、同じ応答が返されます。 | ||
- | |||
- | < | ||
- | curl -XGET http:// | ||
- | |||
- | </ | ||
- | |||
- | {{ : | ||
- | |||
- | Check again the firewall configuration always taking into account that the nodes should communicate through ports '' | ||
- | |||
- | ノードがポート '' | ||
- | |||
- | ===== データモデルとテンプレート ===== | ||
- | |||
- | Before putting into production an environment, | ||
- | |||
- | 本番環境に導入する前に、用途に応じて、単一ノードまたはデータクラスターのいずれかの環境に応じて対応する設定をあらかじめ実施することをお勧めします。 **Pandora FMS** によって生成されるインデックスの場合、それを行う最も簡単な方法は、フィールドと保存するデータの設定を定義するためのテンプレートを定義することです。 | ||
- | |||
- | <WRAP center round important 60%> | ||
- | テンプレートは、インデックス作成時にのみ適用される設定です。テンプレートを変更しても、既存のインデックスには影響しません。 | ||
- | </ | ||
- | |||
- | **基本テンプレート** を作成するには、フィールドを定義するだけです。 | ||
- | |||
- | < | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | } | ||
- | } | ||
- | } | ||
- | </ | ||
- | |||
- | Through the Elasticsearch interface in Pandora FMS (**Admin tools** → **Elasticsearch Interface**) and using the native Elasticsearch command you can upload such template. | ||
- | |||
- | Pandora FMS の Elasticsearch インターフェース(**管理ツール(Admin tools)** → ** Elasticsearch インターフェース(Elasticsearch Interface)**)を介して、ネイティブの Elasticsearch コマンドを使用し、テンプレートをアップロードできます。 | ||
- | |||
- | We can perform these operations through the Elastic Search interface in Pandora FMS using the native Elastics Search commands. | ||
- | |||
- | これらの操作は、ネイティブの ElasticsSearch コマンドを使用してPandora FMS の ElasticSearch インターフェイスから実行できます。 | ||
- | |||
- | * **PUT _template/< | ||
- | |||
- | * **PUT _template/< | ||
- | {{ : | ||
- | |||
- | You will also be able to consult the templates through the same Pandora FMS interface: | ||
- | |||
- | 同じ Pandora FMS インターフェースを介してテンプレートを参照することもできます。 | ||
- | |||
- | * **GET _template/< | ||
- | |||
- | * **GET _template/< | ||
- | |||
- | {{ : | ||
- | |||
- | ==== マルチノードテンプレート ==== | ||
- | |||
- | To define a **multinode template** | ||
- | |||
- | **マルチノードテンプレート**を定義するには、考慮しなければならないことがいくつかあります。 | ||
- | |||
- | * When configuring the template (JSON format), **you need to configure as many searches as you have nodes**, however to correctly configure the replicas **you must subtract 1 from the number of nodes in the environment.** | ||
- | |||
- | * テンプレート(JSON)の設定を行うときは、**ノードと同じ数の検索を設定する** ことを考慮に入れる必要がありますが、正しく設定するには、環境に実際に存在する **レプリカの数から 1を引く** 必要があります。 | ||
- | |||
- | For example, in a Pandora FMS environment with Elasticsearch with 3 configured nodes, when you modify the '' | ||
- | |||
- | 例えば、3つのノードを設定した Elasticsearch を Pandora FMS 環境で使用する場合、'' | ||
- | |||
- | < | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round info 75%> \\ This is a very basic definition, in order to correctly define the sizing of the Elasticsearch environment it is advisable to take into account the factors described in this article:</ | ||
- | |||
- | <WRAP center round info 75%> \\ これは非常に基本的な定義です。Elasticsearch 環境のサイズを正しく定義するには、以下で説明されている要素を考慮に入れることをお勧めします。</ | ||
- | |||
- | * [[https:// | ||
- | |||
- | From the command line you can list the templates of the environment by executing: | ||
- | |||
- | コマンドラインから以下を実行して環境のテンプレートを一覧表示できます。 | ||
- | |||
- | < | ||
- | |||
- | curl -X GET " | ||
- | |||
- | </ | ||
- | |||
- | You can also view the details of a template, for example the one we have created for pandorafms by running it: | ||
- | |||
- | テンプレートの詳細を表示することもできます。たとえば、以下を実行すると pandorafms 用に作成したテンプレートを表示できます。 | ||
- | |||
- | < | ||
- | curl -X GET " | ||
- | |||
- | </ | ||
- | |||
- | which will return in JSON format the configuration you have defined. | ||
- | |||
- | 定義した設定を JSON 形式で返します。 | ||
- | |||
- | You can perform these operations through the Elasticsearch interface in Pandora FMS using the native Elasticsearch commands. | ||
- | |||
- | これらの操作は、ネイティブの Elasticsearch コマンドを使用して、Pandora FMS の Elasticsearch インターフェースから実行できます。 | ||
- | |||
- | * **PUT _template/< | ||
- | * **GET _template/>< | ||
- | |||
- | * **PUT _template/< | ||
- | * **GET _template/< | ||
- | |||
- | {{ : | ||
- | |||
- | ===== 推奨事項 ===== | ||
- | |||
- | **Elasticsearch のログローテーション** | ||
- | |||
- | **重要:** Elasticsearch のログが肥大化しないように、/ | ||
- | |||
- | < | ||
- | cat > / | ||
- | / | ||
- | weekly | ||
- | missingok | ||
- | size 300000 | ||
- | rotate 3 | ||
- | maxage 90 | ||
- | compress | ||
- | notifempty | ||
- | copytruncate | ||
- | } | ||
- | EOF | ||
- | </ | ||
- | |||
- | **インデックスの削除** | ||
- | |||
- | You may check at any time the [[https:// | ||
- | |||
- | ElasticSearch サーバに対して curl でアクセスすることにより、いつでも[[https:// | ||
- | |||
- | < | ||
- | |||
- | curl -q http:// | ||
- | |||
- | </ | ||
- | |||
- | ここで、'' | ||
- | |||
- | インデックスを削除するには、DELETE コマンドを実行します。 | ||
- | |||
- | < | ||
- | curl -q -XDELETE http:// | ||
- | |||
- | </ | ||
- | |||
- | ここで '' | ||
- | |||
- | ===== Pandora FMS Syslog サーバ ===== | ||
- | <WRAP center round tip 60%> | ||
- | {{wiki: | ||
- | </ | ||
- | |||
- | This component allows Pandora FMS to analyze the [[https:// | ||
- | |||
- | このコンポーネントにより、Pandora はマシンの [[https:// | ||
- | |||
- | SyslogServer の主な利点としては、ログの統合を補完することにあります。Linux および UNIX 環境の SYSLOG 出力をもとにして、SyslogServer では、1つの共通ポイント(Pandora FMS コンソールのログビューア)で、発信元ごとに個別のログを参照したり、検索したりすることができます。 | ||
- | |||
- | Syslog のインストールは、クライアントとサーバの両方に次のコマンドで行います。 | ||
- | |||
- | yum install rsyslog | ||
- | |||
- | 対象のコンピューターに Syslog をインストールしたら、設定ファイル ''/ | ||
- | |||
- | < | ||
- | (...) | ||
- | |||
- | # Provides UDP syslog reception | ||
- | | ||
- | | ||
- | |||
- | # Provides TCP syslog reception | ||
- | | ||
- | | ||
- | |||
- | (...) | ||
- | </ | ||
- | |||
- | 調整を行ったら、rsyslog サービスを再起動します。 | ||
- | |||
- | サービスが再起動したら、ポート 514 が開いているか確認します。 | ||
- | |||
- | netstat -ltnp | ||
- | |||
- | rsyslog 設定に関する詳細は、[[https:// | ||
- | |||
- | Syslog サーバにログを送信するようにクライアントを設定します。そのためには、''/ | ||
- | < | ||
- | .* @@remote-host: | ||
- | </ | ||
- | <WRAP center round tip 60%> | ||
- | ログ送信により、クライアント名を持つコンテナエージェントが生成されるため、エージェントの重複を回避するために、クライアントのホスト名と一致する " | ||
- | </ | ||
- | |||
- | この機能を有効化するには、'' | ||
- | |||
- | < | ||
- | # Enable (1) or disable (0) the Pandora FMS Syslog Server | ||
- | # | ||
- | | ||
- | |||
- | # Full path to syslog' | ||
- | | ||
- | |||
- | # Number of threads for the Syslog Server | ||
- | # | ||
- | | ||
- | |||
- | # Maximum number of lines queued by the Syslog Server' | ||
- | # | ||
- | | ||
- | </ | ||
- | |||
- | |||
- | **syslogserver** | ||
- | |||
- | ローカルの SYSLOG 分析エンジンの有効化(1)または無効化(0)を設定します。 | ||
- | |||
- | **syslog_file** | ||
- | |||
- | SYSLOG ファイルの場所です。 | ||
- | |||
- | **syslog_threads** | ||
- | |||
- | SyslogServer のデータ処理に使う最大スレッド数です。 | ||
- | |||
- | **syslog_max** | ||
- | |||
- | SyslogServer が処理する最大ウインドウサイズです。一度の実行で処理する最大の SYSLOG エントリー数です。 | ||
- | |||
- | It is the maximum processing window for SyslogServer, | ||
- | |||
- | これは SyslogServer の最大処理ウィンドウであり、一度に処理される SYSLOG エントリの最大数になります。 | ||
- | |||
- | <WRAP center round important 60%>You will need an ElasticSearch server enabled and configured; please review the preceding points for how to work with it.</ | ||
- | |||
- | <WRAP center round important 60%> | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | ===== Elasticsearch システムへのマイグレーション ===== | ||
- | |||
- | <WRAP center round info 60%> \\ Version 712 or earlier. You will then need to upgrade to the current version, see " | ||
- | </ | ||
- | |||
- | <WRAP center round info 60%> \\ バージョン 712 またはそれ以前。最新のバージョンにアップグレードする必要があります。詳細については、[[: | ||
- | </ | ||
- | |||
- | ログの新たなストレージシステムを設定後、以前から Pandora に保存されているデータを新たなシステムへマイグレートできます。 | ||
- | |||
- | 新たなシステムへマイグレートするには、/ | ||
- | |||
- | < | ||
- | # 7.0NG 712 より前のログデータを、7.0NG 712 以降にマイグレート | ||
- | / | ||
- | </ | ||
- | |||
- | ===== コンソールの設定 ===== | ||
- | |||
- | To enable the log system display, enable the following configuration | ||
- | |||
- | ログの表示を有効化するには、次の設定を有効化する必要があります。(**セットアップ(Setup)** → **セットアップ(Setup)** → **Enterprise**) | ||
- | |||
- | {{ : | ||
- | |||
- | Then set the log viewer performance in the **Setup** → **Setup** → **Log Collector**: | ||
- | |||
- | **セットアップ(Setup)** → **セットアップ(Setup)** → **ログ収集(Log Collector)** タブで、ログビューワの動作を設定できます。 | ||
- | |||
- | {{ : | ||
- | |||
- | この画面では以下の設定ができます。 | ||
- | |||
- | * Elasticsearch サーバの IP または FQDN アドレス | ||
- | |||
- | * Elasticsearch サービスのポート | ||
- | |||
- | * **表示されるログの数(Number of logs being shown)**: | ||
- | |||
- | * **削除する日数(Days to purge)**: システムのサイズを保持するために、ログ情報を保存する最大日数を定義できます。それを超えると、Pandora FMS のクリーニング処理により自動的に削除されます。 | ||
- | |||
- | ===== Elasticsearch インタフェース ===== | ||
- | <WRAP center round tip 60%> | ||
- | {{wiki: | ||
- | </ | ||
- | |||
- | {{ : | ||
- | |||
- | デフォルトの設定では、Pandora は 1日あたりのインデックスを生成します。これは、何かを検索する際のフラグメント化の役割を持ちます。検索時に Elastic がフラグメントの場所を認識できるようにします。 | ||
- | |||
- | この検索をデフォルトで最適化するには、Elastics が検索ごとにインデックスを生成し、**Elastics ノードと同じ数の検索を環境内で設定する必要があります**。 | ||
- | |||
- | これらの検索とレプリカは、Pandora が自動的に生成するインデックスの作成時に設定されるため、この設定を変更するには、テンプレートを使用する必要があります。 | ||
- | |||
- | ===== データバックアップとリストア ===== | ||
- | |||
- | A data snapshot (indexes) is the mechanism that recent versions of Elastichsearch use to back up data. These snapshots can be used to recover data after a hardware failure, to transfer data between nodes, and even to remove rarely used indexes from the node(s) (//the latter requires additional configuration// | ||
- | |||
- | データスナップショット(インデックス)は、Elastichsearch の最近のバージョンにおいてデータをバックアップするために使用するメカニズムです。 これらのスナップショットを使用して、ハードウェア障害後にデータを回復したり、ノード間でデータを転送したり、ノードからめったに使用されないインデックスを削除したりすることもできます(// | ||
- | |||
- | These snapshots work by backing up data incrementally, | ||
- | |||
- | これらのスナップショットは、データを段階的にバックアップすることで機能します。つまり、バックアップされていない新しいデータのみをコピーし、作成済みのバックアップの信頼性と Elasticsearch の異なるバージョン間の互換性を確保します。 | ||
- | |||
- | <WRAP center round info 60%>\\ | ||
- | For Elasticsearch the way to guarantee all these features is through **repositories**.\\ | ||
- | </ | ||
- | |||
- | <WRAP center round info 60%>\\ | ||
- | Elasticsearch で、これらすべての機能を保証する方法は**リポジトリ**を使用することです。 | ||
- | </ | ||
- | |||
- | The repositories can be your own or made by third parties (AWS S3®, Google Cloud Storage®, Microsoft Azure®) and in any case must be physically outside the node or nodes that you use in conjunction with Pandora FMS. **You are solely responsible for these snapshots**. | ||
- | |||
- | リポジトリは独自のものでも、サードパーティ(AWS S3®、Google Cloud Storage®、Microsoft Azure®)で作成することもできます。いずれの場合も、Pandora FMS と組み合わせて使用する 1つまたは複数のノードの外に物理的に配置する必要があります。 **これらのスナップショットについては、ユーザ自身の責任の元での管理となります**。 | ||
- | |||
- | See the official Elasticsearch documentation for more information: | ||
- | |||
- | 詳細については、Elasticsearch の公式ドキュメントを参照してください。 | ||
- | |||
- | * [[https:// | ||
- | |||
- | ==== リポジトリの作成 ==== | ||
- | |||
- | A network file system ([[https:// | ||
- | |||
- | ネットワークファイルシステム([[https:// | ||
- | |||
- | <WRAP center round important 60%> | ||
- | |||
- | Pandora FMS independently also uses NFS to [[: | ||
- | </ | ||
- | |||
- | <WRAP center round important 60%> | ||
- | [[: | ||
- | </ | ||
- | |||
- | Once you have installed and configured the target NFS, proceed to create and mount a directory on the Elastisearch node(s), for example it can be called: | ||
- | |||
- | 対象の NFS をインストールして設定したら、Elastisearch ノードにディレクトリを作成してマウントします。たとえば、次のように呼び出すことができます。 | ||
- | |||
- | < | ||
- | |||
- | / | ||
- | |||
- | </ | ||
- | |||
- | Grant permissions for the user '' | ||
- | |||
- | ユーザー '' | ||
- | |||
- | < | ||
- | chown elasticsearch: | ||
- | |||
- | </ | ||
- | |||
- | You must declare this path in the Elasticsearch configuration file as the repository path on the node(s) (all nodes): | ||
- | |||
- | Elasticsearch 設定ファイルでこのパスをノード(すべてのノード)のリポジトリパスとして宣言する必要があります。 | ||
- | |||
- | < | ||
- | path: | ||
- | repo: | ||
- | - / | ||
- | |||
- | </ | ||
- | |||
- | When you have configured the node(s) you must restart the elasticsearch service (on all nodes): | ||
- | |||
- | ノードを設定したら、(すべてのノードで) elasticsearch サービスを再起動する必要があります。 | ||
- | |||
- | < | ||
- | systemctl start elasticsearch.service && systemctl status elasticsearch.service | ||
- | |||
- | </ | ||
- | |||
- | Apart from the [[: | ||
- | |||
- | [[: | ||
- | |||
- | < | ||
- | |||
- | curl -X PUT " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | ' | ||
- | |||
- | </ | ||
- | |||
- | If you use a port other than '' | ||
- | |||
- | '' | ||
- | |||
- | You should get the following message from the node(s): | ||
- | |||
- | ノードから次のようなメッセージが得られます。 | ||
- | |||
- | < | ||
- | " | ||
- | |||
- | </ | ||
- | |||
- | This will indicate that the repository has been created. To check the status of the repository: | ||
- | |||
- | これは、リポジトリが作成されたことを示します。 リポジトリのステータスを確認するには次のようにします。 | ||
- | |||
- | < | ||
- | curl -X POST " | ||
- | |||
- | </ | ||
- | |||
- | Replace '' | ||
- | |||
- | '' | ||
- | |||
- | ==== データベースのスナップショット生成 ==== | ||
- | |||
- | To take a snapshot manually, use the snapshot creation API. The snapshot name supports the use of [[https:// | ||
- | |||
- | スナップショットを手動で取得するには、スナップショット作成 API を使用します。 スナップショット名は、一意の名前をつけるために、[[https:// | ||
- | |||
- | < | ||
- | |||
- | PUT _snapshot/ | ||
- | |||
- | </ | ||
- | |||
- | Replace '' | ||
- | |||
- | '' | ||
- | |||
- | < | ||
- | PUT _snapshot/ | ||
- | |||
- | </ | ||
- | |||
- | Depending on its size, a snapshot may take some time to complete. By default, the snapshot creation API only starts the snapshot process, which runs in the background. To block the client until the snapshot is finished, set the query parameter '' | ||
- | |||
- | サイズによっては、スナップショットの取得に時間がかかる場合があります。 デフォルトでは、スナップショット作成 API は、バックグラウンドで実行されるスナップショットプロセスのみを実行します。 スナップショットが終了するまでクライアントが待つようにするには、クエリパラメータ '' | ||
- | |||
- | < | ||
- | PUT _snapshot/ | ||
- | |||
- | </ | ||
- | |||
- | To perform a snapshot named: '' | ||
- | |||
- | '' | ||
- | |||
- | < | ||
- | curl -X PUT " | ||
- | |||
- | </ | ||
- | |||
- | If you use a port other than 9200, replace it with that value. | ||
- | |||
- | 9200 以外のポートを利用する場合は、該当部分を置き換えます。 | ||
- | |||
- | With the parameter '' | ||
- | |||
- | パラメータ '' | ||
- | |||
- | As soon as it finishes, it will return in JSON form the summary information of the process, it will be something similar to this: | ||
- | |||
- | 完了するとすぐに、処理の概要情報が JSON 形式で返されます。これは次のようになります。 | ||
- | |||
- | {{ : | ||
- | |||
- | It is also possible to define specific options in the snapshot execution such as the indexes to include or metadata, for more details visit: | ||
- | |||
- | 含めるインデックスやメタデータなど、スナップショットの実行で特定のオプションを定義することもできます。詳細については、次を参照してください。 | ||
- | |||
- | * [[https:// | ||
- | |||
- | \\ Example: | ||
- | |||
- | \\ 例: | ||
- | |||
- | < | ||
- | |||
- | curl -X PUT " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | ' | ||
- | |||
- | </ | ||
- | |||
- | === スナップショットの一覧 === | ||
- | |||
- | To get a list of all stored snapshots you can run the command: | ||
- | |||
- | 保存されているすべてのスナップショットの一覧を取得するには、次のコマンドを実行します。 | ||
- | |||
- | < | ||
- | curl -X GET " | ||
- | |||
- | </ | ||
- | |||
- | Where '' | ||
- | |||
- | ここで、'' | ||
- | |||
- | * [[https:// | ||
- | |||
- | === スナップショットの削除 === | ||
- | |||
- | To delete a snapshot you must obtain its name from the above command and then execute it on one of the nodes: | ||
- | |||
- | スナップショットを削除するには、上記のコマンドにてその名前を取得してから、ノードの 1つで実行します。 | ||
- | |||
- | < | ||
- | curl -X DELETE " | ||
- | |||
- | </ | ||
- | |||
- | ==== データベーススナップショットのリストア ==== | ||
- | |||
- | <WRAP center round important 80%>To restore an index from a snapshot it must be closed, apart from other technical considerations. Please refer to this link for more information: | ||
- | |||
- | * [[https:// | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round important 80%> | ||
- | |||
- | * [[https:// | ||
- | |||
- | </ | ||
- | |||
- | To restore an index, one of two ways must be used: | ||
- | |||
- | インデックスを復元するには、次の 2つの方法のいずれかを使用する必要があります。 | ||
- | |||
- | - Delete the original index before restoring. | ||
- | - Rename the restored index. | ||
- | |||
- | - 復元する前に、元のインデックスを削除 | ||
- | - 復元するインデックスの名前を変更 | ||
- | |||
- | Both cases are presented below using '' | ||
- | |||
- | 両方の場合を、リポジトリ名に '' | ||
- | |||
- | * **Delete and restore**: | ||
- | |||
- | * **削除およびリストア**: | ||
- | The easiest way to avoid conflicts is to delete an existing index or data stream //before restoring it//. | ||
- | |||
- | 競合を回避する最も簡単な方法は、既存のインデックスまたはデータストリームを// | ||
- | |||
- | <WRAP center round tip 60%> \\ To avoid accidental recreation of the index or data stream, it is recommended to temporarily stop all indexing until the restore operation is completed. \\ </ | ||
- | |||
- | <WRAP center round tip 60%> \\ インデックスまたはデータストリームが誤って再作成されないように、復元操作が完了するまですべてのインデックスを一時的に停止することをお勧めします。</ | ||
- | |||
- | To delete an index: | ||
- | |||
- | インデックスの削除方法: | ||
- | < | ||
- | |||
- | curl -X DELETE " | ||
- | |||
- | </ | ||
- | |||
- | To restore an index: | ||
- | |||
- | インデックスのリストア方法: | ||
- | |||
- | < | ||
- | curl -X POST " | ||
- | { | ||
- | " | ||
- | } | ||
- | ' | ||
- | |||
- | </ | ||
- | |||
- | * **Rename when restoring**< | ||
- | In this way you will repeat the information you already have stored and in some scenarios this process can be useful, for example: | ||
- | |||
- | * **リストアの際にリネーム**< | ||
- | この方法では、すでに保存されている情報と同じものを扱います。一部のシナリオでは、この処理が役立つ場合があります。たとえば、次のような場合です。 | ||
- | |||
- | * You need to confirm that a successful data retrieval has been performed. Each of the indexes and its renamed copy should contain the same information and return the same search results. | ||
- | * Validate data audits performed by third parties. | ||
- | |||
- | * データ取得が正常に実行されたことを確認する必要がある。 各インデックスとその名前が変更されたコピーで、同じ情報が含まれ、同じ検索結果が返されることを確認する。 | ||
- | * サードパーティによって実行されたデータ監査を検証する。 | ||
- | |||
- | < | ||
- | curl -X POST " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | ' | ||
- | |||
- | </ | ||
- | |||
- | === ノードの完全リストア === | ||
- | |||
- | In the case of wanting to restore an entire node with all its indexes, it is recommended to stop the indexing services before executing the restore, for more information on this topic visit: | ||
- | |||
- | すべてのインデックスを含むノード全体を復元する場合は、復元を実行する前にインデックスサービスを停止することをお勧めします。このトピックの詳細については、次を参照してください。 | ||
- | |||
- | * [[https:// | ||
- | |||
- | |||
- | ===== 表示と検索 ===== | ||
- | |||
- | In a log collecting tool, two things are the main concerns: looking for information, | ||
- | |||
- | ログ収集のツールに関して、私たちは主に 2つのことに興味があります。日時やデータソース、キーワードによるフィルタリングをしての情報の検索と、時間単位ごとに発生する情報の参照(**ログビューワ**)です。この例では、直近 1時間のすべてのデータソースからのログメッセージを見てみます。**Search**, | ||
- | |||
- | {{ : | ||
- | // | ||
- | |||
- | 最も重要で便利なフィールドは、**検索** テキストボックスに入力する検索文字列と、使用可能な 3つの **検索モード** です。 | ||
- | |||
- | **完全一致** | ||
- | 文字検索で、// | ||
- | |||
- | {{ : | ||
- | |||
- | **全単語** | ||
- | 単一の //ログ// の行の順序に関係なく、指定された単語(各単語はスペースで区切られることに注意してください)を // | ||
- | |||
- | {{ : | ||
- | |||
- | **任意の単語** | ||
- | 順番は関係なく、指定した単語の // | ||
- | |||
- | {{ : | ||
- | |||
- | フィルタされたコンテンツのコンテキストを表示するオプションがチェックされている場合、結果は、検索に関連する他のログ行に関する情報を含む状況の概要になります。 | ||
- | |||
- | ==== 表示と高度な検索 ==== | ||
- | <WRAP center round tip 60%> | ||
- | {{wiki: | ||
- | </ | ||
- | |||
- | この機能により、ログエントリをグラフに変換し、 **データキャプチャテンプレート** に従って情報を整理できます。 | ||
- | |||
- | これらのデータキャプチャテンプレートは基本的に正規表現と識別子であり、データソースを分析してグラフとして表示できます。 | ||
- | |||
- | 高度なオプションへアクセスするには、// | ||
- | |||
- | * ログエントリーの表示 (プレーンテキスト) | ||
- | * ロググラフの表示 | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | // | ||
- | |||
- | //Apache log model// テンプレートは、デフォルトで、標準形式の Apache ログ ([[https:// | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | 編集ボタン{{wiki: | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | |||
- | |||
- | このフォームでは、以下を選択できます。 | ||
- | |||
- | **キャプチャ正規表現(Capture regexp)** | ||
- | |||
- | | ||
- | **フィールド(Fields)** | ||
- | |||
- | 正規表現を介してキャプチャされる順番です。 結果は、アンダースコアの間に書かれていない名前のキーフィールドの連結によってソートされます。 | ||
- | |||
- | < | ||
- | |||
- | key, _value_ | ||
- | |||
- | </ | ||
- | |||
- | |||
- | < | ||
- | key, | ||
- | |||
- | </ | ||
- | |||
- | |||
- | < | ||
- | key1, | ||
- | |||
- | </ | ||
- | |||
- | |||
- | //注意:// value フィールドが指定されていない場合、自動的に一致する正規表現の数になります。 | ||
- | |||
- | //注意 2:// 1つだけ //value// カラムが指定されている場合は、累積値(デフォルトではパフォーマンス)を表すか、チェックボックスをオンにして平均を表すかを選択できます。 | ||
- | |||
- | //例// | ||
- | |||
- | 以下のフォーマットのログからエントリを取得するとします。 | ||
- | |||
- | < | ||
- | Sep 19 12:05:01 nova systemd: Starting Session 6132 of user root. | ||
- | Sep 19 12:05:01 nova systemd: Starting Session 6131 of user root. | ||
- | |||
- | </ | ||
- | |||
- | |||
- | ユーザのログイン数をカウントするには、次のようにします。 | ||
- | |||
- | 正規表現: | ||
- | |||
- | < | ||
- | Starting Session \d+ of user (.*?)\. | ||
- | |||
- | </ | ||
- | |||
- | |||
- | フィールド: | ||
- | |||
- | < | ||
- | username | ||
- | |||
- | </ | ||
- | |||
- | |||
- | このキャプチャテンプレートは、選択した時間間隔におけるユーザのログイン数を返します。 | ||
- | |||
- | {{ : | ||
- | |||
- | ==== お気に入り要素として保存されたフィルタ ==== | ||
- | |||
- | <WRAP center round info 60%> | ||
- | |||
- | NG 770 version or later. | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round info 60%> | ||
- | |||
- | バージョン NG 770 以降 | ||
- | |||
- | </ | ||
- | |||
- | Although **Log viewer** lacks explicit filter saving, you may use the [[: | ||
- | |||
- | **ログビューアー**には明示的なフィルタ保存機能がありませんが、[[: | ||
- | |||
- | {{ : | ||
- | |||
- | You will be prompted for a name to save as a favorite the filtering conditions you set. | ||
- | |||
- | 設定したフィルタリング条件をお気に入りとして保存するための名前を求められます。 | ||
- | |||
- | {{ : | ||
- | |||
- | **Log viewer** filter preferences will be saved in their corresponding section in **Favorite** (**Operation** menu). | ||
- | |||
- | **ログビューワ** フィルタ設定は、**お気に入り(Favorite)** (**操作(Operation)** メニュー) の対応するセクションに保存されます。 | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | ===== エージェント設定 ===== | ||
- | ログ収集は、Windows および Unux (LInux®, MacOS X®, Solaris®, HP-UX®, AIX®, BSD® など) エージェント双方で実行されます。Windows エージェントの場合、イベントビューワモジュールで同様のフィルタを用いることにより、Windows イベントビューワから情報を取得することもできます。 | ||
- | |||
- | Windows と Unix でのログ情報収集の例をみてみます。 | ||
- | |||
- | ==== Windows の場合 ==== | ||
- | バージョン 750 以降、このアクションは、詳細オプションを有効化することにより、エージェントプラグインを介して実行できます。 | ||
- | |||
- | 以下に示すタイプの処理を実行できるようになります。 | ||
- | |||
- | **Logchannel module** | ||
- | |||
- | < | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | </ | ||
- | |||
- | **Logevent module** | ||
- | |||
- | < | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | </ | ||
- | |||
- | **Regexp module** | ||
- | |||
- | < | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | </ | ||
- | |||
- | ログタイプモジュールの詳細説明については、次の章で確認できます。[[ja: | ||
- | |||
- | module_type log | ||
- | |||
- | この種のタグ module_type logを 定義すると、データベースには保存されませんが、ログコレクターに送信されていることを示します。このタイプのデータを持つモジュールは、有効になっている場合はコレクターに送信され、有効になっていない場合は情報が破棄されます。 | ||
- | |||
- | **注意**: この書式は、バージョン 5.0 以上で有効です。Enterprise 版をアップデートした状態にしているか確認してください。 | ||
- | |||
- | ==== Unix システム ==== | ||
- | エージェントバージョン 5.0 では、次の書式を使います。 | ||
- | |||
- | < | ||
- | module_plugin grep_log_module / | ||
- | |||
- | </ | ||
- | |||
- | ログパースプラグイン(grep_log)と同じように、grep_log_module プラグインは、処理した情報をログファイルのソースとして " | ||
- | |||
- | ===== エージェント表示でのログソース ===== | ||
- | |||
- | From Pandora FMS version 749 onwards, a box called **Log sources status** has been added to the Agent View, where the date of the last log update by that agent will appear. By clicking on the **Review** magnifying glass icon, you will be redirected to the **[[: | ||
- | |||
- | Pandora FMS バージョン 749 以降、**ログソース状態** と呼ばれるボックスがエージェント表示に追加され、そのエージェントによる最後のログ更新の日付が表示されます。虫眼鏡のアイコンをクリックすると、そのログにフィルタした**[[: | ||
- | |||
- | {{ : | ||
- | |||
- | [[ja: | ||
- | |||