centreon / nagiosToCentreon

Import your nagios config files into Centreon DB... And it rocks !
Apache License 2.0
9 stars 13 forks source link

Script adding generic parent template name when no parent template is set #46

Closed larkoie closed 6 years ago

larkoie commented 6 years ago

Hi,

I had to migrate from Nagios to Centreon and found your script that is working very well and saved me tonnes of time (thanks a lot for your work btw).

However I found a little bug that took me time to resolve: When you have a template item (ex: Host template; service template etc...) which has no "Parent templates" set, the script will generate a generic parent templates name (ex: generic-active-service-custom; generic-active-host-custom) instead of letting this setting blank (;; in the export file).

When importing the file it will results in errors like "Line 1448 : Object not found:generic-active-host-custom" on the "parent-less" host or service template and they will not be created (resulting in more "Object not found" occurrence).

Examples of CLAPI import commands: Script generated = HTPL;ADD;EU_Host;EU Host;;generic-active-host-custom;; Should have been = HTPL;ADD;EU_Host;EU Host;;;; (See attached files for the corresponding Centreon view)

2017-11-28 11_27_11-settings

Hope this will help a few centreon admin.

Cheers

cgagnaire commented 6 years ago

Hi @larkoie, Well this is not a bug but a feature ;) It was made for people using the free Plugin Packs available in any installation from 2.8 version. And also to not have those "parent-less" hosts as its not in the best pratices. But I can see that it can be counterproductive. I might remove that feature or put it as a option. Thanks for your feedback!