Welcome to docs.opsview.com

Migrating from Nagios® Core to Opsview

There are two methods for migration from Nagios Core to Opsview

  • A full migration where all monitoring is moved into an Opsview system and the Nagios Core server can be decommissioned.
  • A partial migration where the existing Nagios Core server is configured to send all of its result back to an Opsview server. The Nagios Core server remains in use.

Planning your full migration

Overview

We recommend that you provision an Opsview system for the purpose of testing your migration.

Migration checklist:

  1. Check that Opsview is supported on your target platform
  2. Test existing Nagios plugins and copy to Opsview system
  3. Configure required service checks in Opsview
  4. Create Host Templates corresponding to required hardware, operating system and application checks
  5. Create required contacts for Opsview system access and notifications
  6. Confirm that the Opsview migration tool imports your host information correctly
  7. Test whether your Nagios add ons work as expected
  8. Confirm that your existing Nagios agents work correctly
  9. Confirm that SNMP monitoring continues to work correctly

Plugins

Any Nagios plugins used by your existing system should continue to work with Opsview. If you have developed any plugins yourself we recommend that you review the Nagios Plugins developer guidelines.

Plugin Guidelines:

  • Use the plugins supplied with Opsview if there are any duplicates
  • Confirm that your plugins accept the '-h' argument to display help information
  • Confirm that your plugins return performance data if you require performance graphs
  • If you are using third-party supplied plugins we recommend that you upgrade to the latest version

Copy any custom plugins into /usr/local/nagios/libexec on the Opsview server.

Nagios add-ons

We cannot guarantee that Nagios addons will work with Opsview. Our recommendation is that you setup a test Opsview system to confirm correct operation.

Opsview includes some common addons such as MRTG and Nagvis. We strongly recommend that you use the version supplied with Opsview rather than your own.

Nagios Agents

You can use your existing Nagios agents with Opsview so there is no need to update software on your existing monitored hosts. We recommend you follow these guidelines:

  • Opsview has been tested with NRPE, NRPE_NT and NSClient++, you should ask on our forums if you're using another technology
  • Configuration of the Service Checks supplied with Opsview may require changing for use with your own agents
  • Review the Nagios Plugin guidelines above for the Nagios plugins that you are using with your agent.

SNMP

Plugins that use the SNMP protocol should continue to work with Opsview. Guidelines:

  • Confirm access control for your SNMP agent allows queries from your Opsview server's network address
  • Configure SNMP parameters against each Opsview host and then use Macros with your Service Checks

Notification

Your existing Email, Pager and SMS notification facilities should work with Opsview. If you are using another notification method it may be necessary to modify your configuration and notification scripts.

Using the Migration Tool

Compatibility

This tool is compatible with Nagios Core 3

Capabilities

This tool is capable of migrating the following configuration items:

  • Time periods
    • Only weekly definitions
  • Contacts
  • Hosts
    • Parents will be associated. Contact groups will not be imported. Every host will be given the Network - Base host template
  • Host groups
  • Services
    • Only active checks will be imported. Service checks will be put into a service group called “Imported”

Preparation

Copy your Nagios Core configuration to the Opsview server

The migration tool reads the Nagios Core object file which are used by the Nagios Core CGIs. This file is called object.cache, or objects.dat in older versions of Nagios Core. The file is usually located in /usr/local/nagios/var.

Transfer this file to your Opsview server.

Running the migration tool

The migration tool is located within the /usr/local/nagios/installer directory on the Opsview master server. We recommend you take a backup of your existing Opsview configuration database before running the migration tool.

su - nagios
/usr/local/nagios/bin/db_opsview db_backup > /tmp/opsview.db
/usr/local/nagios/installer/migrate_nagios {path to objects.cache file}

This will output information about what changes it has made. Check the output for any warnings.

The tool can be run multiple times without making multiple entries of the same information within Opsview.

Post-migration

  • Review warnings raised in the output
  • Review the hosts that have been imported - check host groups as Opsview only allows a host in a single host group
  • Review the service checks that have been imported. Can move the service checks into appropriate service groups
  • Review the contacts imported - set permissions based on host group and service group and the appropriate notification options
  • Review contact groups - set permissions based on host groups and service groups
  • Do a reload and start monitoring!

Support

We are always looking to enhance our migration tools, but the migration tools heavily depend on the initial Nagios Core configuration.

If it has not imported data as you expect, please contact us on the mailing lists with the version of Opsview, your objects.cache file and what the issue is.

Troubleshooting

Error messages during migration

These error messages will stop the migration process.

Unrecognised method=notify-by-carrier-pigeon

A notification method has been defined that Opsview doesn't recognise. You can should remove these from the object.cache file for the particular contact to continue.

Inconsistent check_interval, retry_check_interval or max_check_attempts

Opsview uses common check interval, retry_check_interval and max_check_attempts for services with the same name. The migration tool will fail if these attributes for a service does not match the service check's definition.

You can either:

  • change the objects.cache file to match the database information
  • update the service check definition in Opsview
  • rename the service description to a different name, thus creating a different service check definition

