Page 1 of 1

Nagios Config Transfer

Posted: Tue Jan 15, 2019 8:27 am
by danniiffxi
Hi Ladies and Gents

OK so I'd like to Transfer all config files files from an on old to new install of Nagios. Before asking if it can be done or not there are a few things i should explain.

We have 2 Live environments for Nagios

Nagios 1 is 5 years old and has Unlimited Licence.
Nagios 2 is 6 months old and has a 1000 node licence.

Nagios 1 runs an old postgresql DB backend and a Mod Gearman setup
Nagios 2 is MySQL without Gearman.

Basically I have offloaded over 7000 service checks from the old to the new Nagios, our old Nagios no longer needs Mod Gearman and needs a DB upgrade so to save the headache of removing everything my question is this. Is it possible to take a config backup including contacts, plugin's, commands, config, and everything from our old Nagios and drop it a new fresh Nagios install on the same DB type as our existing new one?

I feel it would be a lot faster than building it from the ground up which is my other option...

Re: Nagios Config Transfer

Posted: Tue Jan 15, 2019 1:05 pm
by benjaminsmith
Hello @danniiffxi,

You'll want to migrate the postgres database to mysql before migrating to the new server. The recommended process would be as follows:

1. Backup Nagios 1 and if you're running a VM take a snapshot.
See: Backing Up and Restoring Nagios XI
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

2. Turn off ModGearman. Go to /usr/local/nagios/etc and delete or comment out the following line:

Code: Select all

#broker_module=/usr/lib/mod_gearman2/mod_gearman2.o config=/etc/mod_gearman2/module.conf eventhandler=no
3. Upgrade the Nagios 1 server to the latest version.
See: Nagios XI Upgrade Instructions
https://assets.nagios.com/downloads/nag ... ctions.pdf

4. Migrate the database. Let us know if you have any issues.
See: Converting PostgreSQL to MySQL for Nagios
https://support.nagios.com/kb/article/c ... i-560.html

5. Backup and migrate Nagios 1 to the new server

Let me know if you have any issues or questions.

Re: Nagios Config Transfer

Posted: Tue Jan 15, 2019 3:42 pm
by benjaminsmith
Hi [user]@danniiffxi[/user],

I just updated the configuration line in #2 - make sure you comment or remove the modgearman definition. Apologies for any confusion. Thanks.

Re: Nagios Config Transfer

Posted: Wed Jan 16, 2019 4:19 am
by danniiffxi
Thank you benjaminsmith :) I will take a snapshot of the our Nagios VM before I make this change. I will keep you posted.

Re: Nagios Config Transfer

Posted: Wed Jan 16, 2019 11:33 am
by benjaminsmith
Hi @danniifxi,

Sounds good. Just let me know if you have any questions.