Icinga / icingaweb2-module-director

The Director aims to be your new favourite Icinga config deployment tool. Director is designed for those who want to automate their configuration deployment and those who want to grant their “point & click” users easy access to the configuration.
https://icinga.com/docs/director/latest
GNU General Public License v2.0
413 stars 203 forks source link

ServiceSet import over automation missing host relation #1390

Open mkayontour opened 6 years ago

mkayontour commented 6 years ago

Hi,

I tried to import ServiceSets from a CSV into the director to skip the manual creation process.

Expected Behavior

Create ServiceSets within a SyncRule with a name and a description.

Current Behavior

Getting an error that it cannot be created without a related host.

 A Service Set cannot be an object with no related host

I addition I tried to create a dummy host relation so the ServiceSet will be created, it occurs that ServiceSets will be created but not available in the director webinterface. This error is thrown.

service-set-error

Steps to Reproduce (for bugs)

Try to create a empty ServiceSet over the CLI or in the GUI via SyncRule

icingacli director serviceset create SERVICESET_TEST
ERROR: Icinga\Exception\ProgrammingError in /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaServiceSet.php:290 with message: A Service Set cannot be an object with no related host

Your Environment

mkayontour commented 6 years ago

I found out that they aren't visible in the GUI but on the CLI.

icingacli director servicesets list
SERVICESET_APPL_BHB_1
SERVICESET_APPL_BHB_2
SERVICESET_APPL_BHB_3
SERVICESET_APPL_BHB_4
SERVICESET_APPL_BHB_5
SERVICESET_APPL_BHB_6
SERVICESET_APPL_BHB_7
SERVICESET_APPL_BHB_8

And again it can't be seen over the CLI

 icingacli director serviceset show SERVICESET_APPL_BHB_1
ERROR: Icinga\Exception\NotFoundError in /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php:610 with message: Failed to load icinga_service_set for host_id IS NULL AND object_name = 'SERVICESET_APPL_BHB_1' AND object_type = 'template'
Thomas-Gelf commented 6 years ago

As we talked about this, can you please confirm that the bug here is the broken link in the activity log - and that the rest works fine? In our mails, I strongly suggested to not work around the "link-bug" by creating erroneous objects (read: templates with a host) - did this work out for you?

Thanks, Thomas

LordHepipud commented 6 years ago

Hello,

I just got asked about this issue as well. Here is the summary:

Within the activity log, the URL is wrong. It redirects to

/icingaweb2/director/service_set?name=<service-set-name>

which should be

/icingaweb2/director/servicesset?name=<service-set-name>

For the error with the host relation. The Service Set import works just fine. You will however have to define

object_type = template

as custom expression. Then the Service Set will not fail with the missing 'host' value.

director_service_set

director_service_sets_view