Page 1 of 1

importing service files

Posted: Thu Oct 20, 2016 11:06 am
by ab3pu
I am moving a NAGIOS 4 configuration to NAGIOS XI. I have used the import tool and created a new service file.


Device_1.cfg

Code: Select all

define service{
use					network-service-ping
host_name				Device_1
}
define service{
use					check_apc_pdu_alarms
host_name				Device_1
}
Once imported I review the services file and find:

/usr/local/nagios/etc/services/Device_1.cfg

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.0
# Date:	      2016-10-20 11:49:31
# Version:    Nagios 3.x config file
#
# --- 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.
#
###############################################################################

define service {
	host_name			Device_1
	use				check_apc_pdu_alarms
	register			1
	}	

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
This seems to happen on all multi-service files regardless of the type of service.

Thanks in advance for any help.

Re: importing service files

Posted: Thu Oct 20, 2016 4:05 pm
by avandemore
Please review the Service Object Definitions.

Your example service definition is invalid and Nagios will never be able to work with it without a proper base definition.

Re: importing service files

Posted: Fri Oct 21, 2016 2:05 pm
by gormank
It seems you have 2 definitions of the same service. When imported, the first creates the service if it doesn't exist, and the second updates with info from the second definition. You can test by reversing the order and importing again. Having multiple services in one or more imported files doesn't seem to be a factor.
The validity of the service definitions is dependent on the templates, which aren't included.

Re: importing service files

Posted: Fri Oct 21, 2016 2:31 pm
by tmcdonald
gormank wrote:It seems you have 2 definitions of the same service. When imported, the first creates the service if it doesn't exist, and the second updates with info from the second definition. You can test by reversing the order and importing again. Having multiple services in one or more imported files doesn't seem to be a factor.
The validity of the service definitions is dependent on the templates, which aren't included.
Thanks for the assist!

Re: importing service files

Posted: Thu Oct 27, 2016 1:22 pm
by ab3pu
Problem Solved....Thanks All

Re: importing service files

Posted: Thu Oct 27, 2016 1:26 pm
by dwhitfield
Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!