Welcome to docs.opsview.com

Migrating Opsview to Different Hardware

This document is for migrating Opsview from one hardware to another. You will effectively have two different instances of Opsview, each with their own data stores.

Note: If you have a distributed environment, you should disable slaves on the old Opsview, otherwise there will be contention between the two masters.

Note: If you are changing architectures as part of the migration, read through these instructions first as some steps require exporting of data to an architecture independent format (mysql and RRDs in particular).

It is not necessary to have the same version of Opsview on the new server - however, ensure you check the upgrade notes. Note, you cannot go backwards in versions on the new server. These instructions assume you have a new install of Opsview on the new server.

There will be an outage to Opsview during the migration.

Warnings

Some things to consider when changing your Opsview master that are outside the scope of this document.

Opsview Agents / NRPE

If you have set up security on your NRPE agents by limiting the IP address of the servers allowed to interrogate them, don't forget to add in the new servers IP address.

SNMP

If you limit SNMP communication from a specific IP address, ensure devices have been updated to allow the new server

If you send SNMP traps to the Opsview master, ensure these are redirected to the new server

Firewalls

If you have setup firewalls for web access, these will need to be updated.

Build the new Opsview master

Install Opsview on the new server.

Migrate configuration files

Migrate any configuration files you may have customised:

  • /usr/local/nagios/etc/opsview.conf (Ensure it is pointing to the correct database)
  • /usr/local/nagios/etc/map.local
  • /usr/local/nagios/etc/sw.key
  • /usr/local/nagios/etc/sw/* (directory with all files within)
  • /usr/local/opsview-web/opsview_web_local.yml
  • /usr/local/nagios/share/stylesheets/custom.css
  • Apache configuration files

Migrate any custom plugins

Transfer any extra plugins or custom scripts (event handlers or notification scripts) from the old server to the new one.

Stop Opsview

On the old and the new server:

/etc/init.d/opsview stop
/etc/init.d/opsview-web stop

Migrate the NagiosĀ® Core logs

If you want the old Nagios Core log files, which are used for the Nagios Core availability reports, move all files within the /usr/local/nagios/var/archives directory to the new server, and also move /usr/local/nagios/var/nagios.log into the same area, taking into account the naming convention

Migrate Existing Status Data Including Downtimes and Acknowledgements

If you want to keep the existing status data, including downtimes, acknowledgements and Nagios comments, copy the file /usr/local/nagios/var/retention.dat to the new server.

Migrate Nagvis and RRD data (MRTG, NMIS and Opsview performance graphs)

Migrate the following directories if you want to retain history:

  • Nagvis - /usr/local/nagios/nagvis/etc
  • MRTG - /usr/local/nagios/var/mrtg
  • NMIS - /usr/local/nagios/nmis/database and /usr/local/nagios/nmis/var
  • Opsview performance graphs - /usr/local/nagios/var/rrd

Note: If you are migrating across architectures, RRD files (from MRTG, NMIS and Opsview performance data) need to be exported and imported instead of copied. There is a script at /usr/local/nagios/installer/rrd_converter which can be used. Make sure there is enough space in /usr/local/nagios/var and /usr/local/nagios/nmis/database as it will make a copy of all your RRD files. Run it with rrd_converter export and it will create a tarball in /tmp. Run with rrd_converter import on the target system to import all those RRD files.

Migrate Databases

Migrate the databases from the old server to the new server - see the Backup databases and Restore databases instructions in the database migration document

Ensure database permissions are correct by running db_mysql as mysql root on the new server, for example

/usr/local/nagios/bin/db_mysql -u root -p<password>

Upgrade the databases on the new server:

su - nagios
/usr/local/nagios/installer/upgradedb.pl

Update Slaves

In a distributed environment, run send2slaves -t and correct any errors.

Run send2slaves to update slaves with the latest code.

Start Opsview

Start Opsview on the new server:

/usr/local/nagios/bin/rc.opsview gen_config
/etc/init.d/opsview-web start
Navigation
Print/export
Toolbox