Migrate config

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
razah
Posts: 12
Joined: Tue Jun 25, 2019 4:26 am

Migrate config

Post by razah »

Hi
We have an old installation of Nagios 3.0.6 running on Redhat 5 monitoring around 700 servers, and have recently built a new NagiosXI server on Centos 7. Rather then having to set up each server on the new NagiosXI installation is there a way to move the servers and services across ?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Migrate config

Post by cdienger »

https://assets.nagios.com/downloads/nag ... ios-XI.pdf covers migrating from core to XI. Review it and let us know if you have any questions or run into any issues.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
razah
Posts: 12
Joined: Tue Jun 25, 2019 4:26 am

Re: Migrate config

Post by razah »

Hi

Thanks you for your reply

I have tried this but get an error when I go to apply the changes

Error: Could not find a service matching host name 'XXXX' and description '0' (config file '/usr/local/nagios/etc/serviceextinfo.cfg', starting on line 10264)
Error: Could not expand services specified in extended service info (config file '/usr/local/nagios/etc/serviceextinfo.cfg', starting on line 10264)


/usr/local/nagios/etc/serviceextinfo.cfg does not contain any data so i'm not sure where its getting line 10264 from

more /usr/local/nagios/etc/serviceextinfo.cfg
###############################################################################
#
# Serviceextinfo configuration file
#
# Created by: Nagios CCM 3.0.2
# Date: 2019-06-25 11:08:02
# Version: Nagios Core 4.x
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

###############################################################################
#
# Serviceextinfo configuration file
#
# END OF FILE
#
###############################################################################


Any ideas ?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Migrate config

Post by cdienger »

It sounds like there's a service with a config named '0' pointing to a host that doesn't exist. Does the 'XXXX' host exist? Do you see a service with a config name '0' under Configure > Core Config Manager > Monitoring > Services ? If so, edit it to review the config and/or disable it.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
razah
Posts: 12
Joined: Tue Jun 25, 2019 4:26 am

Re: Migrate config

Post by razah »

Ok I trashed the server and started the import again. This time I'm getting a different issue error.

Apply Configuration
Backend login to the Core Config Manager failed.
An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.

The show errors box is empty. Having a look on google I saw to look in the /usr/local/nagiosxi/var/cmdsubsys.log log file whilst running the apply configuration is running. Below is the output from this file

tail -f /usr/local/nagiosxi/var/cmdsubsys.log
PROCESSED 2 COMMANDS
............................................................
PROCESSED 0 COMMANDS
............................................................
PROCESSED 0 COMMANDS
..........................................................
PROCESSED 0 COMMANDS
............................................................
PROCESSED 0 COMMANDS
...................................................PROCESSING COMMAND ID 16...
PROCESS COMMAND: CMD=17, DATA=
APPLYING NAGIOSCORE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
No entry for terminal type "unknown";
using dumb terminal settings.

--- reset_config_perms.sh ------------
> Setting script permissions
> Setting CCM script permissions
> Setting special script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting libexec directory permissions
> Setting Nagios XI config permissions
> Setting NOM checkpoint user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------

--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
- Importing: /usr/local/nagios/etc/import/extended_service_info_templates.cfg .. ERROR
Table for import definition 'serviceextinfo' is not available!
--------------------------------------

Importing into the CCM failed!
OUTPUT=Importing into the CCM failed!
RETURNCODE=2
PROCESSING COMMAND ID 17...
PROCESS COMMAND: CMD=1150, DATA=remove
CMDLINE=php /usr/local/nagiosxi/html/includes/components/nagiosbpi/api_tool.php --cmd=syncall
CMD: syncall
MSG: BPI configuration applied successfully! BPI configuration applied successfully!
OUTPUT=MSG: BPI configuration applied successfully! BPI configuration applied successfully!
RETURNCODE=0
.........


Any ideas on this ?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Migrate config

Post by ssax »

- Importing: /usr/local/nagios/etc/import/extended_service_info_templates.cfg .. ERROR

Code: Select all

Table for import definition 'serviceextinfo' is not available!
I would skip trying to import your host/serviceextinfo as it's no longer used.

Remove this file:

Code: Select all

/usr/local/nagios/etc/import/extended_service_info_templates.cfg
Continue repeating the processes (fix, verify, fix, verify) until you have a valid config.

If you need help, go to Configure > Core Config Manager > Tools > Config File Management:
- Click the Delete Files button (don't worry, it's safe, they will be rewritten)
- Then click the Write Configs button
- Once they are done being written (don't do anything in between, don't apply config), run this command and send me the resulting /tmp/NAGIOSBADFILES.zip file:

Code: Select all

zip -r /tmp/NAGIOSBADFILES.zip /usr/local/nagios/etc

Thank you
razah
Posts: 12
Joined: Tue Jun 25, 2019 4:26 am

Re: Migrate config

Post by razah »

Hi

Thanks you for the response. The advice provided has helped to get the import done. In case anybody else has a similar issue in addition to the file you suggested that I remove, I also removed :-

Code: Select all

/usr/local/nagios/etc/extended_service_info_templates.cfg
Thanks for all your help.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Migrate config

Post by benjaminsmith »

Thanks for all your help.
Your welcome. Did you have any other questions or may we close this thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
razah
Posts: 12
Joined: Tue Jun 25, 2019 4:26 am

Re: Migrate config

Post by razah »

There is just one more oddity I have noticed. On all the imported servers, the Linux servers now have nrpe services set up, previously we used check_by_ssh, is there any easy way of removing the nrpe checks an re-enabling the check_by_ssh ?

Thanks
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Migrate config

Post by benjaminsmith »

Hello @razah,

Probably, the easiest way is to use the Bulk Modifications tool from the CCM to change the check command on those services. Go to Configure > CCM > Tools > Bulk Modifications Tool.
bulkmods.png
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked