Upgrading Nagios Core From Source
This document describes how to upgrade Nagios Core from source.
This guide is broken up into several sections and covers different operating system (OS) distributions. If your OS Distribution is not included in this guide then please contact us to see if we can get it added. Some distributions may be missing as we don't have access to a test environment that allows us to develop the documentation.
Nagios Core 4.5.9 is what this guide instructs you to upgrade to, however future versions should also work fine with these steps. This guide is focussed at upgrading from an earlier version of Nagios Core 4.x, it may work with previous major versions of Nagios Core however you may experience some issues (which are outside the scope of this documentation).
Do NOT follow this guide if you are running Nagios XI. Nagios XI includes Nagios Core and the version of Core used is specific to the release of Nagios XI you are running.
Please select your OS:
This command stops Nagios Core.
===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x =====
service nagios stop
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
systemctl stop nagios.service
cd /tmp
rm -rf nagioscore*
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.5.9.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.5.9/
./configure
make all
This step installs the binary files, CGIs, and HTML files.
make install
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
make install-daemoninit
If you are upgrading from Nagios Core 4.3.2 and earlier you will need to update the nagios.cfg file to point to /var/run/nagios.lock using the following command:
sed -i 's/^lock_file=.*/lock_file=\/var\/run\/nagios.lock/g' /usr/local/nagios/etc/nagios.cfg
More information about this is detailed in the following KB article:
Nagios Core - nagios.lock Changes In 4.3.3 Onwards
This command Starts Nagios Core.
===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x =====
service nagios start
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
systemctl start nagios.service
You can confirm that the nagios service is now running with the following command:
===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x =====
service nagios status
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
systemctl status nagios.service
You can confirm the nagios version being used with the following command:
/usr/local/nagios/bin/nagios -V
This will output something like:
Nagios Core 4.5.9
This command stops Nagios Core.
===== Ubuntu 14.x =====
sudo service nagios stop
===== Ubuntu 15.x / 16.x / 17.x / 18.x =====
sudo systemctl stop nagios.service
cd /tmp
sudo rm -rf nagioscore*
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.5.9.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.5.9/
sudo ./configure --with-httpd-conf=/etc/apache2/sites-enabled
sudo make all
This step installs the binary files, CGIs, and HTML files.
sudo make install
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
sudo make install-daemoninit
If you are upgrading from Nagios Core 4.3.2 and earlier you will need to update the nagios.cfg file to point to /var/run/nagios.lock using the following command:
sudo sh -c "sed -i 's/^lock_file=.*/lock_file=\/var\/run\/nagios.lock/g' /usr/local/nagios/etc/nagios.cfg"
More information about this is detailed in the following KB article:
Nagios Core - nagios.lock Changes In 4.3.3 Onwards
This command starts Nagios Core.
===== Ubuntu 14.x =====
sudo service nagios start
===== Ubuntu 15.x / 16.x / 17.x / 18.x =====
sudo systemctl start nagios.service
You can confirm that the nagios service is now running with the following command:
===== Ubuntu 14.x =====
sudo service nagios status
===== Ubuntu 15.x / 16.x / 17.x / 18.x =====
sudo systemctl status nagios.service
You can confirm the nagios version being used with the following command:
sudo /usr/local/nagios/bin/nagios -V
This will output something like:
Nagios Core 4.5.9
This command stops Nagios Core.
===== SUSE SLES 11.x =====
sudo /sbin/service nagios stop
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x =====
sudo systemctl stop nagios.service
cd /tmp
sudo rm -rf nagioscore*
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.5.9.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.5.9/
sudo ./configure --with-httpd-conf=/etc/apache2/vhosts.d
sudo make all
This step installs the binary files, CGIs, and HTML files.
sudo make install
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
sudo make install-daemoninit
If you are upgrading from Nagios Core 4.3.2 and earlier you will need to update the nagios.cfg file to point to /var/run/nagios.lock using the following command:
sudo sh -c "sed -i 's/^lock_file=.*/lock_file=\/var\/run\/nagios.lock/g' /usr/local/nagios/etc/nagios.cfg"
More information about this is detailed in the following KB article:
Nagios Core - nagios.lock Changes In 4.3.3 Onwards
This command starts Nagios Core.
===== SUSE SLES 11.x =====
sudo /sbin/service nagios start
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x =====
sudo systemctl start nagios.service
You can confirm that the nagios service is now running with the following command:
===== SUSE SLES 11.x =====
sudo /sbin/service nagios status
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x =====
sudo systemctl status nagios.service
You can confirm the nagios version being used with the following command:
sudo /usr/local/nagios/bin/nagios -V
This will output something like:
Nagios Core 4.5.9
All steps on Debian require to run as root. To become root simply run:
Debian:
su
Raspbian:
sudo -i
All commands from this point onwards will be as root.
This command stops Nagios Core.
===== 7.x =====
service nagios stop
===== 8.x / 9.x =====
systemctl stop nagios.service
cd /tmp
rm -rf nagioscore*
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.5.9.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.5.9/
./configure --with-httpd-conf=/etc/apache2/sites-enabled
make all
This step installs the binary files, CGIs, and HTML files.
make install
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
make install-daemoninit
If you are upgrading from Nagios Core 4.3.2 and earlier you will need to update the nagios.cfg file to point to /var/run/nagios.lock using the following command:
sed -i 's/^lock_file=.*/lock_file=\/var\/run\/nagios.lock/g' /usr/local/nagios/etc/nagios.cfg
More information about this is detailed in the following KB article:
Nagios Core - nagios.lock Changes In 4.3.3 Onwards
This command restarts Nagios Core.
===== 7.x =====
service nagios start
===== 8.x / 9.x =====
systemctl start nagios.service
You can confirm that the nagios service is now running with the following command:
===== 7.x =====
service nagios status
===== 8.x / 9.x =====
systemctl status nagios.service
You can confirm the nagios version being used with the following command:
/usr/local/nagios/bin/nagios -V
This will output something like:
Nagios Core 4.5.9
This command stops Nagios Core.
systemctl stop nagios.service
cd /tmp
rm -rf nagioscore*
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.5.9.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.5.9/
./configure
make all
This step installs the binary files, CGIs, and HTML files.
make install
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
make install-daemoninit
If you are upgrading from Nagios Core 4.3.2 and earlier you will need to update the nagios.cfg file to point to /var/run/nagios.lock using the following command:
sed -i 's/^lock_file=.*/lock_file=\/var\/run\/nagios.lock/g' /usr/local/nagios/etc/nagios.cfg
More information about this is detailed in the following KB article:
Nagios Core - nagios.lock Changes In 4.3.3 Onwards
This command starts Nagios Core.
systemctl start nagios.service
You can confirm that the nagios service is now running with the following command:
systemctl status nagios.service
You can confirm the nagios version being used with the following command:
/usr/local/nagios/bin/nagios -V
This will output something like:
Nagios Core 4.5.9
This command stops Nagios Core.
systemctl stop nagios.service
cd /tmp
rm -rf nagioscore*
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.5.9.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.5.9/
./configure --with-httpd-conf=/etc/httpd/conf/extra
make all
This step installs the binary files, CGIs, and HTML files.
make install
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
make install-daemoninit
If you are upgrading from Nagios Core 4.3.2 and earlier you will need to update the nagios.cfg file to point to /var/run/nagios.lock using the following command:
sed -i 's/^lock_file=.*/lock_file=\/var\/run\/nagios.lock/g' /usr/local/nagios/etc/nagios.cfg
More information about this is detailed in the following KB article:
Nagios Core - nagios.lock Changes In 4.3.3 Onwards
This command starts Nagios Core.
systemctl start nagios.service
You can confirm that the nagios service is now running with the following command:
systemctl status nagios.service
You can confirm the nagios version being used with the following command:
/usr/local/nagios/bin/nagios -V
This will output something like:
Nagios Core 4.5.9
This command stops Nagios Core.
===== openrc =====
rc-service nagios stop
===== systemd =====
systemctl stop nagios.service
cd /tmp
rm -rf nagioscore*
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.5.9.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.5.9/
./configure --with-httpd-conf=/etc/apache2/vhosts.d --sysconfdir=/usr/local/nagios/etc
make all
This step installs the binary files, CGIs, and HTML files.
make install
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
make install-daemoninit
If you are upgrading from Nagios Core 4.3.2 and earlier you will need to update the nagios.cfg file to point to /run/nagios.lock using the following command:
sed -i 's/^lock_file=.*/lock_file=\/run\/nagios.lock/g' /usr/local/nagios/etc/nagios.cfg
More information about this is detailed in the following KB article:
Nagios Core - nagios.lock Changes In 4.3.3 Onwards
This command starts Nagios Core.
===== openrc =====
rc-service nagios start
===== systemd =====
A stop is required first, even though the processes are not running. This appears to be a systemd feature.
systemctl start nagios.service
You can confirm that the nagios service is now running with the following command:
===== openrc =====
rc-service nagios status
===== systemd =====
systemctl status nagios.service
You can confirm the nagios version being used with the following command:
/usr/local/nagios/bin/nagios -V
This will output something like:
Nagios Core 4.5.9
This command stops Nagios Core.
service nagios stop
cd /tmp
rm -rf nagioscore*
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.5.9.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.5.9/
./configure --with-httpd-conf=/usr/local/etc/apache24/Includes
gmake all
This step installs the binary files, CGIs, and HTML files.
gmake install
chown nagios:nagios /usr/local/nagios/bin/*
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
gmake install-daemoninit
If you are upgrading from Nagios Core 4.3.2 and earlier you will need to update the nagios.cfg file to point to /var/run/nagios.lock using the following command:
sed -i '' 's/^lock_file=.*/lock_file=\/var\/run\/nagios.lock/g' /usr/local/nagios/etc/nagios.cfg
More information about this is detailed in the following KB article:
Nagios Core - nagios.lock Changes In 4.3.3 Onwards
This command starts Nagios Core.
service nagios start
You can confirm that the nagios service is now running with the following command:
service nagios status
You can confirm the nagios version being used with the following command:
/usr/local/nagios/bin/nagios -V
This will output something like:
Nagios Core 4.5.9
This command stops Nagios Core.
svcadm disable nagios
cd /tmp
rm -rf nagioscore*
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.5.9.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.5.9/
./configure --with-httpd-conf=/etc/apache2/2.2/conf.d --with-gd-inc=/usr/include/gd2
gmake all
This step installs the binary files, CGIs, and HTML files.
gmake install
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
gmake install-daemoninit
If you are upgrading from Nagios Core 4.3.2 and earlier you will need to update the nagios.cfg file to point to /var/run/nagios.lock using the following command:
perl -p -i -e 's/^lock_file=.*/lock_file=\/var\/run\/nagios.lock/g' /usr/local/nagios/etc/nagios.cfg
More information about this is detailed in the following KB article:
Nagios Core - nagios.lock Changes In 4.3.3 Onwards
This command starts Nagios Core.
svcadm enable nagios
You can confirm that the nagios service is now running with the following command:
svcs -xv nagios
You can confirm the nagios version being used with the following command:
/usr/local/nagios/bin/nagios -V
This will output something like:
Nagios Core 4.5.9
This command stops Nagios Core.
sudo /etc/rc.d/init.d/nagios stop
cd /tmp
rm -rf nagioscore*
curl -L -o nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.5.9.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.5.9/
sudo ./configure --with-httpd-conf=/opt/local/apache2/conf/extra --with-gd-lib=/opt/local/lib --with-gd-inc=/opt/local/include
sudo make all
This step installs the binary files, CGIs, and HTML files.
sudo make install
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
sudo make install-daemoninit
If you are upgrading from Nagios Core 4.3.2 and earlier you will need to update the nagios.cfg file to point to /var/run/nagios.lock using the following command:
sudo sed -i '' 's/^lock_file=.*/lock_file=\/var\/run\/nagios.lock/g' /usr/local/nagios/etc/nagios.cfg
More information about this is detailed in the following KB article:
Nagios Core - nagios.lock Changes In 4.3.3 Onwards
This command starts Nagios Core.
sudo /etc/rc.d/init.d/nagios start
You can confirm that the nagios service is now running with the following command:
sudo /etc/rc.d/init.d/nagios status
You can confirm the nagios version being used with the following command:
/usr/local/nagios/bin/nagios -V
This will output something like:
Nagios Core 4.5.9
For any support related questions please visit the Nagios Support Forums at:
http://support.nagios.com/forum/
Article ID: 797
Created On: Wed, Jan 31, 2018 at 11:49 PM
Last Updated On: Wed, May 7, 2025 at 3:07 PM
Authored by: tlea
Online URL: https://support.nagios.com/kb/article/nagios-core-upgrading-nagios-core-from-source-797.html