ja:documentation:pandorafms:installation:06_server_management

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:installation:06_server_management [2024/05/12 07:55] – [NG 753 およびそれ以前のバージョンにおけるヒストリデータベース] junichija:documentation:pandorafms:installation:06_server_management [2025/02/26 02:17] (現在) – [アラート生成スクリプト] junichi
行 4: 行 4:
  
 [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]]
 +
 +<wrap #ks1 />
  
 ===== Pandora FMS サーバの手動起動/停止 ===== ===== Pandora FMS サーバの手動起動/停止 =====
  
-<WRAP center round info 75%>+<WRAP center round info 90%>
  
-Please note that if for maintenance reasons you want to manually stop Pandora FMS server, verify whether a service **Watchdog** is running. [[#watchdog_for_pandora_fms_servers|Check this section]] for more details.+Please note that if for maintenance reasons you wish to manually stop Pandora FMS server, verify whether a service **Watchdog** is running. [[#ks6|Check this section]] for more details.
  
 </WRAP> </WRAP>
  
-<WRAP center round info 75%>+<WRAP center round info 90%>
  
 メンテナンスにより Pandora FMS サーバを手動で停止する場合は、サービス**ウォッチドッグ**が実行されているかどうかを確認してください。詳細は、[[#pandora_fms_の_watchdog_実装|こちらの章]]を参照してください。 メンテナンスにより Pandora FMS サーバを手動で停止する場合は、サービス**ウォッチドッグ**が実行されているかどうかを確認してください。詳細は、[[#pandora_fms_の_watchdog_実装|こちらの章]]を参照してください。
行 19: 行 21:
 </WRAP> </WRAP>
  
-To start or stop manually Pandora FMS server execute the followin in a shell console:+To start or stop manually Pandora FMS server execute the following in a shell console:
  
-Pandora FMS を手動で起動・停止するには、コマンドラインから以下を実行します。 +Pandora FMS サーバを手動で起動・停止するには、コマンドラインから以下を実行します。
- +
-  * Stop the [[#daemon|daemon]] : +
- +
-  * [[#daemon|デーモン]]の停止 : +
- +
-<code> +
- +
-/etc/init.d/pandora_server stop +
- +
-</code> +
- +
-  * Start the daemon: +
- +
-  * デーモンの起動: +
- +
-<code> +
-/etc/init.d/pandora_server start +
- +
-</code> +
- +
-  * Restart the daemon: +
- +
-  * デーモンの再起動: +
- +
-<code> +
-/etc/init.d/pandora_server restart +
- +
-</code> +
- +
-<WRAP center round tip 60%>\\ +
-Version NG 756 or later.\\ +
-</WRAP> +
- +
-<WRAP center round tip 60%>\\ +
-バージョン NG 756 以上\\ +
-</WRAP> +
- +
-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:   * Stop the daemon:
行 71: 行 29:
   * デーモンの停止:   * デーモンの停止:
  
-<code> +<file>
-/etc/init.d/pandora_server stop-server+
  
-</code>+systemctl stop pandora_server 
 + 
 +</file>
  
   * Start the daemon:   * Start the daemon:
行 80: 行 39:
   * デーモンの起動:   * デーモンの起動:
  
-<code+<file
-/etc/init.d/pandora_server start-server+systemctl start pandora_server
  
-</code>+</file>
  
   * Restart the daemon:   * Restart the daemon:
行 89: 行 48:
   * デーモンの再起動:   * デーモンの再起動:
  
-<code+<file
-/etc/init.d/pandora_server restart-server+systemctl restart pandora_server
  
-</code>+</file>
  
-You can monitor the status of **pandora_ha** through **systemd** with:+You may monitor the status of [[en:documentation:pandorafms:complex_environments_and_optimization:06_ha|pandora_ha]]  through **systemd** with:
  
-**systemd** を通次のように **pandora_ha** の状態を確認できます。+次のようにして、**systemd** を通て [[ja:documentation:pandorafms:complex_environments_and_optimization:06_ha|pandora_ha]] の状態を確認できます。
  
 <code> <code>
行 103: 行 62:
 </code> </code>
  
 +<wrap #ks2 />
  
 ===== データベース管理 ===== ===== データベース管理 =====
  
-Pandora FMS infrastructure does not need external maintenance, but it is very important to purge old data, and maintain the database as much compacted as possible. There is an essential tool for the proper functioning of Pandora FMS which is in charge of carrying out these tasks. Its location is:+There is an essential tool for proper Pandora FMS performance, which is in charge of carrying out these tasks. Its location is:
  
-Pandora FMS インラストラクチャは外部メンテナンスを必要としませんが、古いデータを削除し、データベースをできるだけコンパクトに維持することが非常に重要です。 これらのタスク実行を担当する Pandora FMS に不可欠なツールがあります。そ以下にあす。+Pandora FMS が適切にパォーマンスを維持するためのタスク実行する重要なツールがあります。その場所次のとおす。
  
-<code>+<file>
 /usr/bin/pandora_db /usr/bin/pandora_db
  
-</code>+</file>
  
-This tool, hereinafter **pandora_db.pl**  is included in Pandora FMS server package, so it must be executed from a system where there is a Pandora FMS server installed. If there are two systems, one for the console and one for the server, **pandora_db**  must be executed where Pandora FMS server is hosted.+This tool, hereinafter **pandora_db.pl**  is included in Pandora FMS server package, so it must be executed from a system where there is a Pandora FMS server installed.
  
-このツール(以降 **pandora_db.pl**)は、Pandora FMS サーバパッケージに含まれているため、Pandora FMS サーバがインストールされているシステムから実行する必要があります。 コンソール用とサーバ用で 2つのシステムがある場合、Pandora FMS サーバがホストされている方で **pandora_db** を実行する必要があります。+このツール(以降 **pandora_db.pl**)は、Pandora FMS サーバパッケージに含まれているため、Pandora FMS サーバがインストールされているシステムから実行する必要があります。 
  
-**Pandora_db**  is a key tool for Pandora FMS to work properly, and that is why its execution is programmed in system cron tasks with an **hourly interval**. Its execution is configured within the file:+**pandora_db** is a key tool for Pandora FMS to work properly, and that is why its execution is programmed in system cron tasks with an **hourly interval**. Its execution is configured within the file:
  
-**Pandora_db** は、Pandora FMS が適切に動作するための重要なツールです。そのため、システムの cron タスクで一時間ごとに実行するように設定されています。 以下のファイルで設定されています。+**Pandora_db** は、Pandora FMS が適切に動作するための重要なツールです。そのため、システムの cron タスクで**一時間ごとに**実行するように設定されています。 以下のファイルで設定されています。
  
 <file> <file>
行 127: 行 87:
  
 </file> </file>
 +
 +This tool performs all database maintenance tasks automatically:
  
 このツールは、データベースの全てのメンテナンスを自動的に実行します。 このツールは、データベースの全てのメンテナンスを自動的に実行します。
  
-  * **It deletes old data**+  * 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 compresses existing data. 
-  * **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 checks the consistency of the database for non-existing modules or 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.+  * It deletes the daily agent contact information.
   * It **moves**  all old data to the standby history database.   * It **moves**  all old data to the standby history database.
  
-  * **古いデータの削除をします。** +  * 古いデータの削除をします。 
-  * **既存のデータを圧縮**し、いくつかの間隔を補間します。これにより、グラフは同じですが、それらを保存するために必要なスペースははるかに小さくなります(これが、Pandora FMS が大量の情報を処理できる理由の 1つです)。 +  * 既存のデータを圧縮します。 
-  * 存在しないモジュールのデータベースでの整合性や、初期化されていないために利用されていないモジュール (これらのモジュールは、未初期化モジュールとして表示されます) **チェックします**。 +  * 存在しないモジュールのデータベースでの整合性や、初期化されていないために利用されていないモジュールをチェックします。 
-  * **エージェントの一日の接続情報を削除します**。Pandora FMS は、24時間を越えるエージェント接続情報は必要としません。もし、それが増えると、データベースのアクセス速度が低下します。 +  * エージェントの一日の接続情報を削除します。 
-  * 全ての古いデータをスタンバイデータベースに移動します。+  * 全ての古いデータをトリデータベースに移動します。
  
 As mentioned before, **pandora_db**  execution is configured in system **cron** tasks and although this execution is automatically included in Pandora FMS server installation, it is convenient to check it. Therefore, ''/etc/cron.hourly/pandora_db''  must exist and contain the following: As mentioned before, **pandora_db**  execution is configured in system **cron** tasks and although this execution is automatically included in Pandora FMS server installation, it is convenient to check it. Therefore, ''/etc/cron.hourly/pandora_db''  must exist and contain the following:
行 168: 行 130:
  
 </code> </code>
 +
 +<wrap #ks3 />
  
 ===== メンテナンスツールの手動実行 ===== ===== メンテナンスツールの手動実行 =====
行 219: 行 183:
 ===== データベースバックアップ ===== ===== データベースバックアップ =====
  
-<WRAP center round important 60%>+<WRAP center round important 90%>
  
 It is important to remember that this **only** backs up or restores the database, //without including other files//, nor the server configuration. It is important to remember that this **only** backs up or restores the database, //without including other files//, nor the server configuration.
行 225: 行 189:
 </WRAP> </WRAP>
  
-<WRAP center round important 60%>+<WRAP center round important 90%>
  
 これは、他のファイルやサーバ設定を含めずに、データベース**のみ**のバックアップまたは復元であることを認識しておくことが重要です。 これは、他のファイルやサーバ設定を含めずに、データベース**のみ**のバックアップまたは復元であることを認識しておくことが重要です。
行 231: 行 195:
 </WRAP> </WRAP>
  
-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:+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//.
  
-コマンド **mysqldump** は、テーブル構造とその内容の完全なデータベースダンプを行ます。このコマンドには、バックアップを実行するためのいくつかのオプションがありますがここでは最も基本的な使用法に焦点をあてます。これは、データベースを実行しているのと同じから実行することを意味します。 バックアッが行われるデータベース名とそれにアクセスするための認証情報を指定します。+コマンド **mysqldump** は、テーブル構造とその内容の完全なデータベースダンプをします。これは、テーブル構造とその内容の両方の完全なデータベースダンプを実行することによって行われます。このコマンドには、バックアップを実行するためのいくつかのオプションがあり、// 最も基本的な使用法は、データベースがホストされている同じテムからダンプするだけで十分で//
  
-<code> +For instance, to backup ''pandora'' database ( ''root'' user  and password ''pandora'') and dump the result to a file execute:
-mysqldump -u <user> -p <data_base>+
  
-</code>+たとえば、''pandora'' データベース (''root''ユーザと''pandora'' パスワード) をバックアップし、結果をファイルにダンプするには、次のコマンドを実行します。
  
-For instance, to backup "pandora" database and dump the result to an ''.sql'' file execute: +<file>
- +
-例えば、"pandora" データベースをバックアップし、''.sql'' ファイルにダンプを出力するには次のようにします。 +
- +
-<code>+
 mysqldump -u root -p pandora> /backup/pandoradb_backup.sql mysqldump -u root -p pandora> /backup/pandoradb_backup.sql
  
-</code>+</file>
  
-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:+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 (replace ''mypassword'' with your password):
  
-そのようにして行われたバックアップから、データベースを完全に復元できます。MySQL にログインし、復元されるデータベースの作成に進み、そのデータベースにバックアップをロードします。前のファイルを例にすると、次のように実行します。+そのようにして行われたバックアップから、データベースを完全に復元できます。MySQL にログインし、復元されるデータベースの作成に進み、そのデータベースにバックアップをロードします。前のファイルを例にすると、次のように実行します(''mypassword'' を実際のパスワードに置き換えます)
  
-<code+<file
-[root@pandorafms ~]# mysql -u root -p +mysql -u root -p 
-mysqlcreate database pandora; +</file>
-mysql> use pandora; +
-mysql> source /backup/padnoradb_backup.sql+
  
 +<code sql>
 +CREATE DATABASE pandora;
 +USE pandora;
 +SOURCE /backup/pandoradb_backup.sql;
 +GRANT ALL privileges ON pandora.* TO pandora@localhost IDENTIFIED BY 'mypassword';
 +exit;
 </code> </code>
  
行 265: 行 228:
 最後に、Pandora FMS コンソールとサーバの両方で設定済みのユーザ権限を再度設定し、データベースへのアクセス権を付与します。(''mypassword'' をあなたのパスワードで置き換えてください) 最後に、Pandora FMS コンソールとサーバの両方で設定済みのユーザ権限を再度設定し、データベースへのアクセス権を付与します。(''mypassword'' をあなたのパスワードで置き換えてください)
  
-<code>+<code sql>
 grant all privileges on pandora.* to pandora@localhost identified by 'mypassword'; grant all privileges on pandora.* to pandora@localhost identified by 'mypassword';
  
 </code> </code>
 +
 +<wrap #ks5 />
  
 ===== Pandora FMS のバックアップとリカバリ ===== ===== 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.+There is a script in the Pandora FMS server distribution that is used to make a backup and a complete restore of all Pandora FMS. This script is thought to make copies and restoration in systems // where the server and the console are located in the same machine//.
  
 Pandora FMS サーバの配布パッケージには、Pandora FMS を完全にバックアップおよび復元するのに役立つスクリプトがあります。 このスクリプトは、サーバとコンソールが同じマシン上にあるシステムでのバックアップと復元を目的としています。 Pandora FMS サーバの配布パッケージには、Pandora FMS を完全にバックアップおよび復元するのに役立つスクリプトがあります。 このスクリプトは、サーバとコンソールが同じマシン上にあるシステムでのバックアップと復元を目的としています。
  
-<WRAP center round tip 60%>+It is designed to backup and restore the following components:
  
-If there are several components in your environment, then you should use the tool with the most adequate parameters for its use or modify them so they are tailored to your needs.+次のコンポーネントをバックアップおよび復元するように設計されています。 
 + 
 +  * Server configuration file(s). 
 +  * Files(s) **pending execution**, as well as **remote configuration** files of the agents. 
 +  * **Database**, complete. 
 +  * **Web Console**, complete. 
 + 
 +  * サーバ設定ファイル 
 +  * **実行保留中**のファイルと、エージェントの**リモート設定**ファイル。 
 +  * **データベース**全体 
 +  * **ウェブコンソール**全体 
 + 
 +<WRAP center round tip 90%> 
 + 
 +If there are different components in the environment, you should use the tool with the most appropriate parameters for your use or modify them to suit the circumstances.
  
 </WRAP> </WRAP>
  
-<WRAP center round tip 60%>+<WRAP center round tip 90%>
  
 コンポーネントが複数に分かれた環境の場合は、適切なパラメーターでツールを使用するか、ニーズに合わせてツールを調整する必要があります。 コンポーネントが複数に分かれた環境の場合は、適切なパラメーターでツールを使用するか、ニーズに合わせてツールを調整する必要があります。
行 288: 行 267:
 </WRAP> </WRAP>
  
-This script needs to be executed as **root**. You are the only **responsible** for said key. It is located at:+This script needs to run as **root**. You are the only **responsible** for this key. It is located at:
  
-この処理を実行するには、スクリプトを root 権限で実行する必要があります。スクリプトは以下にあります。+この処理を実行するには、スクリプトを **root** 権限で実行する必要があります。スクリプトは以下にあります。
  
-<code>+<file>
 /usr/share/pandora_server/util/pandora_backup.sh /usr/share/pandora_server/util/pandora_backup.sh
  
-</code>+</file>
  
-If it is executed without parameters, it will show the help menu:+<WRAP center round tip 90%> 
 + 
 +When running it without any parameters, the help menu will be displayed. 
 + 
 +</WRAP> 
 + 
 +<WRAP center round tip 90%>
  
 引数無しで実行すると、ヘルプを表示します。 引数無しで実行すると、ヘルプを表示します。
 +
 +</WRAP>
 +
 +<wrap #ks6 />
 +
  
  
行 327: 行 317:
 #!/bin/bash #!/bin/bash
 sendsms +34458474843 "The Pandora FMS has suffered some issue and it cannot be started." sendsms +34458474843 "The Pandora FMS has suffered some issue and it cannot be started."
-/etc/init.d/tentacle_serverd stop+systemctl stop tentacle_serverd 
  
 </code> </code>
行 364: 行 355:
  
 ==== ヒストリデータベースの設定 ==== ==== ヒストリデータベースの設定 ====
- 
-<WRAP center round info 75%> 
- 
-Version NG 754 and later versions. 
- 
-</WRAP> 
- 
-<WRAP center round info 75%> 
- 
-バージョン NG 754 およびそれ以降 
- 
-</WRAP> 
  
 To configure a historical database, it is necessary to have a new server where to host it (**different from the one of the main database**). Once you have that server where MySQL is installed, follow these steps: To configure a historical database, it is necessary to have a new server where to host it (**different from the one of the main database**). Once you have that server where MySQL is installed, follow these steps:
行 381: 行 360:
 ヒストリデータベースを設定するには、それをホストする新しいサーバが必要です(**メインデータベースのサーバとは異なります**)。MySQL がインストールされているサーバを用意したら、次の手順に従います。 ヒストリデータベースを設定するには、それをホストする新しいサーバが必要です(**メインデータベースのサーバとは異なります**)。MySQL がインストールされているサーバを用意したら、次の手順に従います。
  
-In Pandora FMS console, go to **Setup → Setup → Historical database** to access [[:en:documentation:pandorafms:management_and_operation:12_console_setup#the_history_database|connection configuration]] (**Configure connection target**).+In Pandora FMS console, go to <wrap :en>**Management → Setup → Setup → Historical database**</wrap> to access [[:en:documentation:pandorafms:management_and_operation:12_console_setup#ks1_4|connection configuration]] (<wrap :en>**Configure connection target**</wrap>).
  
-Pandora FMS コンソールで、**セットアップ(Setup)** → **セットアップ(Setup)** → **ヒストリデータベース(Historical database)** へ行き、[[:ja:documentation:pandorafms:management_and_operation:12_console_setup#ヒストリデータベース|接続設定]] (**接続先設定(Configure connection target)**) にアクセスします。+Pandora FMS コンソールで、**管理(Management) → セットアップ(Setup) → セットアップ(Setup) → ヒストリデータベース(Historical database)** へ行き、[[:ja:documentation:pandorafms:management_and_operation:12_console_setup#ヒストリデータベース|接続設定]] (**接続先設定(Configure connection target)**) にアクセスします。
  
 Fill in the following fields: Fill in the following fields:
行 400: 行 379:
   * **データベースユーザ(Database user)**: ヒストリデータベースユーザ。デフォルトは ''pandora'' です。   * **データベースユーザ(Database user)**: ヒストリデータベースユーザ。デフォルトは ''pandora'' です。
   * **データベースパスワード(Dabase password)**: ヒストリデータベースのパスワード。これにより、ヒストリデータベースに接続できるようになります。 次に、カスタムパラメータを入力します(**設定のカスタマイズ**):   * **データベースパスワード(Dabase 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)**  and **Delay betewwn transferences (seconds)**  will define the way in which the data will be sent to the historical database, that is, the oldest data those with more than n //days (Data days)//  will be moved to the history database in blocks of made of n rows (//Step//) waiting n seconds (//Delay//) between one block and the next to avoid overloads. The last fields of this form **Data days old to keep in active database, Transference block size (Step)**  and **Delay betewwn transferences (seconds)**  will define the way in which the data will be sent to the historical database, that is, the oldest data those with more than n //days (Data days)//  will be moved to the history database in blocks of made of n rows (//Step//) waiting n seconds (//Delay//) between one block and the next to avoid overloads.
行 562: 行 539:
  
 以上でバックアップからリストアされ使えるようになります。 以上でバックアップからリストアされ使えるようになります。
 +
 +==== 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 [[:en:documentation:04_using:12_console_setup#history_database_maintenance_options|maintenance of the historical database]].
 +
 +</WRAP>
 +
 +<WRAP center round info 75%>
 +こちらの手順は、バージョン 753 およびそれ以前のバージョンのみを対象としています。バージョン 754 以降、必要なのは前の章で説明した接続値を設定することだけです。Pandora FMS は、インストールプロセス全体と [[:ja:documentation:04_using:12_console_setup#ヒストリデータベースメンテナンスオプション|ヒストリデータベースのメンテナンス]]を処理します。
 +</WRAP>
 +
 +{{:wiki:icono-modulo-enterprise.png?23x23  |Enterprise version}}To configure a historical database, it is necessary to have a new server where to host it (**different from the one of the main database**). Once you have that server where MySQL is installed, follow these steps:
 +
 +{{:wiki:icono-modulo-enterprise.png?23x23  |Enterprise 版}}ヒストリデータベースを設定するには、それを格納する(メインのデータベースとは異なる)新たなサーバが必要です。MySQL をインストールしたサーバを準備したら、以下の手順を実行します。
 +
 +   * Create the new historical database:
 +
 +   * 新たなヒストリデータベースを作成します。
 +
 +<code>
 +[root@pandorafms ~]# mysql -u root -p
 +mysql> create database pandora_history;
 +</code>
 +
 +  * Create Pandora FMS database schema. You may use the script ''/var/www/html/pandora_console/pandoradb.sql''  included in Pandora FMS console, copying it to the historical database server:
 +
 +  * Pandora FMS データベーススキーマを作成します。Pandora FMS コンソールと共に提供されている ''/var/www/html/pandora_console/pandoradb.sql'' が利用できます。それをヒストリデータベースサーバへコピーします。
 +
 +<code bash>
 +cat pandoradb.sql | mysql -u root -p -D pandora_history
 +
 +
 +</code>
 +
 +  * Grant permissions to a user (''user''  and ''password)''  which will be used from the Pandora FMS server and console to send and check historical data:
 +
 +  * ヒストリデータベースにアクセスできるように Pandora FMS サーバとコンソールで利用するユーザのパーミッション(''user'' と ''password'')を設定します。
 +
 +**For MySQL 5.7**
 +
 +**MySQL 5.7 向け:**
 +
 +<code bash>
 +GRANT ALL PRIVILEGES ON pandora_history.* TO 'user'@'%' IDENTIFIED BY 'password';
 +
 +
 +</code>
 +
 +**For MySQL 8:**
 +
 +**MySQL 8 向け:**
 +
 +  * ''$DBROOTPASS'': MySQL 8 **root**  user password.
 +  * ''$DBUSER'': MySQL 8 user name.
 +  * ''$DBPASS'': MySQL 8 user password.
 +  * ''$DBPORT'': Connection port for MySQL 8.
 +  * ''$DBHOST'': IP address or FQDN of the MySQL server 8.
 +  * ''$DBNAME'': Name of the database.
 +
 +  * ''$DBROOTPASS'': MySQL 8 **root** ユーザパスワード。
 +  * ''$DBUSER'': MySQL 8 ユーザ名。
 +  * ''$DBPASS'': MySQL 8 ユーザパスワード。
 +  * ''$DBPORT'': MySQL 8 用接続ポート。
 +  * ''$DBHOST'': MySQL 8 サーバの IP アドレスまたは FQDN。
 +  * ''$DBNAME'': データベース名。
 +
 +To use these environment variables just define them before running //grants// in the terminal, enter the following:
 +
 +これらの環境変数を使用するには、//GRANT// を実行する前に次のようにターミナルで設定するだけです。
 +
 +<code bash>
 +env TZ='Europe/Madrid' \
 + DBHOST='127.0.0.1' \
 + DBNAME='pandora' \
 + DBUSER='pandora' \
 + DBPASS='pandora' \
 + DBPORT='3306' \
 + DBROOTPASS='pandora'
 +
 +</code>
 +
 +Enter in the terminal:
 +
 +ターミナルで以下を実行します:
 +
 +<code bash>
 +systemctl restart mysql
 +
 +</code>
 +
 +Enter in the terminal:
 +
 +ターミナルで以下を実行します:
 +
 +<code bash>
 +
 +export MYSQL_PWD=$DBROOTPASS
 +echo "CREATE USER  \"$DBUSER\"@'%' IDENTIFIED BY \"$DBPASS\";" | mysql -uroot -P$DBPORT -h$DBHOST
 +echo "ALTER USER \"$DBUSER\"@'%' IDENTIFIED WITH mysql_native_password BY \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST
 +echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%'" | mysql -uroot -P$DBPORT -h$DBHOST
 +
 +export MYSQL_PWD=$DBPASS
 +
 +
 +</code>
 +
 +The history database (DB) can contain //all the system data//  (without limit), but if you want to delete data or compact them from the history database, you will need to use specific data in the database that the **pandora_db**  script takes into account when executing from the node.
 +
 +ヒストリデータベース(DB)には//すべてのシステムデータ//(無制限)を含めることができますが、ヒストリデータベースからデータを削除または圧縮する場合は、**pandora_db** スクリプトがノードから実行される際の設定を示すデータベース内の特定のデータを使用する必要があります。
 +
 +<WRAP center round info 60%>
 +
 +Remember that all these steps are only for version 753 and earlier versions.
 +
 +</WRAP>
 +
 +<WRAP center round info 60%>
 +これらの手順はすべて、バージョン 753 以前のバージョンのみを対象としていることに注意してください。
 +</WRAP>
 +
 +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 database. First you need to connect to your database using the command line (CLI) of MySQL.
 +
 +まず、ヒストリデータベースのデータを //tconfig// テーブルに入力します。 この SQL クエリを使用して最小限の設定を作成し、**pandora_db** がヒストリデータベースに対して実行される際の設定をします。 まず、MySQL のコマンドライン(CLI)を使用してデータベースに接続する必要があります。
 +
 +This is an example, replace values according to your criteria (but leave ''history_db_enabled''  at zero):
 +
 +これは例です。値は好みに応じて置き換えます(ただし、''history_db_enabled'' はゼロのままにします)。
 +
 +<code>
 +
 +INSERT INTO `tconfig` VALUES (1,'days_purge','180');
 +INSERT INTO `tconfig` VALUES (2,'history_db_enabled','0');
 +INSERT INTO `tconfig` VALUES (3,'days_compact','120');
 +INSERT INTO `tconfig` VALUES (4,'step_compact','1');
 +INSERT INTO `tconfig` VALUES (5,'event_purge','180');
 +INSERT INTO `tconfig` VALUES (6,'string_purge','180');
 +INSERT INTO `tconfig` VALUES (7,'MR','<actual MR value>');
 +
 +</code>
 +
 +  * Take special care to replace ''< actual MR value >''  with the current MR value that you currently have in the main Pandora FMS server.
 +  * This example is for the history database ito store for 6 months (180 days) from the execution date (''days_purge'').
 +  * Compact data more than 120 days old (''days_compact'').
 +  * 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 (''event_purge''  y ''string_purge'').
 +  * //Use the values that you think convenient//  (except for ''MR''  and ''history_db_enabled''). The limit in the storage of the history database only depends on the free space of the machine. **Just remember that the history database must be in a physical server independent**  from the main database and Pandora FMS.
 +
 +  * ''< actual MR value >'' を、メインの Pandora FMS サーバの現在の MR 値に置き換える場合は特に注意してください。
 +  * この例は、ヒストリデータベースに過去 6ヵ月間(180日)のデータを保存します。(''days_purge'')
 +  * 120日より古いデータを圧縮します。(''days_compact'')
 +  * メインデータベースに最低 1ヵ月分のデータがある場合、前月分がヒストリデータベースになくてもメインデータベースにはデータがあるため、合計 6か月のデータを参照できます。(''event_purge'' および ''string_purge'')
 +  * //各値は任意に変更してください//(''MR'' および ''history_db_enables'' は除く)。ヒストリデータベースのストレージの上限は、マシンの空き容量にのみ依存します。 **ヒストリデータベースは、メインデータベースおよび Pandora FMS から独立した物理サーバ** にある必要があることに注意してください。
 +
 +<WRAP center round tip 75%>
 +
 +In versions prior to Pandora FMS 753 you must execute the script **pandora_db**  in the history server itself using the data specified previously in the database and additionnally create the configuration file as explained below, in order to use the maintenance script as if we were using a normal database.
 +
 +</WRAP>
 +
 +<WRAP center round tip 75%>
 +Pandora FMS 753 以前のバージョンでは、通常のデータベースのように、データベースであらかじめ設定したデータを使用してヒストリデータベースサーバ自体でメンテナンススクリプト **pandora_db** を実行し、さらに以下で説明するように設定ファイルを作成する必要があります。
 +</WRAP>
 +
 +In versions prior to Pandora FMS 753, create an additional ''pandora_server.conf''  file. Use this small version to create your own and name it ''/etc/pandora/pandora_server_history_db.conf''  :
 +
 +Pandora FMS 753 以前のバージョンでは、追加の ''pandora_server.conf'' ファイルを作成します。独自の設定ファイルとして ''/etc/pandora/pandora_server_history_db.conf'' という名前を付けます。
 +
 +<code>
 +dbengine mysql
 +dbname pandora_history
 +dbuser user
 +dbpass password
 +dbhost 192.168.70.140
 +log_file /var/log/pandora/pandora_db_history.log
 +
 +</code>
 +
 +<WRAP center round info 60%>
 +
 +Remember that all these steps are only for version 753 and earlier versions.
 +
 +</WRAP>
 +
 +<WRAP center round info 60%>
 +これらの手順はすべて、バージョン 753 以前のバージョンのみを対象としていることに注意してください。
 +</WRAP>
 +
 +Now you can execute **pandora_db**  tool against the history database configuration and program it for its periodical execution:
 +
 +これで、ヒストリデータベースに対して **pandora_db** ツールを実行できるようになり、定期的に実行するように設定できます。
 +
 +<code>
 +/usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server_history_db.conf
 +
 +</code>
 +
 +<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>
 +
 +<WRAP center round tip 60%>この処理は、別のサーバの別のデータベースに対して実行されるため、メインのデータベースには影響を与えません。</WRAP>
  
  • ja/documentation/pandorafms/installation/06_server_management.1715500545.txt.gz
  • 最終更新: 2024/05/12 07:55
  • by junichi