差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン | |||
ja:documentation:05_big_environments:07_server_management [2022/12/09 08:43] – [NG 753 およびそれ以前のバージョンにおけるヒストリデータベース] junichi | ja:documentation:05_big_environments:07_server_management [2023/11/14 06:16] (現在) – 削除 junichi | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== サーバ管理 ====== | ||
- | {{indexmenu_n> | ||
- | |||
- | [[ja: | ||
- | |||
- | ===== Pandora FMS サーバ管理 ===== | ||
- | |||
- | ==== Pandora FMS サーバの手動起動/ | ||
- | |||
- | <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 the followin in a shell console: | ||
- | |||
- | Pandora FMS を手動で起動・停止するには、コマンドラインから以下を実行します。 | ||
- | |||
- | * Stop the // | ||
- | |||
- | * // | ||
- | |||
- | < | ||
- | |||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Start the daemon: | ||
- | |||
- | * デーモンの起動: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Restart the daemon: | ||
- | |||
- | * デーモンの再起動: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round tip 60%>\\ | ||
- | Version NG 756 or later.\\ | ||
- | </ | ||
- | |||
- | <WRAP center round tip 60%>\\ | ||
- | バージョン NG 756 以上\\ | ||
- | </ | ||
- | |||
- | From version NG 756 onwards the previous instructions will also start the **pandora_ha** service. | ||
- | |||
- | バージョン NG 756 以上では、上記の手順で **pandora_ha** サービスも起動されます。 | ||
- | |||
- | To start and/or stop manually **only** the Pandora FMS server, you have to execute the following in a shell console: | ||
- | |||
- | Pandora FMS サーバ **のみ** を手動で起動・停止するには、コマンドラインから次のように実行します。 | ||
- | |||
- | * Stop the daemon: | ||
- | |||
- | * デーモンの停止: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Start the daemon: | ||
- | |||
- | * デーモンの起動: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Restart the daemon: | ||
- | |||
- | * デーモンの再起動: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | You can monitor the status of **pandora_ha** through **systemd** with: | ||
- | |||
- | **systemd** を通して次のように **pandora_ha** の状態を確認できます。 | ||
- | |||
- | < | ||
- | systemctl status pandora_ha.service | ||
- | |||
- | </ | ||
- | |||
- | |||
- | ==== データベース管理 ==== | ||
- | |||
- | Pandora FMS infrastructure does not need external maintenance, | ||
- | |||
- | Pandora FMS インフラストラクチャは外部メンテナンスを必要としませんが、古いデータを削除し、データベースをできるだけコンパクトに維持することが非常に重要です。 これらのタスクの実行を担当する Pandora FMS に不可欠なツールがあります。 | ||
- | |||
- | In Pandora FMS Open version its location is: | ||
- | |||
- | 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 は、24時間を越えるエージェント接続情報は必要としません。もし、それが増えると、データベースのアクセス速度が低下します。 | ||
- | * {{: | ||
- | |||
- | As mentioned before, **pandora_db** | ||
- | |||
- | 前述したように、**pandora_db** の実行はシステムの cron タスクで設定されます。この設定は Pandora FMS サーバのインストールに自動的に含まれますが、確認すると良いでしょう。 ''/ | ||
- | |||
- | In Pandora FMS Open version: | ||
- | |||
- | Pandora FMS オープンソース版の場合: | ||
- | |||
- | < | ||
- | |||
- | "/ | ||
- | |||
- | </ | ||
- | |||
- | 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 / | ||
- | |||
- | </ | ||
- | |||
- | ==== メンテナンスツールの手動実行 ==== | ||
- | |||
- | If necessary, it is possible to launch **pandora_db** execution manually as it was exposed in the previous section. Execute from a shell the following. | ||
- | |||
- | 必要に応じて、前のセクションで説明した **pandora_db** を手動で実行できます。 シェルコンソールからコマンドを実行します。 | ||
- | |||
- | In Pandora FMS Open version: | ||
- | |||
- | Pandora FMS オープンソース版の場合: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | {{https:// | ||
- | |||
- | {{https:// | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | 次のような出力が表示されます。 | ||
- | |||
- | {{ : | ||
- | |||
- | <WRAP center round important 60%> | ||
- | 負荷が高いシステムでは数時間かかる場合があるため、バックグラウンドでプロセスを実行することをお勧めします。 | ||
- | </ | ||
- | |||
- | 手動でメンテナンスツールをバックグラウンド実行するには、次のようにします。 | ||
- | |||
- | In Pandora FMS Open version: | ||
- | |||
- | Pandora FMS オープンソース版の場合: | ||
- | |||
- | < | ||
- | nohup / | ||
- | |||
- | </ | ||
- | |||
- | {{https:// | ||
- | |||
- | {{https:// | ||
- | |||
- | < | ||
- | nohup / | ||
- | |||
- | </ | ||
- | |||
- | バックグラウンドでプロセスの実行には少々時間がかかります。プロセスの実行中でも、シェルこのソールを閉じることができます。 | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | インストールの状況によっては、ツールのディレクトリが変わります。ほとんどの場合は以下の通りです。 | ||
- | |||
- | / | ||
- | |||
- | Pandora FMS の以前のバージョンでは以下にあります。 | ||
- | |||
- | / | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round important 60%> | ||
- | 古いバージョンではなく、新しいバージョンのツールを使用していることを確認することが非常に重要です。 引数なしでプログラムを実行すると、メッセージの先頭にツールのバージョンが表示され、サーバにインストールしたバージョンが一致している必要があります。 | ||
- | </ | ||
- | |||
- | ==== データベースバックアップ ==== | ||
- | |||
- | <WRAP center round important 60%> It is important to remember that this **only** backs up or restores the database, //without including other files//, nor the server configuration.</ | ||
- | |||
- | <WRAP center round important 60%> これは、他のファイルやサーバ設定を含めずに、データベース**のみ**のバックアップまたは復元であることを認識しておくことが重要です。</ | ||
- | |||
- | The command **mysqldump** will do a complete database dump of the table structure as well as its contents. This is done by doing a full database dump, both of the table structure as well as their contents. This command has several options to do a backup, and its most basic usage is enough to dump from the same system where the database is hosted. Indicate the database name from which the backup will be done and the credentials to access it: | ||
- | |||
- | コマンド **mysqldump** は、テーブル構造とその内容の完全なデータベースダンプを行います。このコマンドには、バックアップを実行するためのいくつかのオプションがありますが、ここでは最も基本的な使用法に焦点をあてます。これは、データベースを実行しているのと同じホストから実行することを意味します。 バックアップが行われるデータベース名とそれにアクセスするための認証情報を指定します。 | ||
- | |||
- | mysqldump -u < | ||
- | |||
- | For instance, to backup " | ||
- | |||
- | 例えば、" | ||
- | |||
- | mysqldump -u root -p pandora > / | ||
- | |||
- | From a backup done that way, you may fully restore the database. Login in MySQL, proceed to create the database that will be restored and then load the backup in that database. Following the previous example: | ||
- | |||
- | そのようにして行われたバックアップから、データベースを完全に復元できます。MySQL にログインし、復元されるデータベースの作成に進み、そのデータベースにバックアップをロードします。前のファイルを例にすると、次のように実行します。 | ||
- | |||
- | < | ||
- | [root@pandorafms ~]# mysql -u root -p | ||
- | mysql> create database pandora; | ||
- | mysql> use pandora; | ||
- | mysql> source / | ||
- | </ | ||
- | |||
- | Finally, it is necessary to set configured user permissions again both in Pandora FMS Console and server so they have total access to the database (replace '' | ||
- | |||
- | 最後に、Pandora FMS コンソールとサーバの両方で設定済みのユーザ権限を再度設定し、データベースへのアクセス権を付与します。('' | ||
- | |||
- | grant all privileges on pandora.* to pandora@localhost identified by ' | ||
- | |||
- | <WRAP center round important 60%> | ||
- | これは、データベースのバックアップ/ | ||
- | </ | ||
- | |||
- | ==== Pandora FMS のバックアップとリカバリ ==== | ||
- | |||
- | There is a script in Pandora FMS server distribution that is useful to backup and restore Pandora FMS completely. This script is intended for backup and restoration in systems where the server and console are located in the same machine. | ||
- | |||
- | Pandora FMS サーバの配布パッケージには、Pandora FMS を完全にバックアップおよび復元するのに役立つスクリプトがあります。 このスクリプトは、サーバとコンソールが同じマシン上にあるシステムでのバックアップと復元を目的としています。 | ||
- | |||
- | <WRAP center round tip 60%>If there are several components in your environment, | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | This script needs to be executed as **root**. You are the only **responsible** for said key. It is located at: | ||
- | |||
- | この処理を実行するには、スクリプトを root 権限で実行する必要があります。スクリプトは以下にあります。 | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | If it is executed without parameters, it will show the help menu: | ||
- | |||
- | 引数無しで実行すると、ヘルプを表示します。 | ||
- | |||
- | {{ : | ||
- | |||
- | このスクリプトは、次のコンポーネントのバックアップとリストアをするように設計されています。 | ||
- | |||
- | * **Server configuration** | ||
- | * Files **waiting for execution**, | ||
- | * Complete **DB**. | ||
- | * Complete **WEB Console**. | ||
- | |||
- | * **サーバ設定**ファイル | ||
- | * **処理待ちの**ファイルおよび、エージェントの**リモート設定**ファイル | ||
- | * **DB** 全体 | ||
- | * **ウェブコンソール**全体 | ||
- | |||
- | ===バックアップ元とバックアップ先オプション=== | ||
- | |||
- | This script obtains access credentials to the database directly from the WEB console configuration. That is why the full path with the '' | ||
- | |||
- | このスクリプトは、ウェブコンソールの設定ファイルに設定されている DB のアクセス情報を利用します。そのため、ウェブコンソールの設定ファイルのパスを '' | ||
- | このパラメータは、ウェブコンソールのバックアップを取得するためにも利用されます。 | ||
- | |||
- | The backup' | ||
- | |||
- | パックアップ**先**は、// | ||
- | |||
- | そのようにして、次のコマンドは完全な環境バックアップを実行します。 | ||
- | |||
- | / | ||
- | |||
- | With the '' | ||
- | |||
- | '' | ||
- | |||
- | / | ||
- | |||
- | ===データベースリストア=== | ||
- | |||
- | To restore the database with the script, replace the parameter '' | ||
- | |||
- | スクリプトでデータベースをリストアするには、パラメーター '' | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | これは、ディレクトリを含まないデフォルトのリストアです。 | ||
- | |||
- | ===データベースとディレクトリのリストア=== | ||
- | |||
- | The '' | ||
- | |||
- | '' | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round important 60%> | ||
- | //grant// コマンドを使って、データベースのユーザ権限の復元を忘れないようにしてください。 | ||
- | </ | ||
- | |||
- | ===ファイルのリストア(データベースではない)=== | ||
- | |||
- | Same as with the previous option, it is possible to restore only the files, without including the database. To do it, add the '' | ||
- | |||
- | 前のオプションと同じように、データベースを含めずにファイルのみを復元できます。 それを行うには、上記の実行例に '' | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | |||
- | === 利用例 === | ||
- | |||
- | ==バックアップの作成== | ||
- | |||
- | root で以下を実行します。 | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | 次のようなメッセージが表示されます。 | ||
- | |||
- | < | ||
- | Backup completed and placed in / | ||
- | |||
- | </ | ||
- | |||
- | This means that the backup is at, in this case: | ||
- | ''/ | ||
- | |||
- | これは、バックアップが ''/ | ||
- | |||
- | ==バックアップからのリストア== | ||
- | |||
- | <WRAP center round info 60%>To restore the backup automatically, | ||
- | |||
- | <WRAP center round info 60%> | ||
- | |||
- | 実行: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | 次のような表示がされます。 | ||
- | |||
- | < | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | Done. Backup in / | ||
- | |||
- | </ | ||
- | |||
- | ==コンソール障害時におけるバックアップからのリストア== | ||
- | |||
- | Pandora FMS コンソールが障害により異常状態になった場合、このツールでバックアップを取得していれば、コンソールをリストアすることができます。そのためには、次のようにバックアップファイルを手動で展開します。 | ||
- | |||
- | < | ||
- | cd /tmp | ||
- | tar zxvf pandorafms_backup_2021-12-16-16-11-50.tar.gz | ||
- | |||
- | </ | ||
- | |||
- | This will decompress your WEB console full directory in ''/ | ||
- | |||
- | これより、ウェブコンソールのファイルが ''/ | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | このディレクトリ内の全てのファイルをウェブコンソールのディレクトリ (利用しているディストリビューションにより異なります) にコピーしてください。 | ||
- | |||
- | < | ||
- | cp -R / | ||
- | |||
- | </ | ||
- | |||
- | 以上でバックアップからリストアされ使えるようになります。 | ||
- | |||
- | |||
- | ==== Pandora FMS の Watchdog 実装 ==== | ||
- | |||
- | In the code repository, there is a small script that is used as **Watchdog**. This script performs a Pandora FMS status monitoring. | ||
- | |||
- | コードリポジトリには、" | ||
- | |||
- | Thus you may perform a recovery operation (trying to start Pandora FMS), and if that fails, a warning must be issued. This tool is at: | ||
- | |||
- | 復旧動作(Pandora FMS の起動を試みる)を実行できますが、失敗した場合は、警告を発行します。このツールは以下にあります。 | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | |||
- | === アラート生成スクリプト === | ||
- | |||
- | The '' | ||
- | |||
- | '' | ||
- | |||
- | < | ||
- | # | ||
- | | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | スクリプトに実行パーミッションを与えます。 | ||
- | |||
- | < | ||
- | chmod 750 / | ||
- | |||
- | </ | ||
- | |||
- | === ウォッチドッグ起動 === | ||
- | |||
- | To launch the **Watchdog** and leave it workin in the background, execute the following: | ||
- | |||
- | **ウォッチドッグ**を起動し、バックグラウンドで動作させるには、次のように実行します。 | ||
- | |||
- | < | ||
- | nohup / | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round important 60%> When starting a **Watchdog**, | ||
- | |||
- | <WRAP center round important 60%> | ||
- | **ウォッチドッグ**を実行しているときに、メンテナンス上の理由で Pandora FMS サーバを手動で停止したい場合は、事前に**ウォッチドッグ**プロセスを停止して、サービスが自動的に起動されないようにする必要があります。 | ||
- | </ | ||
- | |||
- | ==== ヒストリデータベース ==== | ||
- | |||
- | {{ : | ||
- | |||
- | {{: | ||
- | |||
- | {{: | ||
- | |||
- | === ヒストリデータベースの設定 === | ||
- | |||
- | <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: | ||
- | |||
- | * 新たなヒストリデータベースを作成します。 | ||
- | |||
- | < | ||
- | [root@pandorafms ~]# mysql -u root -p | ||
- | mysql> create database pandora_history; | ||
- | </ | ||
- | |||
- | * Create Pandora FMS database schema. You may use the script ''/ | ||
- | |||
- | * Pandora FMS データベーススキーマを作成します。Pandora FMS コンソールと共に提供されている ''/ | ||
- | |||
- | <code bash> | ||
- | cat pandoradb.sql | mysql -u root -p -D pandora_history | ||
- | |||
- | |||
- | </ | ||
- | |||
- | * Grant permissions to a user ('' | ||
- | |||
- | * ヒストリデータベースにアクセスできるように Pandora FMS サーバとコンソールで利用するユーザのパーミッション('' | ||
- | |||
- | **For MySQL 5.7** | ||
- | |||
- | **MySQL 5.7 向け:** | ||
- | |||
- | <code bash> | ||
- | GRANT ALL PRIVILEGES ON pandora_history.* TO ' | ||
- | |||
- | |||
- | </ | ||
- | |||
- | **For MySQL 8:** | ||
- | |||
- | **MySQL 8 向け:** | ||
- | |||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | |||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | |||
- | To use these environment variables just define them before running //grants// in the terminal, enter the following: | ||
- | |||
- | これらの環境変数を使用するには、// | ||
- | |||
- | <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 info 60%> | ||
- | これらの手順はすべて、バージョン 753 以前のバージョンのみを対象としていることに注意してください。 | ||
- | </ | ||
- | |||
- | First, enter some data from the history database in // | ||
- | |||
- | まず、ヒストリデータベースのデータを //tconfig// テーブルに入力します。 この SQL クエリを使用して最小限の設定を作成し、**pandora_db** がヒストリデータベースに対して実行される際の設定をします。 まず、MySQL のコマンドライン(CLI)を使用してデータベースに接続する必要があります。 | ||
- | |||
- | This is an example, replace values according to your criteria (but leave '' | ||
- | |||
- | これは例です。値は好みに応じて置き換えます(ただし、'' | ||
- | |||
- | < | ||
- | |||
- | 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,' | ||
- | |||
- | </ | ||
- | |||
- | * Take special care to replace ''< | ||
- | * This example is for the history database ito store for 6 months (180 days) from the execution date ('' | ||
- | * 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 center round tip 75%> | ||
- | Pandora FMS 753 以前のバージョンでは、通常のデータベースのように、データベースであらかじめ設定したデータを使用してヒストリデータベースサーバ自体でメンテナンススクリプト **pandora_db** を実行し、さらに以下で説明するように設定ファイルを作成する必要があります。 | ||
- | </ | ||
- | |||
- | In versions prior to Pandora FMS 753, create an additional '' | ||
- | |||
- | Pandora FMS 753 以前のバージョンでは、追加の '' | ||
- | |||
- | < | ||
- | dbengine mysql | ||
- | dbname pandora_history | ||
- | dbuser user | ||
- | dbpass password | ||
- | dbhost 192.168.70.140 | ||
- | log_file / | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round info 60%> | ||
- | |||
- | 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** | ||
- | |||
- | これで、ヒストリデータベースに対して **pandora_db** ツールを実行できるようになり、定期的に実行するように設定できます。 | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | <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: | ||