Migrate Nagios from Fedora to Ubuntu

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
eduardo.vazquez
Posts: 1
Joined: Mon Aug 31, 2015 3:48 pm

Migrate Nagios from Fedora to Ubuntu

Post by eduardo.vazquez »

Hi experts,

In this moment I have Nagios installed on Fedora 12, but due to need of homologate my distros, I have the need to migrate Nagios from Fedora 12 to Ubuntu 14. Also i have the critical need of preserve all data info (logs, settings, etc.). My question is: Is possible make this migration? and, Exists some specific method to make it?

Thanks so much.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Migrate Nagios from Fedora to Ubuntu

Post by jolson »

This migration is certainly possible, but it's hard to tell you exactly what needs to happen without knowing exactly how Nagios is set up on your Fedora box in the first place.

What I'd like to offer you is a set of full installation instructions for Ubuntu - this way you can stand up a Nagios box on Ubuntu and work on getting your data to it from your Fedora box.

Installation instructions (for Ubuntu 14.04 and above):

Log in as the super user:

Code: Select all

sudo -i
Install all pre-requisite packages:

Code: Select all

apt-get --ignore-missing install wget build-essential apache2 php5-gd libgd2-xpm-dev libapache2-mod-php5 unzip m4 automake libtool gettext apache2-utils
Change to the tmp directory, and download Nagios Core and Nagios Plugins:

Code: Select all

cd /tmp
wget https://github.com/NagiosEnterprises/nagioscore/archive/master.tar.gz -O nagioscore.tar.gz
wget https://github.com/nagios-plugins/nagios-plugins/archive/master.tar.gz -O nagiosplugins.tar.gz
Add the appropriate user and group for the Nagios process (we recommend 'nagios' and 'nagcmd'), and assign 'nagios' and apache to the nagcmd group:

Code: Select all

useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd www-data
Run the following commands to unpack the Nagios Core and Nagios Plugins source code into tmp:

Code: Select all

tar xzf nagioscore.tar.gz
tar xzf nagiosplugins.tar.gz
Change to the Nagios Core directory:

Code: Select all

cd nagioscore-master
Run the configure command to get the source code ready for compilation:

Code: Select all

./configure --with-command-group=nagcmd --with-nagios-group=nagios --with-mail=/usr/bin/sendmail
Compile and install:

Code: Select all

make all
make install
make install-init
make install-config
make install-commandmode
Complete the installation:

Code: Select all

/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-enabled/nagios.conf
cp -R contrib/eventhandlers /usr/local/nagios/libexec
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
a2enmod rewrite
a2enmod cgi
Run the Nagios verification command to ensure the install completed properly:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Start Nagios:

Ubuntu 14

Code: Select all

/etc/init.d/nagios start
Ubuntu 15

Code: Select all

/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
Add a default user for web interface access, and start apache (we recommend calling the user 'nagiosadmin'):

Code: Select all

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
/etc/init.d/apache2 restart
Change to the Nagios Plugins directory to compile and install the plugins:

Code: Select all

cd /tmp/nagios-plugins-master/
./tools/setup
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
Register the Nagios service and Apache to be run upon system startup:

Code: Select all

ln -s /etc/init.d/apache2 /etc/rcS.d/S99apache2
ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked