Page 2 of 2

Re: Host Group and Host Export to New Upgrade

Posted: Tue Apr 24, 2018 3:40 pm
by gormank
That's not going to work out well.
You need to copy to the /usr/local/nagios/etc/import dir and XI imports into the DB and writes to the etc dir when you apply the config, which runs the reconfig script. You also need to copy, reconfigure, copy, reconfigure, etc.

Re: Host Group and Host Export to New Upgrade

Posted: Tue Apr 24, 2018 3:46 pm
by gormank
Something like the following...

host1=nags-01

cd /usr/local/nagiosxi/scripts

scp nagios@$host1:/usr/local/nagios/etc/commands.cfg /usr/local/nagios/etc/import/
./reconfigure_nagios.sh
scp nagios@$host1:/usr/local/nagios/etc/contacttemplates.cfg /usr/local/nagios/etc/import/
./reconfigure_nagios.sh
scp nagios@$host1:/usr/local/nagios/etc/servicetemplates.cfg /usr/local/nagios/etc/import/
./reconfigure_nagios.sh
scp nagios@$host1:/usr/local/nagios/etc/contacts.cfg /usr/local/nagios/etc/import/
./reconfigure_nagios.sh
scp nagios@diegbe2hhsc-v-tienags-01:/usr/local/nagios/etc/contactgroups.cfg /usr/local/nagios/etc/import/
./reconfigure_nagios.sh
scp nagios@$host1:/usr/local/nagios/etc/hosttemplates.cfg /usr/local/nagios/etc/import/
./reconfigure_nagios.sh
scp nagios@$host1:/usr/local/nagios/etc/hosts/* /usr/local/nagios/etc/import/
./reconfigure_nagios.sh
scp nagios@$host1:/usr/local/nagios/etc/hostgroups.cfg /usr/local/nagios/etc/import/
./reconfigure_nagios.sh
scp nagios@$host1:/usr/local/nagios/etc/services/* /usr/local/nagios/etc/import/
./reconfigure_nagios.sh

Re: Host Group and Host Export to New Upgrade

Posted: Tue Apr 24, 2018 4:15 pm
by npolovenko
@Sarg0n, Please run the following commands in order:

Code: Select all

service nagios stop
mv /usr/local/nagios/var/ndo2db.lock /usr/local/nagios/var/ndo2db.lock.bak
mv /usr/local/nagios/var/ndo.sock /usr/local/nagios/var/ndo.sock.bak
service ndo2db start
service nagios start

Re: Host Group and Host Export to New Upgrade

Posted: Wed Apr 25, 2018 8:40 am
by Sarg0n
This appears to have worked! :D I'm showing green all the way down.

...aaaand I forgot to install the VMware wizard, so my services are all showing critical...but I'll install that and see if it fixes it.

But, hosts are migrated over and services. I think I am good for now! I will hit you up if additional help is needed. Thank you so very much!

Re: Host Group and Host Export to New Upgrade

Posted: Wed Apr 25, 2018 11:42 am
by npolovenko
@Sarg0n, Sounds good. Here's the instruction for that just in case:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf