Page 1 of 1
Nagios config file export and import
Posted: Mon Sep 14, 2020 1:31 am
by mansonli
In order to export all config files, should export them by clicking write configs option in config file management instructed in
https://assets.nagios.com/downloads/nag ... tabase.pdf? Need to manually download them at /usr/local/nagios/etc/* so that they can be imported to another nagios XI host to import for testing purposes?
Re: Nagios config file export and import
Posted: Mon Sep 14, 2020 3:32 pm
by benjaminsmith
Hi,
That's correct. All of the configuration files are in
/usr/local/nagios/etc/. They will need to be imported in the correct order., go to CCM > Tools > Import Configs for details. However, the backup and restore scripts are going to make this much easier. The process is explained in the following guide:
Backing Up And Restoring Your Nagios XI System
Let us know if you have further questions.
Benjamin
Re: Nagios config file export and import
Posted: Tue Sep 15, 2020 5:07 am
by mansonli
If mysql server hosting nagiosxi database is a remote server, should change /usr/local/nagiosxi/var/xi-sys.cfg to supply current username and password to connect to remote mysql server when trying to use a backup archive created from another nagios XI server? There's 1 x production nagios server + 1 x mysql server and 1 x non-prod/testing nagios server + 1 x non-prod mysql server. Local backup archive is created from production nagios server and restore it to non-prod/testing nagios server.
Is the restore must be started from /usr/local/nagiosxi/scripts/restore_xi.sh </full/path/to/backupfile.tar.gz>? Can it be done in admin web interface?
Re: Nagios config file export and import
Posted: Tue Sep 15, 2020 3:32 pm
by benjaminsmith
HI,
Is the restore must be started from /usr/local/nagiosxi/scripts/restore_xi.sh </full/path/to/backupfile.tar.gz>? Can it be done in admin web interface?
While you can backup from the GUI, the restore script is currently run from the command line. For example,
Code: Select all
/usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/1279411912.tar.gz
The script is going to restore using the current offloaded database settings found in the backup archive. So if you would like to change those settings before running the restore, please take a look the
Offloading MySQL to Remote Server to update the settings before running the script.
If you have offloaded your databases to an external MySQL server using our offload procedure:
• The restore script will restore the databases to the offloaded MySQL server as it gathers this information
from the backup file
• In the event that your MySQL server also died, you will need to create a duplicate MySQL server for the
restore script to succeed, as it wants to restore to the server defined in the backup file
◦ Simply follow our the offload procedure to setup the offloaded server with the same IP address,
usernames and passwords
◦ If you don't know these passwords, you can recover these by:
▪ Extract the backup .tar.gz file
▪ In the extracted files you will need to extract the nagiosxi.tar.gz file
▪ In those extracted files locate usr/local/nagiosxi/var/xi-sys.cfg and this file will contain
the usernames and passwords
Re: Nagios config file export and import
Posted: Wed Sep 16, 2020 12:52 am
by mansonli
As the version of nagios XI where backup was created (source) is 5.4.13, is the nagios version where backup will be restored to (destination) must be the same? Currently nagios version of destination is 5.4.8.
Re: Nagios config file export and import
Posted: Wed Sep 16, 2020 2:35 pm
by benjaminsmith
Hi,
That's right, the versions will need to be the same. Are you able to upgrade the destination to 5.4.13? You can download previous versions of Nagios XI from the following page.
https://assets.nagios.com/downloads/nag ... rsions.php
Then run a manual upgrade as instructed in the following guide.
Upgrading Nagios XI