Warning messages during migration

These warning messages could appear in the migration output.

Changed service description ....

Opsview has reserved some characters from being used in a service description. This warning just tells you that the name has been changed.

Inconsistent check_period

Opsview uses common check periods for services with the same name. The migration tool will fail if the check_interval specified for a service does not match the service's check interval definition.

Opsview has a feature where if the service has no check_period set, it will inherit from the host's check_period - this could account for the discrepency.

Inconsistent notification options

Opsview uses common notification options for services with the same name. The migration tool will flag any services that have the same name but the notification options do not match.

Opsview has a feature where if the host has no notifications set, then the service will also not have any notification options - this could account for the discrepancy.

Planning your partial migration

This functionality is available from Opsview 3.11.0.

Overview

For those instances where Nagios Core monitoring cannot be moved to Opsview easily and quickly, the Nagios Core server can configured as a passive slave in Opsview.

The Nagios Core server then uses NSCA functionality to send all the results back into Opsview over a secure channel so Opsview can then perform all the necessary alerting and reporting until such time that the Nagios Core server can be fully migrated.

This form of passive slave must be carefully considered to ensure there are no host name clashes with hosts that have already been configured in Opsview.

Initial Configuration

Opsview configuration

  • The opsview server needs to have ssh access to the Nagios Core server as user nagios
  • Create the Nagios Core server as a normal host in Opsview
  • Create a new monitoring server (Menu ⇒ Advanced ⇒ Actions ⇒ Create new Monitoring Server), set the Nagios Core server as the 'Cluster Node' and tick the 'Passive' checkbox, then 'Submit'
  • Run send2slaves -t to test the configuration
  • Do a reload.

At this point the slave will be generating errors such as “SLAVE CRITICAL - Error retrieving slave information - slave is likely to be down” in Opsview.

Nagios Core server configuration

  • As the nagios user ensure the following directories exist under /usr/local/nagios
    • bin
    • etc
    • var
  • Install send_nsca (might be part of the 'nsca' package on your platform)
  • Copy the send_nsca binary (can be in /usr/sbin/) to /usr/local/nagios/bin
  • Copy /usr/local/nagios/etc/send_nsca.cfg from the Opsview server to the Nagios Core server into the same place
  • Copy /usr/local/nagios/bin/process-cache-data and retrieve_opsview_info from the Opsview server to the Nagios Core server into the same place
  • Symlinks the nagios status'dat file to /usr/local/nagios/var
  • Create and make executable /usr/local/nagios/bin/process-cache-data.sh containing
#!/bin/bash
/usr/local/nagios/bin/process-cache-data $@

A this point the following changes need to be made to the nagios configuration and nagios restarted.

  • Add the following configuration to commands.cfg or other suitable configuration file
define command {
        command_name   process-host-perfdata-file
        command_line   /usr/local/nagios/bin/process-cache-data.sh cache_host
}

define command {
        command_name   process-service-perfdata-file
        command_line   /usr/local/nagios/bin/process-cache-data.sh cache_service
e
}
  • Amend the nagios.cfg file to add or replace the following configuration
process_performance_data=1
host_perfdata_file=/usr/local/nagios/var/cache_host.log
service_perfdata_file=/usr/local/nagios/var/cache_service.log
host_perfdata_file_template=$HOSTNAME$\t$HOSTSTATE$\t$HOSTOUTPUT$|$HOSTPERFDATA$
service_perfdata_file_template=$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEOUTPUT$|$SERVICEPERFDATA$
host_perfdata_file_mode=a
service_perfdata_file_mode=a
host_perfdata_file_processing_interval=5
service_perfdata_file_processing_interval=5
host_perfdata_file_processing_command=process-host-perfdata-file
service_perfdata_file_processing_command=process-service-perfdata-file
  • Reload Nagios Core

At this point results should be passed up to Opsview from the Nagios Core server. Look at the Opsview server log file /usr/local/nagios/var/nagios.log for entries such as the following:

[TIMESTAMP] Warning:  Passive check result was received for host 'HOSTNAME', but the host could not be found!
[TIMESTAMP] Warning:  Passive check result was received for service 'SERVICE' on host 'HOSTNAME', but the host could not be found!

Using the Partial Migration Tool

A tool has been provided on the master server as /usr/local/nagios/utils/list_unknown_devices which would output a report similar to the following:

Host 'gateway' missing
Host 'localhost' missing service 'Current Load'
Host 'localhost' missing service 'Current Users'
Host 'localhost' missing service 'Disk Space'
Host 'localhost' missing service 'HTTP'
Host 'localhost' missing service 'SSH'
Host 'localhost' missing service 'Total Processes'

These hosts and services should be created by hand with appropriate host templates assigned. It works by parsing the current nagios.log file searching for 'host could not be found' and 'service could not be found' errors.

Care should be taken to ensure hosts are assigned to the correct passive slave and that there isn't already a host with the same name in the Opsview configuration.

Troubleshooting

Navigation
Print/export
Toolbox