Page 1 of 1

Importing Config Files From Nagios Core into Nagios XI

Posted: Wed Jun 10, 2015 7:34 am
by jvanmeter
I copied the etc directory and sub directories from my currect nagios servers to usr/local/nagios/etc/cfgprep/orig on my nagios xi server. Next I started to run the below commands.

php /usr/local/nagiosxi/tools/xiprepimport.php orig/commands.cfg
php /usr/local/nagiosxi/tools/xiprepimport.php orig/contacts.cfg
php /usr/local/nagiosxi/tools/xiprepimport.php orig/dependencies.cfg
php /usr/local/nagiosxi/tools/xiprepimport.php orig/hostgroups.cfg
php /usr/local/nagiosxi/tools/xiprepimport.php orig/hosts.cfg
php /usr/local/nagiosxi/tools/xiprepimport.php orig/servicegroups.cfg
php /usr/local/nagiosxi/tools/xiprepimport.php orig/services.cfg
php /usr/local/nagiosxi/tools/xiprepimport.php orig/templates.cfg
php /usr/local/nagiosxi/tools/xiprepimport.php orig/timeperiods.cfg

I noticed that I did not have the following files dependencies.cfg, hosts.cfg, services.cfg, with the other files I had cp'ed from my old nagios server. I ssh'ed onto my old nagios server and as root ran "find / -name hosts.cfg" no file was found, that was the same for dependencies and servers. Is it possible to import the cfg files from a nagios 3.2.3 server into nagios xi? Is there something different I need to do?

Re: Importing Config Files From Nagios Core into Nagios XI

Posted: Wed Jun 10, 2015 9:58 am
by jolson
It's no problem if your configuration filenames are different than those stated in the PDF instructions.

Have you taken a look at this document? https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Let us know if you have any questions.

Re: Importing Config Files From Nagios Core into Nagios XI

Posted: Wed Jun 10, 2015 10:08 am
by jvanmeter
yes but with the hosts.cfg and servers.cfg file missing, how would the import know what servers or services to monitor? Would it be defined in another cfg file?

Re: Importing Config Files From Nagios Core into Nagios XI

Posted: Wed Jun 10, 2015 10:14 am
by eloyd
The filenames can be changed in your nagios.cfg file. Look for "cfg_file" and "cfg_dir" entries in that file:

Code: Select all

egrep "^cfg_(file|dir)" /usr/local/nagios/etc/nagios.cfg
Replace the path with the path of your actual nagios.cfg file. You will want to import every file specifically mentioned, plus every .cfg file in the cfg_dir, if one is specified.

Re: Importing Config Files From Nagios Core into Nagios XI

Posted: Wed Jun 10, 2015 3:35 pm
by tgriep
jvanmeter,

Did eloyd's post help you out in finding your host and service config files?