Nagios Core Upgrade To Latest Version Step by Step Guide

In this article we are going show how to upgrade Nagios core from 4.1.1 to latest version (4.3.2). Not Only this version of Nagios Core Upgrade you simply apply same method if there is any new release.

Nagios Core 4.3.2 Improvements / Fixes Release Notes

  • Every 15sec /var/log/messages is flooded with “nagios: set_environment_var”
  • Changed release date to ISO format (yyyy-mm-dd)
  • `make all` fails if unzip is not installed
  • Quick Search no longer allows search by Alias
  • flexible downtime on a service immediately turns off notifications
  • Fix to allow url_encode to be called twice
  • Update timeperiods.cfg.in (spelling)
  • Spelling fixes
  • Vent command pipe before remove to avoid deadlocks on writing end
  • CGI utility cgiutil.c does not process relative config file path names properly
  • xdata/xodtemplate.c bug in option-deprecation code
  • Wildcard searching causes service status links to not work properly
  • Quick search with no hits shows a permission denied error
  • Setting a service as its own parent is not caught by the sanity checker (-v) and causes a segfault

Step 1: Nagios Core Upgrade

Make sure you have backup of existing Nagios Core installation and Configuration file of nagios server. If anything missing or goes wrong, you can rollback to old version from backup of previous nagios.

Step 2: Take Nagios Config Backup

To Taking backup of previous running nagios

Nagios Core upgrade from 4.1.1 to latest version

1) Take the snapshot of Nagios server (If it is a Virtual Machine)
2) Take the backup through tar command Or Take Backup using Backup tools

# mkdir /opt/nagiosbackup
# tar -czvf /opt/nagiosbackup.tar.gz /usr/local/nagios

To view of list files in backup

# tar -vf nagiosbackup.tar.gz

 

nagios old versin

Step 3:  Stop Nagios and Web Services

Stop the nagios and http services

# systemctl stop nagios.service
# systemctl stop httpd.service

# systemctl status nagios.service
nagios.service - LSB: Starts and stops the Nagios monitoring server
 Loaded: loaded (/etc/rc.d/init.d/nagios)
 Active: inactive (dead) since Sun 2017-07-16 17:45:18 IST; 23s ago
 Process: 29687 ExecStop=/etc/rc.d/init.d/nagios stop (code=exited, status=0/SUCCESS)
 Process: 29598 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=0/SUCCESS)

# systemctl status httpd.service
httpd.service - The Apache HTTP Server
 Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
 Active: inactive (dead)

Step 4: Download Latest Nagios Version

Download latest Nagios version and install the Nagios latest version follow by below steps

# wget https://sourceforge.net/projects/nagios/files/nagios-4.x/nagios-4.3.2/nagios-4.3.2.tar.gz
# tar -xzvf /nagios-4.3.2.tar.gz
# cd nagios.4.3.2/
# ./configure --with-command-group=nagcmd
# make all
# make install-init
# make install-commandmode
# make install-config
# make install-webconfig

Step 5:  Start Back Nagios Services

# cd /usr/local/nagios/
# rm -rf etc/*
# tar -xvf nagiosbackup.tar.gz
# cp -Rpv /opt/nagiosbackup/etc/* /usr/local/nagios/etc/
# cp -v /opt/nagiosbackup/libexec/* /usr/local/nagios/libexec/

After install the latest Nagios version , start the Nagios and http services to bring back services online

# systemctl restart nagios.service
# systemctl restart httpd.service

Note:  Sometimes starting Nagios service getting error like as below.

# systemctl start nagios.service
Warning: Unit file of nagios.service changed on disk, 'systemctl daemon-reload' recommended.

# systemctl restart nagios.service
Warning: Unit file of nagios.service changed on disk, 'systemctl daemon-reload' recommended.

# systemctl daemon-reload

Step 6:

To check the errors in Nagios configuration. You can see the latest version of nagios in below .

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

Nagios Core 4.3.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-05-09
License: GPL

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check

Nagios Core Upgrade 4.1.1

Nagios upgraded from previous version to latest version successfully completed.

Now check in your browser

http://ipaddress/nagios/

 

nagios latest version

Conclusion:

Nagios Core Upgrade did not change existing configuration it will just upgrade the version, after simply verify configuration files and simply replace previous config files your entire Nagios core configuration will be as it is. If it is a physical server change / Operating System Upgrade even then you can simple migrate configuration from Old Nagios Server to New Nagios Server.

Related Articles

Nagios Installation RHEL 7

pnp4nagios Graphing Service

Installing NRPE Linux

Thanks for your wonderful Support and Encouragement