Hello,
i want to sync services via Director.
1. scenario: assign-filter
The importsource delivers the "import template name" and the "assign-filter"
2. scenario: hostname
The importsource delivers the "import template name" and the "hostname"
Neither 1 nor 2 i'm able to create
1. scenario
===========
Importsource
-------------
a file (fileshipper) or databasetable (mysql) with:
id; service_template; assign_where
1; check_1_template; host.vars.os==Windows
Key column name: id
sync rule
---------
properties Source field -> Destination:
${service_template} -> import
${assign_where} -> assign_filter
apply -> object_type
On sync I get:
Undefined variable: hasServiceSet
Even if i introduce an "object_name" i got this error.
2. scenario
===========
Importsource
------------
a file (fileshipper) or databasetable (mysql) with:
id; service; service_template; host_name
1; d1; check_2_template; hostA
2; d1; check_2_template; hostB
Key column name: id
sync rule
----------
${service} ->object_name
{service_template} -> import
{host_name} -> host
on first sync i got as expected:
object Service "d1" {
host_name = "hostA"
import "check_2_template"
}
object Service "d1" {
host_name = "hostB"
import "check_2_template"
}
on second sync i got
"Exception while syncing Icinga\Module\Director\IcingaService d1:
Storing icinga_service[] failed: SQLSTATE[23000]: Integrity constraints
violadtion: 1062 Duplicate entry 'd1-1' for key 'object_key'..."
But the database icinga_servcei is showing no "d1-1":
select id,object_name, oibject_type from icinga_service;
11 d1 object
12 d1 object
How do I import services via Director?
Regards
Tilo Mey
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users