importing service files

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ab3pu
Posts: 54
Joined: Fri Sep 30, 2016 1:51 pm

importing service files

Post 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.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: importing service files

Post 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.
Previous Nagios employee
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: importing service files

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: importing service files

Post 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!
Former Nagios employee
ab3pu
Posts: 54
Joined: Fri Sep 30, 2016 1:51 pm

Re: importing service files

Post by ab3pu »

Problem Solved....Thanks All
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: importing service files

Post 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!
Locked