In this section, we offer step-by-step instructions providing you with specific guidance to successfully migrate Opsview Monitor to a different hardware platform. As such, you will effectively have two different instances of Opsview Monitor, each with their own data stores.
If you have a distributed environment then you should disable slave devices on the old Opsview Monitor installation since there will be contention between the master servers.
Also, If you are migrating to a new architecture, you should read through these steps in this document as it will guide you through how you should export your data.
You do not need the same version of Opsview Monitor on the new hardware platform; however, be sure to read these upgrade instructions carefully. You cannot downgrade your new server. We assume that you have a new installation of Opsview Monitor on your new server; see Installing Opsview Monitor for more information.
Please note, there will be an outage to the Opsview Monitor service during the migration.
In this section, we provide for your reference a few considerations that are beyond the scope of this document, yet should be reviewed prior to committing to migrating to new hardware.
If you have set up security on your Nagios(R) Remote Plugin Executor (NRPE) agents by limiting the IP address of the servers permitted to interrogate them, then do not forget to include the new server's IP address.
If you limit Simple Network Management Protocol (SNMP) communication from a specific IP address, then ensure that your devices have been updated to allow the new server to receive communication. Likewise, if you send SNMP traps to the Opsview Monitor master, ensure the traps are redirected to the new server. To do this, simply edit the nsc.ini file on Windows or nrpe.cfg on Linux and change the 'allowed hosts' directive to include the IP address of the Opsview Monitor master server.
If you have setup a firewall for web access to the Opsview Monitor master, this will need to be updated to allow access to the new Opsview Monitor master's IP address.
You will need to install Opsview Monitor on your new hardware (server); see section Installing Opsview Monitor for step-by-step instructions.
You should migrate any configuration files that you may have customized to your new server, such as those listed here.
- /usr/local/nagios/etc/opsview.conf (Ensure it is pointing to the correct database)
- /usr/local/nagios/etc/sw/* (directory with all files within)
- Apache configuration files
You should transfer any additional plugins or custom scripts (event handlers or notification scripts) from the old server to the new one, ensuring file ownership and permissions are preserved.
To stop Opsview Monitor on the old and the new server, run the commands as shown in the example below:
/opt/opsview/watchdog/bin/opsview-monit stop opsview-web /opt/opsview/watchdog/bin/opsview-monit stop opsview
If you want to keep the old Nagios® Core log files (which are used for the Nagios® Core availability reports), move all files contained within the /usr/local/nagios/var/archives directory to the new server. Additionally, you will need to move the /usr/local/nagios/var/nagios.log file into the same area bearing in mind the naming convention used.
If you wish to keep existing status data, including downtimes, acknowledgements and Nagios® comments, you will need to copy the file /usr/local/nagios/var/retention.dat to the new server.
You should migrate your existing database to the new server. However, initially you should follow the backup and restore guide in section Databases on a different server.
Next you should ensure that database permissions are correctly defined by running the command, as shown below, as MySQL root on the new Opsview Monitor server.
/usr/local/nagios/bin/db_mysql -u root -p<PASSWORD>
Finally, upgrade the database on the new server, using the commands shown below:
su - nagios /usr/local/nagios/installer/upgradedb.pl
In a distributed environment, run the command (as shown below) to test communications from the new master server to the Slave Nodes and correct any errors.
You should also run the command (as shown below) to ensure slaves are updated with the latest code.
Finally, to start Opsview Monitor on your new hardware, run the commands:
/usr/local/nagios/bin/rc.opsview gen_config /opt/opsview/watchdog/bin/opsview-monit start opsview-web