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

[root@localhost ~]# mkdir /opt/nagiosbackup
[root@localhost ~]# tar -czvf /opt/nagiosbackup.tar.gz /usr/local/nagios

To view of list files in backup

[root@localhost opt]# tar -vf nagiosbackup.tar.gz

 

nagios old versin

Step 3:  Stop Nagios and Web Services

Stop the nagios and http services

[root@localhost ~]# systemctl stop nagios.service
[root@localhost ~]# systemctl stop httpd.service

[root@localhost ~]# 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)

[root@localhost ~]# 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

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

Step 5:  Start Back Nagios Services

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

[root@localhost nagios-4.3.2]# systemctl restart nagios.service
[root@localhost nagios-4.3.2]# systemctl restart httpd.service
[root@localhost nagios-4.3.2]#

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

[root@localhost nagios-4.3.2]# systemctl start nagios.service
Warning: Unit file of nagios.service changed on disk, 'systemctl daemon-reload' recommended.
[root@localhost nagios-4.3.2]# systemctl restart nagios.service
Warning: Unit file of nagios.service changed on disk, 'systemctl daemon-reload' recommended.

[root@localhost nagios-4.3.2]# systemctl daemon-reload

Step 6:

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

[root@localhost ~]# /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
[root@localhost ~]#
Nagios Core Upgrade

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

Stay Connected with us. Learn More and Earn More

ARK

My Name is ARK. Expert in grasping any new technology, Interested in Sharing the knowledge. Learn more & Earn More

You may also like...

Leave a Reply