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:
Stop Service / Daemon
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
Downloading the Source
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
Compile
cd /tmp/nagioscore-nagios-4.5.9/
./configure
make all
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install
Install Service / Daemon
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
make install-daemoninit
Update nagios.cfg
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
Start Service / Daemon
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
Confirm Nagios Is Running
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
Confirm Nagios Version
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
Stop Service / Daemon
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
Downloading the Source
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
Compile
cd /tmp/nagioscore-nagios-4.5.9/
sudo ./configure --with-httpd-conf=/etc/apache2/sites-enabled
sudo make all
Install Binaries
This step installs the binary files, CGIs, and HTML files.
sudo make install
Install Service / Daemon
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
Update nagios.cfg
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
Start Service / Daemon
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
Confirm Nagios Is Running
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
Confirm Nagios Version
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
Stop Service / Daemon
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
Downloading the Source
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
Compile
cd /tmp/nagioscore-nagios-4.5.9/
sudo ./configure --with-httpd-conf=/etc/apache2/vhosts.d
sudo make all
Install Binaries
This step installs the binary files, CGIs, and HTML files.
sudo make install
Install Service / Daemon
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
Update nagios.cfg
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
Start Service / Daemon
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
Confirm Nagios Is Running
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
Confirm Nagios Version
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.
Stop Service / Daemon
This command stops Nagios Core.
===== 7.x =====
service nagios stop
===== 8.x / 9.x =====
systemctl stop nagios.service
Downloading the Source
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
Compile
cd /tmp/nagioscore-nagios-4.5.9/
./configure --with-httpd-conf=/etc/apache2/sites-enabled
make all
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install
Install Service / Daemon
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
make install-daemoninit
Update nagios.cfg
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
Start Service / Daemon
This command restarts Nagios Core.
===== 7.x =====
service nagios start
===== 8.x / 9.x =====
systemctl start nagios.service
Confirm Nagios Is Running
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
Confirm Nagios Version
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
Stop Service / Daemon
This command stops Nagios Core.
systemctl stop nagios.service
Downloading the Source
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
Compile
cd /tmp/nagioscore-nagios-4.5.9/
./configure
make all
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install
Install Service / Daemon
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
make install-daemoninit
Update nagios.cfg
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
Start Service / Daemon
This command starts Nagios Core.
systemctl start nagios.service
Confirm Nagios Is Running
You can confirm that the nagios service is now running with the following command:
systemctl status nagios.service
Confirm Nagios Version
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
Stop Service / Daemon
This command stops Nagios Core.
systemctl stop nagios.service
Downloading the Source
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
Compile
cd /tmp/nagioscore-nagios-4.5.9/
./configure --with-httpd-conf=/etc/httpd/conf/extra
make all
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install
Install Service / Daemon
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
make install-daemoninit
Update nagios.cfg
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
Start Service / Daemon
This command starts Nagios Core.
systemctl start nagios.service
Confirm Nagios Is Running
You can confirm that the nagios service is now running with the following command:
systemctl status nagios.service
Confirm Nagios Version
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
Stop Service / Daemon
This command stops Nagios Core.
===== openrc =====
rc-service nagios stop
===== systemd =====
systemctl stop nagios.service
Downloading the Source
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
Compile
cd /tmp/nagioscore-nagios-4.5.9/
./configure --with-httpd-conf=/etc/apache2/vhosts.d --sysconfdir=/usr/local/nagios/etc
make all
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install
Install Service / Daemon
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
make install-daemoninit
Update nagios.cfg
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
Start Service / Daemon
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
Confirm Nagios Is Running
You can confirm that the nagios service is now running with the following command:
===== openrc =====
rc-service nagios status
===== systemd =====
systemctl status nagios.service
Confirm Nagios Version
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
Stop Service / Daemon
This command stops Nagios Core.
service nagios stop
Downloading the Source
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
Compile
cd /tmp/nagioscore-nagios-4.5.9/
./configure --with-httpd-conf=/usr/local/etc/apache24/Includes
gmake all
Install Binaries
This step installs the binary files, CGIs, and HTML files.
gmake install
chown nagios:nagios /usr/local/nagios/bin/*
Install Service / Daemon
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
gmake install-daemoninit
Update nagios.cfg
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
Start Service / Daemon
This command starts Nagios Core.
service nagios start
Confirm Nagios Is Running
You can confirm that the nagios service is now running with the following command:
service nagios status
Confirm Nagios Version
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
Stop Service / Daemon
This command stops Nagios Core.
svcadm disable nagios
Downloading the Source
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
Compile
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
Install Binaries
This step installs the binary files, CGIs, and HTML files.
gmake install
Install Service / Daemon
This installs the service or daemon files. While these will already exist they do get updated occasionally and hence need replacing.
gmake install-daemoninit
Update nagios.cfg
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
Start Service / Daemon
This command starts Nagios Core.
svcadm enable nagios
Confirm Nagios Is Running
You can confirm that the nagios service is now running with the following command:
svcs -xv nagios
Confirm Nagios Version
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
Stop Service / Daemon
This command stops Nagios Core.
sudo /etc/rc.d/init.d/nagios stop
Downloading the Source
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
Compile
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
Install Binaries
This step installs the binary files, CGIs, and HTML files.
sudo make install
Install Service / Daemon
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
Update nagios.cfg
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
Start Service / Daemon
This command starts Nagios Core.
sudo /etc/rc.d/init.d/nagios start
Confirm Nagios Is Running
You can confirm that the nagios service is now running with the following command:
sudo /etc/rc.d/init.d/nagios status
Confirm Nagios Version
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
Final Thoughts
For any support related questions please visit the Nagios Support Forums at:
http://support.nagios.com/forum/