Need Help Configuring Nagios?

Our tech support team is happy to help you with any questions you might have. Contact us on our online support forum at https://support.nagios.com/forum/

Nagios XI Makes Monitoring Easier:

Nagios XI is the easy-to-use, enterprise version of Nagios that features:

  • Web-Based Configuration provides advanced configuration features
  • Monitoring Wizards make it easy to monitor new devices, applications, and services
  • Customizable Dashboards allow for per-user customization
  • Integrated Performance Graphs provide trending and capacity planning information
  • Advanced Reports provide data insight and exporting capabilities
  • Data Visualizations enable powerful analysis of patterns and problems
  • Nagios Core Import functionality makes it easy to migrate from Nagios Core
  • ... and many other features

Download a free 60-day trial of Nagios XI or give the online demo a spin.

Inquire today and let our Quickstart team help you get started with Nagios XI

Up ToUp To: Contents
See Also See Also: Quickstart Installation Guide

Upgrading From Previous Nagios Core 3 or 4 Releases

As newer alpha, beta, and stable releases of Nagios Core are released, you should strongly consider upgrading as soon as possible. Newer Nagios Core 4 and other releases usually contain critical bug fixes, so its important to stay up to date. Assuming you've already installed Nagios Core from source code as described in the quickstart guide, you can install newer versions of Nagios Core easily. You don't even need root access to do it, as everything that needed to be done as root was done during the initial install.

Here's the process for upgrading Nagios Core 4

Make sure you have a good backup of your existing Nagios Core installation and configuration files. If anything goes wrong or doesn't work, this will allow you to rollback to your old version.

Become the nagios user. Debian/Ubuntu users should use sudo -s nagios.

su -l nagios

Removed the following old HTML files that were used by the web frontend. They have been replaced by PHP equivalents.

rm /usr/local/nagios/share/{main,side,index}.html

Download the source code tarball of the latest version of Nagios Core (visit https://www.nagios.org/download/ for the link to the latest version).

wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-x.y.z.tar.gz

Extract the Nagios Core source code tarball.

tar xzf nagios-x.y.z.tar.gz
cd nagios-x.y.z

Run the Nagios Core configure script, passing the name of the group used to control external command file permissions like so:

./configure --with-command-group=nagcmd

Compile the Nagios Core source code.

make all

Install updated binaries, documentation, and web web interface. Your existing configuration files will not be overwritten by this step.

make install

Verify your configuration files. Correct any errors shown here before proceeding with the next step.

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Restart Nagios Core. Debian/Ubuntu users should use /etc/init.d/nagios restart.

/sbin/service nagios restart

Important: If you are upgrading from version 4.2.4 or before, to version 4.3.0 or after, there are changes that need to be made to the 'nagios.conf' apache configuration file. You can either update it manually, copying the new parts from 'sample-config/httpd.conf' or run

cd /etc/httpd/conf.d
cp nagios.conf nagios.conf.bak
cd /<the nagios build directory>
make install-webconf
service httpd restart

Important: If you are upgrading from version 4.3.3 or before, to version 4.3.4 or after, there are changes that need to made to the initialization script, and to your main Nagios configuration file. You should be able to simply run make install-init to update your init file - depending on if you've made any customizations. For your configuration file, you'll need to update the lock_file directive to point to the new one in use by the initialization file. First, let's update our init file:

make install-init

If you don't know where your initialization script lives, you can find out the value of your new lock file with the following command:

INITFILE=$(grep ^INIT_DIR= Makefile | sed 's/.*=//' | sed 's/.*/&\/nagios/') && grep ^NagiosRunFile $INITFILE

If you do know where your init script lives, you can find the value of your lock file with the following command:

grep ^NagiosRunFile INITFILE

Now that you have the value of the lock file, find the part of your nagios.cfg file that has the lock_file directive, and update it with your new value:

lock_file=[NEW_LOCK_FILE_LOCATION]

That's it - you're done!

Upgrading From Packages to a Source Code Installation

If you currently have an RPM- or Debian/Ubuntu APT package-based installation of Nagios Core and you would like to transition to installing Nagios Core from the official source code distribution, here's the basic process you should follow:

  1. Stop Nagios Core
  2. Backup your existing Nagios Core installation
    • Configuration files
      • Main config file (usually nagios.cfg)
      • Resource config file (usually resource.cfg)
      • CGI config file (usually cgi.cfg)
      • All your object definition files
    • Retention file (usually retention.dat)
    • Current Nagios Core log file (usually nagios.log)
    • Archived Nagios Core log files
  3. Uninstall the original RPM or APT package
  4. Install Nagios Core from source by following the quickstart guide
  5. Restore your original Nagios Core configuration files, retention file, and log files
  6. Verify your configuration and start Nagios Core

Note that different RPMs or APT packages may install Nagios Core in different ways and in different locations. Make sure you've backed up all your critical Nagios Core files before removing the original RPM or APT package, so you can revert back if you encounter problems.

Upgrading a Packaged Installation

Package-based installations of Nagios Core can be upgraded using the normal package management tools for your system. Note that the latest version available from repositories for a system may be considerably older than the latest Nagios Core source release.

Most packages will keep existing configuration files, but a back up of your critical Nagios Core files will allow you to revert back if you encounter problems.