migration tools for Nagios Core

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

migration tools for Nagios Core

Postby DOkuwa » Thu Sep 21, 2017 9:29 am

I have a task here we have a very old Nagios Core 3.2.3
we want to migrate to the latest Nagios core 4.x or even 5
on a virtual  Unix (redhat or Ubuntu)
This is going to be a new installation 
Is there any Migration tool to migrate all the files from the old to the new without any hiccup
DOkuwa
 
Posts: 44
Joined: Tue Aug 15, 2017 3:54 pm

Re: migration tools for Nagios Core

Postby scottwilkerson » Thu Sep 21, 2017 11:49 am

The newest version is 4.3.4

For the most part everything should work with the same configuration files, except a few items need to be modified in your nagios.cfg which can be done with the following

make a backup of your existing nagios.cfg
Code: Select all
cd /usr/local/nagios/etc/
cp nagios.cfg nagios.cfg~pre-upgrade


run the following to comment out depreciated directives
Code: Select all
sed -i --regexp-extended -e "s/^(\s*check_result_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g" \
   -e 's/^(\s*use_embedded_perl_implicitly\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*sleep_time\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*p1_file\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*external_command_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*enable_embedded_perl\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*command_check_interval\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ nagios.cfg
User avatar
scottwilkerson
CTO
 
Posts: 7903
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: migration tools for Nagios Core

Postby DOkuwa » Fri Sep 22, 2017 3:10 am

I am migrating to a new server and performing a new install

Does this mean I have to configure everything all over again
DOkuwa
 
Posts: 44
Joined: Tue Aug 15, 2017 3:54 pm

Re: migration tools for Nagios Core

Postby scottwilkerson » Fri Sep 22, 2017 8:29 am

DOkuwa wrote:I am migrating to a new server and performing a new install

Does this mean I have to configure everything all over again


No, you can use the same configuration files you had before, except you will need to run the above on the nagios.cfg because there are a few directives that are deprecated.
User avatar
scottwilkerson
CTO
 
Posts: 7903
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: migration tools for Nagios Core

Postby DOkuwa » Fri Sep 22, 2017 10:27 am

Thanks
But this means that we have to copy across all the .cfg from the /usr/local/Nagios/etc(old server)to the new server
DOkuwa
 
Posts: 44
Joined: Tue Aug 15, 2017 3:54 pm

Re: migration tools for Nagios Core

Postby dwhitfield » Fri Sep 22, 2017 11:06 am

That's correct. I would suggest using a tool like Filezilla to help facilitate this.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 3838
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC

Re: migration tools for Nagios Core

Postby DOkuwa » Thu Sep 28, 2017 6:17 am

What is the purpose of this
sed -i --regexp-extended -e "s/^(\s*check_result_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g" \
   -e 's/^(\s*use_embedded_perl_implicitly\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*sleep_time\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*p1_file\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*external_command_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*enable_embedded_perl\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*command_check_interval\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ nagios.cfg
DOkuwa
 
Posts: 44
Joined: Tue Aug 15, 2017 3:54 pm

Re: migration tools for Nagios Core

Postby scottwilkerson » Thu Sep 28, 2017 11:17 am

This just comments all the commands from your nagios.cfg that are deprecated in in Nagios 4
User avatar
scottwilkerson
CTO
 
Posts: 7903
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: migration tools for Nagios Core

Postby DOkuwa » Fri Oct 06, 2017 9:06 am

@scottwilkerson
just looking at the Nagios.cfg
does this mean that I run each command on each line e.g

sed -i --regexp-extended -e "s/^(\s*check_result_buffer_slots\s*=\s*)/ nagios.cfg

please tell me
DOkuwa
 
Posts: 44
Joined: Tue Aug 15, 2017 3:54 pm

Re: migration tools for Nagios Core

Postby scottwilkerson » Fri Oct 06, 2017 10:52 am

This is one command that you can copy and paste into a terminal
Code: Select all
sed -i --regexp-extended -e "s/^(\s*check_result_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g" \
   -e 's/^(\s*use_embedded_perl_implicitly\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*sleep_time\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*p1_file\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*external_command_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*enable_embedded_perl\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
   -e 's/^(\s*command_check_interval\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \ nagios.cfg


The only caveat is that you should be in the directory that contains your nagios.cfg
User avatar
scottwilkerson
CTO
 
Posts: 7903
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Next

Return to Nagios Core

Who is online

Users browsing this forum: npolovenko and 23 guests