差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
ja:documentation:05_big_environments:07_server_management [2022/07/08 22:32] – [ヒストリデータベース] junichi | ja:documentation:05_big_environments:07_server_management [2022/12/09 08:43] – [NG 753 およびそれ以前のバージョンにおけるヒストリデータベース] junichi | ||
---|---|---|---|
行 591: | 行 591: | ||
</ | </ | ||
- | === ヒストリデータベースの作成 | + | === 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: |
+ | |||
+ | * 新たなヒストリデータベースを作成します。 | ||
< | < | ||
行 608: | 行 620: | ||
* Pandora FMS データベーススキーマを作成します。Pandora FMS コンソールと共に提供されている ''/ | * Pandora FMS データベーススキーマを作成します。Pandora FMS コンソールと共に提供されている ''/ | ||
- | | + | <code bash> |
+ | cat pandoradb.sql | mysql -u root -p -D pandora_history | ||
+ | |||
+ | |||
+ | </ | ||
* Grant permissions to a user ('' | * Grant permissions to a user ('' | ||
行 614: | 行 630: | ||
* ヒストリデータベースにアクセスできるように Pandora FMS サーバとコンソールで利用するユーザのパーミッション('' | * ヒストリデータベースにアクセスできるように Pandora FMS サーバとコンソールで利用するユーザのパーミッション('' | ||
- | GRANT ALL PRIVILEGES ON pandora_history.* TO ' | + | **For MySQL 5.7** |
- | + | ||
- | === ヒストリデータベースの設定 === | + | |
- | {{: | + | **MySQL 5.7 向け:** |
- | {{: | + | <code bash> |
+ | GRANT ALL PRIVILEGES ON pandora_history.* TO ' | ||
- | {{ : | ||
- | Fill in the following fields: | + | </ |
- | 次のフィールドに入力します。 | + | **For MySQL 8:** |
- | * **Host**: Host name (web link or IP address) of the history database. | + | **MySQL 8 向け:** |
- | | + | |
- | * **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)**: ヒストリデータベースのホスト名(Webリンクまたは IP アドレス)。 | + | * '' |
- | * **ポート(Port)**: | + | * '' |
- | * **データベース名(Database name)**: ヒストリデータベースの名前。デフォルトは | + | * '' |
- | * **データベースユーザ(Database user)**: ヒストリデータベースユーザ。デフォルトは | + | * '' |
- | * **データベースパスワード(Database password)**: ヒストリデータベースのパスワード。これにより、ヒストリデータベースへ接続することができます。次に、カスタムパラメータを入力します(**設定のカスタマイズ**): | + | * '' |
+ | | ||
- | {{ :wiki:pandora_console_06-1.png | + | * '' |
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
- | The last fields of this form **Data days old to keep in active database, Transference block size (Step)** | + | To use these environment variables just define |
- | このフォームの最後のフィールド **アクティブなデータベースに保持するデータ日数、転送ブロックサイズ(ステップ)** および **転送の遅延(秒)** は、データをヒストリデータベースに送信される方法を定義します。つまり、n //日(Data days)// を超える最も古いデータは、n 行(//Step//)ごとに、オーバーロードを回避するために 1つのブロックと次のブロックの間を n 秒(// | + | これらの環境変数を使用するには、//GRANT// を実行する前に次のようにターミナルで設定するだけです。 |
- | 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**), | + | <code bash> |
+ | env TZ=' | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | 同じ画面で、n日を超えるイベントをヒストリデータベースに送信するかどうかを決定することもできます(**アクティブなデータベースに保持する古いイベント(Events days old to keep in active database)**)。ただし、イベントはヒストリデータベースの増大率を大幅に増加させます。また、これらはイベント表示ではなく、レポートを生成するときにのみ参照されます。 | + | </ |
- | <WRAP center round tip 75%> {{:wiki: | + | Enter in the terminal: |
- | <WRAP center round tip 75%> {{: | + | ターミナルで以下を実行します: |
- | ヒストリデータベースの機能は Enterprise 版の機能で、データを転送するのに ''/ | + | |
- | </ | + | |
- | === ヒストリデータベースの削除と圧縮設定 === | + | <code bash> |
+ | systemctl restart mysql | ||
- | History database is supposed to contain all history data, but if you want to delete old data, or compact them, you will need to use some specific data in database that take into account the script **pandora_db** when executed from the node. | + | </ |
- | ヒストリデータベースは、" | + | 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// table. Use this SQL queries to create a minimal configuration and configure the performance od **pandora_db** when executed against the history | + | First, enter some data from the history database in // |
- | 最初に、pandora_db ツールによって利用できるように、//tconfig// テーブルを適切な値を入れた状態で用意する必要があります。**pandora_db** | + | まず、ヒストリデータベースのデータを |
- | This is an example, replace values according to your criteria (but leave '' | + | This is an example, replace values according to your criteria (but leave '' |
- | 以下が例です。値は必要に応じて書き換えてください。(ただし、history_db_enabled は 0 にしてください) | + | これは例です。値は好みに応じて置き換えます(ただし、'' |
< | < | ||
- | 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,' | ||
</ | </ | ||
- | * This example is for the history database ito store for 6 months (180 days) from the execution date. | + | |
- | * Compact data more than 4 months old (120 days). | + | |
- | * 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. | + | * Compact data more than 120 days old ('' |
- | * You may type in any value here, there is no limit of data storage | + | * 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// | ||
- | * この例は、ヒストリデータベースに(現在からさかのぼること) | + | |
- | * 4ヶ月(120日)前のデータを圧縮することを意味します。 | + | |
- | * メインのデータベースに 1ヶ月間のデータがあるとしても、トータルで 6ヶ月間のデータとなります。なぜなら、直近 1ヶ月のデータはメインデータベースから読まれ、それ以外はヒストリデータベースから読まれるためです。 | + | * 120日より古いデータを圧縮します。('' |
- | * これらには任意の値を設定できます。ヒストリデータベースにはデータ量の上限はありません。ただし、ヒストリデータベースは、メインデータベースおよび Pandora FMS サーバやコンソールが動作しているマシンとは物理的に異なるマシンに配置しなければいけないことを理解してください。 | + | * メインデータベースに最低 |
+ | * //各値は任意に変更してください// | ||
- | <WRAP center round tip 75%> In versions prior to Pandora FMS 753 you must execute the script **pandora_db** | + | <WRAP center round tip 75%> |
- | <WRAP center round tip 75%> Pandora FMS 753 より前のバージョンでは、通常のデータベースと同じように、前述のデータベースと以降で説明する追加の設定ファイルを用いてヒストリサーバでメンテナンスのために **pandora_db** | + | In versions prior to Pandora FMS 753 you must execute the script **pandora_db** |
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round tip 75%> | ||
+ | Pandora FMS 753 以前のバージョンでは、通常のデータベースのように、データベースであらかじめ設定したデータを使用してヒストリデータベースサーバ自体でメンテナンススクリプト | ||
+ | </ | ||
In versions prior to Pandora FMS 753, create an additional '' | In versions prior to Pandora FMS 753, create an additional '' | ||
- | Pandora FMS 753 までのバージョンでは、追加の '' | + | 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%> | ||
+ | |||
+ | 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** | Now you can execute **pandora_db** | ||
- | これで、ヒストリデータベースに対して **pandora_db** ツールの定期実行をプログラムできます。 | + | これで、ヒストリデータベースに対して **pandora_db** ツールを実行できるようになり、定期的に実行するように設定できます。 |
< | < | ||
行 717: | 行 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%> | ||
+ | |||
- | <WRAP center round tip 60%> | ||
- | この処理は、メインのデータベースには影響しません。なぜなら、異なるサーバの異なるデータベースに対して行っているためです。 | ||
- | </ | ||
[[ja: | [[ja: | ||