Importing service templates is erractic

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sigmainformatique
Posts: 74
Joined: Mon Apr 23, 2018 8:11 am

Importing service templates is erractic

Post by sigmainformatique »

Hi

I am importing configuration from our old Nagios.
Configuration files were generated with nconf (conf tool of our current nagios install).
I respect the order described in documentation for importing contacts, contacgroups, hosts...

In services template, I have this kind of thing :
templates.cfg :

Code: Select all

define template_0 {
...
}

define template_1 {
...
use generic_template, template_0
...
}

define generic_template {
...
}

define template_2 {
...
use generic_template, template_0
...
}
In this exemple, I obtain the following result in CCM :
template_0, template_2 and generic_templates are OK.
template_1 has only the inhéritence of template_0!!!!

=> The issue is that the import is made in order of the definitions in file!

=> The second issue is that Nagios XI says nothing about this incomplete import during files integration!
Now I have problems with the services that include these incomplete template.


Do I have to sort by myself the hundreds of services template? Why the import procedure does not try to solve and sort template by itself?

The workaround is to import twice the template files, but if I had 4level of inheritance, do I need to import four time the same file?

I think you should correct this issue, because lot of Nagios installation use inheritence nowadays...

Regards
Guillaume
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Importing service templates is erractic

Post by npolovenko »

Hello, @sigmainformatique. I'm not sure if nconf is compatible with the Core 4.4(Newest XI runs on Core 4.4).
What version of Nagios are you exporting the configs from?
Have you considered using the build in Import Config Tool in Core Configurations Manager?
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
*When importing the configs using the Import Tool you need to follow the exact order as shown in the Import Config Files menu.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
sigmainformatique
Posts: 74
Joined: Mon Apr 23, 2018 8:11 am

Re: Importing service templates is erractic

Post by sigmainformatique »

Hello,

Configuration files come from Nagios 3.

I do not think you understand my issue. The issue is not with the import order : I said that the order was respected.

The issue is between service templates.
The import tool do not take care of import dependencies, depending of the order IN the file (as shown in example). And the script purely ignore an inheritance if service template inhérited is after a service template definition.

In other word : the import tool manage only one level of inheritance.

I think it is a critical issue that should be corrected in futur release. Import tool is very important for migrations. Since NagiosV3, the inheritance is a very used feature in companies.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Importing service templates is erractic

Post by lmiltchev »

We haven't been able to recreate the issue in-house. I imported the following configs:

Code: Select all

define service {
  name                            template_0
  use                             generic-template
  max_check_attempts              5
  check_interval                  5
  retry_interval                  1
  notification_options            w,c,u,r,f,
  register                        0
}

define service {
  name                            template_1
  use                             generic-template,template_0
  max_check_attempts              4
  check_interval                  5
  retry_interval                  1
  notification_options            w,c,u,r,f,
  register                        0
}

define service {
    name                            generic-template
    is_volatile                     0
    max_check_attempts              3
    check_interval                  10
    retry_interval                  2
    active_checks_enabled           1
    passive_checks_enabled          1
    check_period                    24x7
    parallelize_check               1
    obsess_over_service             1
    check_freshness                 0
    event_handler_enabled           1
    flap_detection_enabled          1
    process_perf_data               1
    retain_status_information       1
    retain_nonstatus_information    1
    notification_interval           60
    notification_period             24x7
    notification_options            w,u,c,r
    notifications_enabled           1
    contact_groups                  admins
    register                        0
}

define service {
  name                            template_2
  use                             generic-template,template_0
  max_check_attempts              3
  check_interval                  5
  retry_interval                  1
  notification_options            w,c,u,r,f,
  register                        0
}
None of these templates existed on my test XI machine. I imported the configs only ones, and there are no discrepancies whatsoever. Maybe, we are missing something here...

Can you provide us with the actual configs that you are trying to import, so that we could try recreating the issue one more time?
Be sure to check out our Knowledgebase for helpful articles and solutions!
sigmainformatique
Posts: 74
Joined: Mon Apr 23, 2018 8:11 am

Re: Importing service templates is erractic

Post by sigmainformatique »

Hello,

Sorry for the long time to write you back.

So, you're right, in the simple case I put in example the import works for us.

But in our more complicated files, it fails for some template.. Can you provide us a way to send them privately?

We have noticed a big bunch of PHP warnings during import (opened another Thread for that issue).

Another issue in import : some or our hostgroups are directly defined in the "host define block" by using the "hostgroups +..." directive.
If I import using the order defined in import tool, it fails. We must manually define empty hostgroups before importing!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Importing service templates is erractic

Post by lmiltchev »

You can PM me (or anyone else on the Nagios Support team) the configs that fail to import. We will try to recreate the issue in-house, and provide you with a "workaround" (if there is one) or at least point you to the right direction. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked