Nagios Core to Nagios XI Migration - Import Error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
maxiz1987
Posts: 25
Joined: Fri Jun 26, 2015 4:00 am

Nagios Core to Nagios XI Migration - Import Error

Post by maxiz1987 »

Hi Folks,

I am having the following issue that I will describe below and I would appreciate any kind of help that you can bring to me!

Scenario:

- Nagios Core
- New Nagios XI 5 Server

Steps:

I followed the steps from the guides:

fil
https://assets.nagios.com/downloads/nag ... p-Tool.pdf

https://assets.nagios.com/downloads/nag ... ios-XI.pdf


Issue:

- Most of the services are defined as templates since they are common between many of the servers.
- I have followed the order in which all files should have be imported
- All of the services templates are OK
- However when I import the services from a host that uses services templates, the services are not imported, I only see a service with the file template and it is empty.
- How file looks like after using pre import tool:

Code: Select all


define service{
use                             ping
host_name                       srv_metroweb
check_period                    24x7
contact_groups                  sdi, operadores
_sin_dashboard                  1
_sin_service                    INFO
_sin_environ                    INFR
_sin_group                      SDI
}
define service{
use                             generic-nt-process-java
host_name                       srv_metroweb
check_period                    24x7
contact_groups                  sdi
_sin_dashboard                  1
_sin_service                    INFO
_sin_environ                    INFR
_sin_group                      SDI
}
define service{
use                             generic-nt-service-nds
host_name                       srv_metroweb
check_period                    24x7
contact_groups                  sdi
_sin_dashboard                  1
_sin_service                    INFO
_sin_environ                    INFR
_sin_group                      SDI
}
define service{
use                             generic-nt-service-termsrvc
host_name                       srv_metroweb
check_period                    24x7
contact_groups                  sdi
_sin_dashboard                  1
_sin_service                    INFO
_sin_environ                    INFR
_sin_group                      SDI
}
"srv_metroweb.cfg" 40L, 1340C



I have attached many screen shots in order to provide a guide to it.

I don't understand why this is happening... When I import hosts that don't use service templates but they have the check command defined on its file the import is OK.

Regards,
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Core to Nagios XI Migration - Import Error

Post by tgriep »

Can you post your original config file, before you ran the Prep tool so we can view it?
There may be an invalid character, etc that is stripping the required fields when the prep is run against it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core to Nagios XI Migration - Import Error

Post by lmiltchev »

It seems like the "service_description" directive is missing from these service definition... It is mandatory:
https://assets.nagios.com/downloads/nag ... ml#service

I would recommend running the Write Config Files tool after each of the import steps
commands -> timeperiods -> contacttemplates -> contacts -> contactgroups ->
hosttemplates -> hosts -> hostgroups -> servicetemplates -> services -> servicegroups
just to make sure you don't have any config errors before proceeding further.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios Core to Nagios XI Migration - Import Error

Post by ssax »

What is the error you are getting?

Based on the information provided it looks like it's doing it properly, let's use this as an example:

Code: Select all

define service{
use                             ping
host_name                       srv_metroweb
check_period                    24x7
contact_groups                  sdi, operadores
_sin_dashboard                  1
_sin_service                    INFO
_sin_environ                    INFR
_sin_group                      SDI
}
When you import that it will create a service with:
- A blank service description
- The ping service template selected under Manage Templates
- The check_period defined under the Check Settings tab
- The contactgroup defined under the Alert Settings Tab > Manage Contactgroups
- Your _variables in the Misc Settings tab > Manage Variable Definitions

Is that not doing that for you or am I missing something?

Thank you
maxiz1987
Posts: 25
Joined: Fri Jun 26, 2015 4:00 am

Re: Nagios Core to Nagios XI Migration - Import Error

Post by maxiz1987 »

ssax wrote:What is the error you are getting?

Based on the information provided it looks like it's doing it properly, let's use this as an example:

Code: Select all

define service{
use                             ping
host_name                       srv_metroweb
check_period                    24x7
contact_groups                  sdi, operadores
_sin_dashboard                  1
_sin_service                    INFO
_sin_environ                    INFR
_sin_group                      SDI
}
When you import that it will create a service with:
- A blank service description
- The ping service template selected under Manage Templates
- The check_period defined under the Check Settings tab
- The contactgroup defined under the Alert Settings Tab > Manage Contactgroups
- Your _variables in the Misc Settings tab > Manage Variable Definitions

Is that not doing that for you or am I missing something?

Thank you
------------------------------


Hi ssax! Thanks for answering on my post!

As you said when I import it it does the following:

- A blank service description
- The ping service template selected under Manage Templates
- The check_period defined under the Check Settings tab
- The contactgroup defined under the Alert Settings Tab > Manage Contactgroups
- Your _variables in the Misc Settings tab > Manage Variable Definitions

However, I see the ping service templated selected under manage templates but it doesn't load the information from the template.

I would expect that it loads the config name, the check command, the arguments of the commands, etc

Do I explain myself? I just see on manage template the service template but I don't see that this loads the information from the service template.

Regards,
maxiz1987
Posts: 25
Joined: Fri Jun 26, 2015 4:00 am

Re: Nagios Core to Nagios XI Migration - Import Error

Post by maxiz1987 »

lmiltchev wrote:It seems like the "service_description" directive is missing from these service definition... It is mandatory:
https://assets.nagios.com/downloads/nag ... ml#service

I would recommend running the Write Config Files tool after each of the import steps
commands -> timeperiods -> contacttemplates -> contacts -> contactgroups ->
hosttemplates -> hosts -> hostgroups -> servicetemplates -> services -> servicegroups
just to make sure you don't have any config errors before proceeding further.

Hi lmiltchev!

I would expect that the service description were loaded from the command template as in this way works on Nagios Core. Doesn't it works on the same way on Nagios XI?

Regards,
maxiz1987
Posts: 25
Joined: Fri Jun 26, 2015 4:00 am

Re: Nagios Core to Nagios XI Migration - Import Error

Post by maxiz1987 »

tgriep wrote:Can you post your original config file, before you ran the Prep tool so we can view it?
There may be an invalid character, etc that is stripping the required fields when the prep is run against it.
Hi tgriep!

This is the original file from the cfg:

Code: Select all

define service{
use                             ping
host_name                       srv_metroweb
check_period                    24x7
contact_groups                  sdi, operadores
_sin_dashboard                  1
_sin_service                    INFO
_sin_environ                    INFR
_sin_group                      SDI
}
define service{
use                             generic-nt-process-java
host_name                       srv_metroweb
check_period                    24x7
contact_groups                  sdi
_sin_dashboard                  1
_sin_service                    INFO
_sin_environ                    INFR
_sin_group                      SDI
}
define service{
use                             generic-nt-service-nds
host_name                       srv_metroweb
check_period                    24x7
contact_groups                  sdi
_sin_dashboard                  1
_sin_service                    INFO
_sin_environ                    INFR
_sin_group                      SDI
}
define service{
use                             generic-nt-service-termsrvc
host_name                       srv_metroweb
check_period                    24x7
contact_groups                  sdi
_sin_dashboard                  1
_sin_service                    INFO
_sin_environ                    INFR
_sin_group                      SDI
}
"srv_metroweb.cfg" 40L, 1340C
maxiz1987
Posts: 25
Joined: Fri Jun 26, 2015 4:00 am

Re: Nagios Core to Nagios XI Migration - Import Error

Post by maxiz1987 »

Hi All!

This is an example of my service template:

Code: Select all

define service{
        name                            ping ; The 'name' of this service template
        active_checks_enabled           1       ; Active service checks are enabled
        passive_checks_enabled          1       ; Passive service checks are enabled/accepted
        parallelize_check               1       ; Active service checks should be parallelized (disabling this can lead to major performance problems)
        obsess_over_service             1       ; We should obsess over this service (if necessary)
        check_freshness                 0       ; Default is to NOT check service 'freshness'
        notifications_enabled           1       ; Service notifications are enabled
        event_handler_enabled           1       ; Service event handler is enabled
        flap_detection_enabled          1       ; Flap detection is enabled
        failure_prediction_enabled      1       ; Failure prediction is enabled
        process_perf_data               1       ; Process performance data
        retain_status_information       1       ; Retain status information across program restarts
        retain_nonstatus_information    1       ; Retain non-status information across program restarts
        register                        0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
        is_volatile                     0
        max_check_attempts              1
        normal_check_interval           1
        retry_check_interval            1
	notification_options		c,r
        notification_interval           960
        notification_period             24x7
        service_description             SO : PING
	check_command			check_ping!300.0,40%!800.0,80%
        }

# EOF
And this is an example of my Host/Service .cfg:

Code: Select all

define host{
        use                     generic-host            ; Name of host template to use
        host_name               srv_metroweb
        alias                   srv_metroweb
        address                 10.20.230.105
        check_command           check-host-alive
        max_check_attempts      4
        check_period            24x7
        notification_interval   120
        notification_period     24x7
        notification_options    d,r
        contact_groups          sdi, operadores
        }

#####################################################################################
# Generic Windows MG
#####################################################################################

define service{
        use                             ping
        host_name                       srv_metroweb
        check_period                    24x7
        contact_groups                  sdi, operadores
        _sin_dashboard                  1
        _sin_service                    INFO
        _sin_environ                    INFR
        _sin_group                      SDI
        }
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios Core to Nagios XI Migration - Import Error

Post by ssax »

When you apply configuration it should show the template information on the service, it won't add it to the service definition in Configure > Core Config Manager > Services when importing, it only will apply it at run-time.

Please look at the service definition after applying configuration in /usr/local/nagios/var/objects.cache and you should see them defined.
maxiz1987
Posts: 25
Joined: Fri Jun 26, 2015 4:00 am

Re: Nagios Core to Nagios XI Migration - Import Error

Post by maxiz1987 »

I have figured out what it is.

service_description is a mandatory field and the service does not inherit it from the template - so if you don't add it, the import tool load an empty service.

This thread can be closed.

Regards,
Locked