差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
ja:documentation:05_big_environments:07_server_management [2022/01/30 04:28] – [ウォッチドッグ起動] junichi | ja:documentation:05_big_environments:07_server_management [2022/12/09 08:43] – [NG 753 およびそれ以前のバージョンにおけるヒストリデータベース] junichi | ||
---|---|---|---|
行 8: | 行 8: | ||
==== Pandora FMS サーバの手動起動/ | ==== Pandora FMS サーバの手動起動/ | ||
- | To start and / or stop the server | + | <WRAP center round info 75%> Bear in mint that if for maintenance reasons you want to manually stop Pandora FMS server, verify whether a service **Watchdog** is running. [[: |
+ | |||
+ | <WRAP center round info 75%> メンテナンスにより Pandora FMS サーバを手動で停止する場合は、サービス**ウォッチドッグ**が実行されているかどうかを確認してください。詳細は、[[: | ||
+ | |||
+ | To start or stop manually Pandora FMS server execute | ||
Pandora FMS を手動で起動・停止するには、コマンドラインから以下を実行します。 | Pandora FMS を手動で起動・停止するには、コマンドラインから以下を実行します。 | ||
- | Stop daemon: | + | * Stop the // |
+ | |||
+ | * // | ||
- | デーモンの停止: | ||
< | < | ||
行 21: | 行 26: | ||
</ | </ | ||
- | Start daemon: | + | * Start the daemon: |
- | デーモンの起動: | + | * デーモンの起動: |
< | < | ||
行 30: | 行 35: | ||
</ | </ | ||
- | Restart daemon: | + | * Restart |
- | デーモンの再起動: | + | * デーモンの再起動: |
< | < | ||
行 55: | 行 60: | ||
Pandora FMS サーバ **のみ** を手動で起動・停止するには、コマンドラインから次のように実行します。 | Pandora FMS サーバ **のみ** を手動で起動・停止するには、コマンドラインから次のように実行します。 | ||
- | Stop daemon: | + | * Stop the daemon: |
- | デーモンの停止: | + | * デーモンの停止: |
< | < | ||
行 64: | 行 69: | ||
</ | </ | ||
- | Start daemon: | + | * Start the daemon: |
- | デーモンの起動: | + | * デーモンの起動: |
< | < | ||
行 73: | 行 78: | ||
</ | </ | ||
- | Restart daemon: | + | * Restart |
- | デーモンの再起動: | + | * デーモンの再起動: |
< | < | ||
行 93: | 行 98: | ||
==== データベース管理 ==== | ==== データベース管理 ==== | ||
- | Pandora FMS インフラストラクチャは外部メンテナンスを必要としませんが、古いデータを削除し、データベースをできるだけコンパクトに維持することが非常に重要です。 これらのタスクの実行を担当する Pandora FMS に不可欠なツールが以下にあります。 | ||
- | / | + | Pandora FMS infrastructure does not need external maintenance, |
- | Pandora FMS Enterprise 版の場合は以下です。 | + | Pandora FMS インフラストラクチャは外部メンテナンスを必要としませんが、古いデータを削除し、データベースをできるだけコンパクトに維持することが非常に重要です。 これらのタスクの実行を担当する Pandora FMS に不可欠なツールがあります。 |
- | / | + | In Pandora FMS Open version its location is: |
- | このツール(以降 **pandora_db.pl**)は、Pandora FMS サーバパッケージに含まれているため、Pandora FMS サーバがインストールされているシステムから実行する必要があります。 コンソール用とサーバ用で 2つのシステムがある場合、Pandora FMSサーバがホストされている方で // | + | Pandora FMS オープンソース版では以下にあります。 |
- | // | + | |
- | | + | < |
+ | / | ||
+ | |||
+ | </ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | < | ||
+ | |||
+ | / | ||
+ | |||
+ | </ | ||
+ | |||
+ | This tool, hereinafter **pandora_db.pl** | ||
+ | |||
+ | このツール(以降 **pandora_db.pl**)は、Pandora FMS サーバパッケージに含まれているため、Pandora FMS サーバがインストールされているシステムから実行する必要があります。 コンソール用とサーバ用で 2つのシステムがある場合、Pandora FMS サーバがホストされている方で **pandora_db** を実行する必要があります。 | ||
+ | |||
+ | **Pandora_db** | ||
+ | |||
+ | **Pandora_db** は、Pandora FMS が適切に動作するための重要なツールです。そのため、システムの cron タスクで一時間ごとに実行するように設定されています。 以下のファイルで設定されています。 | ||
+ | |||
+ | < | ||
+ | / | ||
+ | |||
+ | </ | ||
このツールは、データベースの全てのメンテナンスを自動的に実行します。 | このツールは、データベースの全てのメンテナンスを自動的に実行します。 | ||
- | * 古いデータの削除をします。 | + | * **It deletes old data**. |
+ | * **It compresses existing data**, interpolating them at several intervals, so that graphics are the same but the space needed to store them is much smaller (this is one reason why Pandora FMS is able to process such an amount of information). | ||
+ | * **It checks the consistency of the database for non-existing modules**, or modules that are not used because they can not be started (these modules appear in the tactical view as uninitialized modules). | ||
+ | * **It deletes the daily agent contact information**. Pandora FMS does not need more than 24hr agent contact history, and if it builds up, it slows down database access. | ||
+ | * {{: | ||
- | * 既存のデータを圧縮し、いくつかの間隔を補間します。これにより、グラフは同じですが、それらを保存するために必要なスペースははるかに小さくなります(これが、Pandora FMS が大量の情報を処理できる理由の 1つです)。 | + | |
+ | * **既存のデータを圧縮**し、いくつかの間隔を補間します。これにより、グラフは同じですが、それらを保存するために必要なスペースははるかに小さくなります(これが、Pandora FMS が大量の情報を処理できる理由の 1つです)。 | ||
+ | * 存在しないモジュールのデータベースでの整合性や、初期化されていないために利用されていないモジュール (これらのモジュールは、未初期化モジュールとして表示されます) を**チェックします**。 | ||
+ | * **エージェントの一日の接続情報を削除します**。Pandora FMS は、24時間を越えるエージェント接続情報は必要としません。もし、それが増えると、データベースのアクセス速度が低下します。 | ||
+ | * {{: | ||
- | | + | As mentioned before, |
- | | + | 前述したように、**pandora_db** の実行はシステムの cron タスクで設定されます。この設定は |
- | * エンタープライズ版では、全ての古いデータをスタンバイデータベースに移動します。 | + | In Pandora FMS Open version: |
- | 前述したように、// | + | Pandora FMS オープンソース版の場合: |
- | "/ | + | <code> |
- | Pandora FMS Enterprise 版では以下の通りです。 | + | "/ |
- | "/usr/ | + | </code> |
- | パーミッションとファイルの所有者を確認することも同様に重要です。 正しいパーミッションは 755 です。これは、次を実行することで付与できます。 | + | Or in Pandora FMS Enterprise version: |
- | | + | Pandora FMS Enterprise 版の場合: |
+ | |||
+ | < | ||
+ | "/ | ||
+ | |||
+ | </ | ||
+ | |||
+ | It is equally important to check permissions and the file's owner. The appropriate file permissions would be '' | ||
+ | |||
+ | パーミッションとファイルの所有者を確認することも同様に重要です。 正しいパーミッションは '' | ||
+ | |||
+ | < | ||
+ | chmod 755 / | ||
+ | |||
+ | </ | ||
+ | |||
+ | Regarding the owner, it must be **root** | ||
所有者に関しては、ユーザとグループ共に " | 所有者に関しては、ユーザとグループ共に " | ||
- | | + | < |
+ | chown root:root / | ||
+ | |||
+ | </ | ||
==== メンテナンスツールの手動実行 ==== | ==== メンテナンスツールの手動実行 ==== | ||
行 470: | 行 526: | ||
==== ヒストリデータベース ==== | ==== ヒストリデータベース ==== | ||
- | ヒストリデータベースは、メインの Pandora FMS データベースの応答を良くするために、そこから古いモジュールデータを移動させ保存しておくためのものです。データは、レポートやモジュールグラフの参照時に Pandora FMS コンソールでシームレスに利用できます。 | ||
- | === ヒストリデータベースの作成 === | + | {{ : |
- | ヒストリデータベースを設定するには、それを格納する(メインのデータベースとは異なる)新たなサーバが必要です。MySQL をインストールしたサーバを準備したら、以下の手順を実行します。 | + | |
- | * 新たなヒストリデータベースを作成します。 | + | {{: |
+ | |||
+ | {{: | ||
+ | |||
+ | === ヒストリデータベースの設定 === | ||
+ | |||
+ | <WRAP center round info 75%> | ||
+ | |||
+ | Version NG 754 and later versions{{: | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round info 75%> | ||
+ | バージョン NG 754 およびそれ以降{{: | ||
+ | </ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | In Pandora FMS console, go to ►**Setup** → **Setup** → **Historical database** to access [[: | ||
+ | |||
+ | Pandora FMS コンソールで、**セットアップ(Setup)** → **セットアップ(Setup)** → **ヒストリデータベース(Historical database)** へ行き、[[: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Fill in the following fields: | ||
+ | |||
+ | 次のフィールドを入力します。 | ||
+ | |||
+ | * **Host**: Host name (web link or IP address) of the history database. | ||
+ | * **Port**: Connection port of the history database. Stardard value: '' | ||
+ | * **Database name**: Name of the history database. Default value: '' | ||
+ | * **Database user**: History database user. Default value: '' | ||
+ | * **Database password**: Password of the history database. This will allow to cennect to the history database. Next fill in the custom parameters (**Customize settings**): | ||
+ | |||
+ | * **ホスト(Host)**: | ||
+ | * **ポート(Port)**: | ||
+ | * **データベース名(Database name)**: ヒストリデータベースの名前。デフォルトは '' | ||
+ | * **データベースユーザ(Database user)**: ヒストリデータベースユーザ。デフォルトは '' | ||
+ | * **データベースパスワード(Dabase password)**: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | The last fields of this form **Data days old to keep in active database, Transference block size (Step)** | ||
+ | |||
+ | このフォームの最後のフィールド**アクティブなデータベースに保持するデータ日数、転送ブロックサイズ(ステップ)** および **転送の遅延(秒)** は、データがヒストリデータベースへ送信される方法を定義します。つまり、オーバーロードを避けるために、n // | ||
+ | |||
+ | In the same screen, it is also possible to decide whether to send the events with more than n days to the history database (**Events days old to keep in active database**), | ||
+ | |||
+ | 同じ画面で、n 日を超えるイベントをヒストリデータベースに送信するかどうかを決定することもできます(**アクティブなデータベースにイベントを保持する日数**)。ただし、 イベントはヒストリデータベースを大幅に増大させることと、レポートを生成するときにのみ参照されイベント表示では参照されない点を考慮する必要があります。 | ||
+ | |||
+ | <WRAP center round tip 75%> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round tip 75%> | ||
+ | {{: | ||
+ | </ | ||
+ | |||
+ | === NG 753 およびそれ以前のバージョンにおけるヒストリデータベース === | ||
+ | |||
+ | <WRAP center round info 75%> | ||
+ | |||
+ | These steps are only for version 753 and previous versions. From version 754 the only thing necessary is to configure the connection values explained in the previous section and Pandora FMS will take care of the whole installation process and the [[: | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round info 75%> | ||
+ | こちらの手順は、バージョン 753 およびそれ以前のバージョンのみを対象としています。バージョン 754 以降、必要なのは前の章で説明した接続値を設定することだけです。Pandora FMS は、インストールプロセス全体と [[: | ||
+ | </ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | * Create the new historical database: | ||
+ | |||
+ | * 新たなヒストリデータベースを作成します。 | ||
< | < | ||
行 482: | 行 616: | ||
</ | </ | ||
- | * Pandora FMS データベーススキーマを作成します。Pandora FMS コンソールと共に提供されている /// | + | * Create |
- | | + | |
- | * ヒストリデータベースにアクセスできるように Pandora FMS サーバとコンソールで利用するユーザのパーミッションを設定します。 | + | <code bash> |
+ | cat pandoradb.sql | mysql -u root -p -D pandora_history | ||
- | GRANT ALL PRIVILEGES ON pandora_history.* TO ' | ||
- | | ||
- | === ヒストリデータベースの設定 === | ||
- | * Pandora FMS コンソールにて、設定(setup) -> ヒストリデータベース(History database) を選択し、データベースのホスト名、ポート番号、データベース名、ユーザ名、パスワードを入力します。 | + | </code> |
- | {{ :wiki: | + | * Grant permissions to a user ('' |
- | {{ : | + | * ヒストリデータベースにアクセスできるように Pandora FMS サーバとコンソールで利用するユーザのパーミッション('' |
- | このフォームの最後のフィールド(// | + | **For MySQL 5.7** |
- | 同じ画面で、//イベント日数(Event days)// に指定するイベントの履歴をヒストリデータベースに送信するかどうかを設定することもできます。ただし、イベントを含めるとヒストリデータベースが大幅に大きくなることを考慮する必要があります。また、このデータはイベント表示ではなく、レポートの生成時にのみ参照されます。 | + | **MySQL 5.7 向け:** |
+ | |||
+ | <code bash> | ||
+ | GRANT ALL PRIVILEGES ON pandora_history.* TO ' | ||
+ | |||
+ | |||
+ | </code> | ||
+ | |||
+ | **For MySQL 8:** | ||
+ | |||
+ | **MySQL 8 向け:** | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | To use these environment variables just define them before running //grants// in the terminal, enter the following: | ||
+ | |||
+ | これらの環境変数を使用するには、//GRANT// を実行する前に次のようにターミナルで設定するだけです。 | ||
+ | |||
+ | <code bash> | ||
+ | env TZ=' | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | </ | ||
+ | |||
+ | Enter in the terminal: | ||
+ | |||
+ | ターミナルで以下を実行します: | ||
+ | |||
+ | <code bash> | ||
+ | systemctl restart mysql | ||
+ | |||
+ | </ | ||
+ | |||
+ | Enter in the terminal: | ||
+ | |||
+ | ターミナルで以下を実行します: | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | export MYSQL_PWD=$DBROOTPASS | ||
+ | echo " | ||
+ | echo "ALTER USER \" | ||
+ | echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \" | ||
+ | |||
+ | export MYSQL_PWD=$DBPASS | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | The history database (DB) can contain //all the system data// | ||
+ | |||
+ | ヒストリデータベース(DB)には//すべてのシステムデータ// | ||
+ | |||
+ | <WRAP center round info 60%> | ||
+ | |||
+ | Remember that all these steps are only for version 753 and earlier versions. | ||
- | <WRAP center round tip 60%> | ||
- | ヒストリデータベースの機能は Enterprise 版の機能で、データを転送するのに / | ||
</ | </ | ||
- | === ヒストリデータベースの削除と圧縮設定 === | + | <WRAP center round info 60%> |
- | ヒストリデータベースは、" | + | これらの手順はすべて、バージョン 753 以前のバージョンのみを対象としていることに注意してください。 |
+ | </ | ||
- | 最初に、pandora_db ツールによって利用できるように、// | + | First, enter some data from the history database in // |
- | 以下が例です。値は必要に応じて書き換えてください。(ただし、history_db_enabled は 0 にしてください) | + | まず、ヒストリデータベースのデータを //tconfig// テーブルに入力します。 この SQL クエリを使用して最小限の設定を作成し、**pandora_db** |
+ | |||
+ | This is an example, replace values according to your criteria (but leave '' | ||
+ | |||
+ | これは例です。値は好みに応じて置き換えます(ただし、'' | ||
< | < | ||
- | INSERT INTO `tconfig` VALUES (1,' | + | |
- | | + | INSERT INTO `tconfig` VALUES (1,' |
- | | + | INSERT INTO `tconfig` VALUES (2,' |
- | | + | INSERT INTO `tconfig` VALUES (3,' |
- | | + | INSERT INTO `tconfig` VALUES (4,' |
- | | + | INSERT INTO `tconfig` VALUES (5,' |
- | | + | INSERT INTO `tconfig` VALUES (6,' |
+ | INSERT INTO `tconfig` VALUES (7,' | ||
</ | </ | ||
- | これは、ヒストリデータベースに(現在からさかのぼること) 6ヶ月間データを保存し、4ヶ月前のデータを圧縮することを意味します。メインのデータベースに | + | * Take special care to replace ''< |
+ | * This example is for the history database ito store for 6 months | ||
+ | * Compact data more than 120 days old ('' | ||
+ | * If you have 1 month worth of data in your main database, you will have a total of 6 months of data, because the last month has no data in the history database, but it has them in the main database ('' | ||
+ | * //Use the values that you think convenient// | ||
- | 次に、追加の // | + | * ''< |
+ | * この例は、ヒストリデータベースに過去 6ヵ月間(180日)のデータを保存します。('' | ||
+ | * 120日より古いデータを圧縮します。('' | ||
+ | * メインデータベースに最低 1ヵ月分のデータがある場合、前月分がヒストリデータベースになくてもメインデータベースにはデータがあるため、合計 6か月のデータを参照できます。('' | ||
+ | * //各値は任意に変更してください// | ||
+ | |||
+ | <WRAP center round tip 75%> | ||
+ | |||
+ | In versions prior to Pandora FMS 753 you must execute the script **pandora_db** | ||
+ | |||
+ | </WRAP> | ||
+ | |||
+ | <WRAP center round tip 75%> | ||
+ | Pandora FMS 753 以前のバージョンでは、通常のデータベースのように、データベースであらかじめ設定したデータを使用してヒストリデータベースサーバ自体でメンテナンススクリプト **pandora_db** を実行し、さらに以下で説明するように設定ファイルを作成する必要があります。 | ||
+ | </WRAP> | ||
+ | |||
+ | In versions prior to Pandora FMS 753, create an additional '' | ||
+ | |||
+ | Pandora FMS 753 以前のバージョンでは、追加の '' | ||
< | < | ||
dbengine mysql | dbengine mysql | ||
- | dbname | + | dbname |
- | dbuser | + | dbuser |
- | dbpass | + | dbpass |
- | dbhost 192.168.50.23 | + | dbhost 192.168.70.140 |
log_file / | log_file / | ||
+ | |||
</ | </ | ||
+ | <WRAP center round info 60%> | ||
- | これで、ヒストリデータベースに対して pandora_db ツールの定期実行をプログラムできます。 | + | Remember that all these steps are only for version 753 and earlier versions. |
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round info 60%> | ||
+ | これらの手順はすべて、バージョン 753 以前のバージョンのみを対象としていることに注意してください。 | ||
+ | </ | ||
+ | |||
+ | Now you can execute **pandora_db** | ||
+ | |||
+ | これで、ヒストリデータベースに対して | ||
< | < | ||
行 545: | 行 787: | ||
</ | </ | ||
- | また、設定値は[[: | + | <WRAP center round tip 60%> This process SHOULD NOT affect your main operation because it is running against a different database in a different server. </ |
+ | |||
+ | <WRAP center round tip 60%> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | [[ja: | ||
- | <WRAP center round tip 60%> | ||
- | この処理は、メインのデータベースには影響しません。なぜなら、異なるサーバの異なるデータベースに対して行っているためです。 | ||
- | </ |