====== バックアップおよびリストア手順 ======
{{indexmenu_n>7}}
[[ja:documentation:pandorafms:start|Pandora FMS ドキュメント一覧に戻る]]
===== バックアップ手順 =====
[[#ks1_1|Main database backup]].
[[#ks1_2|Directory and file backup]].
[[#ks2|Recovery and reinstallation from a performed backup]].
[[#ks1_1|メインデータベースバックアップ]]
[[#ks1_2|ディレクトリとファイルバックアップ]]
[[#ks2|バックアップからのリカバリと再インストール]]
==== データベースバックアップ ====
First, a backup of the existing database needs to be performed.
最初に、データベースをバックアップする必要があります。
If you use a history database, you must also perform a backup of it.
ヒストリデータベースを利用している場合は、そのバックアップも実行します。
=== 手動データベースバックアップ ===
First, open a terminal window with the appropriate user credentials. Enter the following commands (provide the database access credentials):
適切な権限のユーザでターミナルウィンドウを開き、次のコマンドを入力します(データベースのアクセス情報を入力します):
mysqldump -u -p | gzip > pandoradb.sql.gz
This will create a compressed logical backup of the entire Pandora FMS database ''''.
これにより、Pandora FMSデータベース全体 '''' の圧縮された論理バックアップが作成されます。
=== Pandora FMS データベースバックアップユーティリティ ===
Pandora FMS allows for a [[:en:documentation:pandorafms:monitoring:17_discovery_2#ks2_1|database backup periodically]] that can be scheduled in the left side menu, Management → Discovery → New console task and selecting from the drop-down list the option Backup Pandora FMS database:
Pandora FMS では、**自動検出(Discovery) > 新しいコンソールタスク(New console task)** から、ドロップダウンで **"Pandora FMS データベースのバックアップ(Backup Pandora FMS database)"** を選択することにより、[[:ja:documentation:pandorafms:monitoring:17_discovery_2#ks2_1|定期的なデータベースのバックアップ]] を設定できます。
{{ :wiki:pfms-create-new-console-task-backup-db-2.png }}
To create a new database backup:
新規データベースバックアップの作成には次のようにします。
Scheduled: Select the frequency with which the backup task will run: daily ''Daily'', hourly ''Hourly'', monthly ''Monthly'', without any periodicity ''Not scheduled'', weekly ''Weekly'', or yearly ''Yearly''.
スケジュール(Scheduled): バックアップ タスクを実行する頻度を選択します。毎日 ''Daily''、毎時 ''hourly''、毎月 ''Monthly''、スケジュールなし ''Not scheduled''、毎週 ''Weekly''、または毎年 ''Yearly''。
Next execution: Select exactly when the backup task will start (first choose the day and then the time); from then on it will be done periodically unless you have chosen the ''Not scheduled'' option in the previous point.
次の実行(Next execution): バックアップタスクの開始日時を正確に選択します (まず日付を選択し、次に時刻を選択します)。その後は、前の項目で「スケジュールなし」(''Not scheduled'') オプションを選択しない限り、定期的に実行されます。
Group: Group to which the backup task will belong (or select ''All'' for all groups).
グループ(Group): バックアップタスクが属するグループ(または、すべてのグループを選択する場合は「すべて」(''All'')を選択します)。
In Parameters there are two elements that are important to take into account:
パラメータ(Parameters)には、考慮すべき重要な要素が2つあります。
Save to disk in path: By default, it is stored in ''/var/www/html/pandora_console/attachment/backups'' //but you can specify any directory in which you have read and write permissions// (you must know the exact path since it only has a simple text box for it).
次のパスに保存(Save to disk in path): デフォルトでは、''/var/www/html/pandora_console/attachment/backups'' に保存されます。//ただし、読み取りと書き込みの権限がある任意のディレクトリを指定できます// (パスを指定するには単純なテキストボックスしかないため、正確なパスを知っている必要があります)。
Active backups: To save storage space, by default, the last three backups performed will be kept.
アクティブバックアップ(Active backups): ストレージ容量を節約するため、デフォルトでは、最後に実行された 3 つのバックアップが保持されます。
Once you have finished filling out the fields, click the Create button to save.
入力項目をすべて入力したら、作成(Create)ボタンをクリックして保存してください。
Through the Pandora FMS database backup manager (menu Management → Setup → Admin tools → DB Backup Manager), you will be able to download the backups performed, restore said backups, or simply delete them. //In the event that backups have been deleted, for one reason or another, without using the Web Console for it//, the corresponding item will mark a "lost" state (Status Lost) and the Delete Lost button can be used to permanently delete all backups in that specific state.
Pandora FMS データベースバックアップマネージャ (メニュー 管理(Management) → セットアップ(Setup) → 管理ツール(Admin tools) → DB バックアップマネージャ(DB Backup Manager)) を使用すると、実行されたバックアップをダウンロードしたり、バックアップを復元したり、単に削除したりできます。//Web コンソールを使用せずに、何らかの理由でバックアップが削除された場合//、該当する項目は「紛失(lost)」状態 (ステータス紛失(Status Lost)) になり、紛失を削除(Delete Lost) ボタンを使用して、その特定の状態のすべてのバックアップを完全に削除できます。
==== 設定ファイルバックアップ ====
First, open a terminal window with the appropriate user credentials. The code shown in this topic uses the ''root'' user; otherwise, prepend the ''sudo'' command to each execution line. To backup Pandora FMS agents and server configuration files:
まず、適切なユーザ認証情報を使用してターミナルウィンドウを開きます。このトピックで示されているコードは ''root'' ユーザを使用しています。そうでない場合は、各実行行の前に ''sudo'' コマンドを追加してください。Pandora FMS エージェントとサーバ設定ファイルをバックアップするには以下を実行します。
tar -pcvzf pandora_configuration.tar.gz /etc/pandora/*.conf
==== エージェントバックアップ ====
You also need to back up the Agent file. It is very important to keep the already deployed collections and Agent //plugins//.
エージェントファイルのバックアップも必要です。既にデプロイされているコレクションとエージェント//プラグイン//を保持しておくことは非常に重要です。
tar -pcvzf agent.tar.gz /usr/share/pandora_agent
==== サーババックアップ ====
=== サーバブラグイン ===
The default file for server //plugins// is in ''/usr/share/pandora_server'' (the main directory for the Pandora FMS Servers).
サーバの //plugins// のデフォルトファイルは ''/usr/share/pandora_server'' (Pandora FMS サーバ のメインディレクトリ) にあります。
tar -pcvzf pandora_server.tar.gz /usr/share/pandora_server
If you have server //plugins// located in other directories, you should back them up as well.
サーバの //plugins// が他のディレクトリにある場合は、それらもバックアップする必要があります。
tar -pcvzf my_plugin_folder.tar.gz /home/my_user/my_plugin_folder
=== リモート設定 ===
A backup of remote configuration files and collections must be executed to maintain the correct behavior of the remote Agent.
リモートエージェントの正常な動作を維持するためには、リモート設定ファイルとコレクションのバックアップを実行する必要があります。
tar -pcvzf collections.tar.gz /var/spool/pandora/data_in/collections
tar -pcvzf md5.tar.gz /var/spool/pandora/data_in/md5
tar -pcvzf remote_agents_conf.tar.gz /var/spool/pandora/data_in/conf
==== コンソールバックアップ ====
Finally, run a backup of the PFMS Web Console. This way, custom images, extensions, etc., can be preserved.
最後に、PFMS Web コンソールのバックアップを実行します。これにより、カスタムイメージや拡張機能などを保持できます。
tar -pcvzf pandora_console.tar.gz /var/www/html/pandora_console
===== リストア手順 =====
Perform the [[:en:documentation:pandorafms:installation:01_installing|installation procedure]].
[[:ja:documentation:pandorafms:installation:01_installing|インストール]] 手順を実施します。
==== データベースリストア ====
If you use a history database, you must perform a recovery of it as well.
ヒストリデータベースを使用している場合は、そのデータベースの復旧も実行する必要があります。
=== 手動リストア ===
Make sure your database is up and running, and that the Pandora FMS Server and the local EndPoint are stopped.
データベースが起動して動作していること、および Pandora FMS サーバ とローカルエンドポイントが停止していることを確認してください。
systemctl start mysqld
Starting mysqld: [ OK ]
systemctl stop pandora_server
Stopping Pandora FMS Server
systemctl stop pandora_agent_daemon
Stopping Pandora Agent.
From version NG 754 onwards, [[:en:documentation:pandorafms:installation:06_server_management#ks1|additional options for manual start and stop]] of High Availability (HA) environments are available.
バージョン NG 754 以降では、高可用性(HA)環境の[[:ja:documentation:pandorafms:installation:06_server_management#ks1|手動起動および停止のための追加オプションがあります。]]
Decompress and import the database.
データベースを解凍してインポートします。
The database name ('''') must be the same as the one the //backup// was made from.
データベース名('''')は、//バックアップ// が作成されたデータベース名と同じである必要があります。
gunzip pandora.sql.gz
cat pandora.sql | mysql -u root -p
Additionally, recovery can be performed in the following way:
さらに、復旧は以下の方法でも行うことができます。
mysql -u root -p
The database name ('''') must be the same as the one the //backup// was made from.
データベース名('''')は、//バックアップ// が作成されたデータベース名と同じである必要があります。
create database ;
use ;
source PATH_BACKUP;
==== 設定ファイルリストア ====
First, recover the configuration files for the Agents and servers:
最初に、エージェントおよびサーバ設定ファイルをリストアします。
tar -zxvf pandora_configuration.tar.gz -C /
==== エージェントリストア ====
Now, perform the recovery of the EndPoint directory:
エンドポイントディレクトリのリストアを実行します。
tar -zxvf agent.tar.gz -C /
==== サーバリストア ====
=== サーバプラグイン ===
Restore the main Pandora FMS server file:
メインの Pandora FMS サーバファイルを復元します。
tar -zxvf pandora_server.tar.gz -C /
And restore any other custom //plugin// files you may have:
また、お持ちのその他のカスタム //プラグイン// ファイルもすべて復元します。
tar -zxvf my_plugin_folder.tar.gz -C /
=== リモート設定 ===
Restoring remote configuration files and collections must be performed to maintain the correct operation of the remote Agent.
リモートエージェントの正常な動作を維持するためには、リモート設定ファイルとコレクションの復元を実行する必要があります。
tar -zxvf collections.tar.gz -C /
tar -zxvf md5.tar.gz -C /
tar -zxvf remote_agents_conf.tar.gz -C /
==== コンソールリストア ====
Now run a Console recovery to restore custom images, extensions, etc.
次に、コンソールリカバリを実行して、カスタムイメージや拡張機能などを復元します。
tar -zxvf pandora_console.tar.gz -C /
==== Pandora FMS サーバおよびエンドポイントの起動 ====
The last step is to start the Pandora FMS server and the EndPoint:
最後に、Pandora FMS サーバとエンドポイントを起動します。
systemctl start pandora_server
systemctl start pandora_agent_daemon
[[ja:documentation:pandorafms:start|Pandora FMS ドキュメント一覧に戻る]]