Page 1 of 1
Migrate config
Posted: Wed Aug 28, 2019 8:43 am
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 ?
Re: Migrate config
Posted: Wed Aug 28, 2019 1:46 pm
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.
Re: Migrate config
Posted: Thu Aug 29, 2019 10:17 am
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 ?
Re: Migrate config
Posted: Thu Aug 29, 2019 4:37 pm
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.
Re: Migrate config
Posted: Fri Aug 30, 2019 5:50 am
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 ?
Re: Migrate config
Posted: Fri Aug 30, 2019 1:38 pm
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
Re: Migrate config
Posted: Mon Sep 02, 2019 4:15 am
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.
Re: Migrate config
Posted: Tue Sep 03, 2019 11:45 am
by benjaminsmith
Thanks for all your help.
Your welcome. Did you have any other questions or may we close this thread.
Re: Migrate config
Posted: Wed Sep 04, 2019 10:45 am
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
Re: Migrate config
Posted: Wed Sep 04, 2019 12:55 pm
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