Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #2743] Config: Implement conversion script (1.x -> 2.0) #147

Closed
icinga-migration opened this issue Jun 28, 2012 · 16 comments
Labels
enhancement New feature or request

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/2743

Created by gbeutner on 2012-06-28 12:25:23 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2013-06-24 16:08:22 +00:00)
Target Version: Milestone 1.x Compat
Last Update: 2014-09-16 09:10:37 +00:00 (in Redmine)


Changesets

2013-03-12 20:32:39 +00:00 by (unknown) ede3558e078fd1f9bc6dc732f0490aa0b05970c6

convertv1->v2 initial import

refs #2743

2013-03-12 20:48:29 +00:00 by (unknown) 7d2637e963c13148371f6b7485c3840a61d139a0

Config Conversion: command macros, templates

refs #2743

2013-03-15 16:09:56 +00:00 by (unknown) 4c19577851dd7e9a933cfeb412277e7b706329ba

WIP configconversion: rewrite recursive lookup of linked host_name/service_description

this is a mess. configs may just use "name" instead of "host_name" on
type "host", same goes for service and service_descriptions. well, and
if it's a template, "name" is populated too.

the algorithm is not clean enough, and does not scale at all. there are
bugs, and the hostgroup linking is not yet taken into account too.

basics host -> service dumping of v2 config is implemented.

refs #2743

2013-04-08 09:19:47 +00:00 by (unknown) ab0dd44adb398c47e6a9c90b425d7f6a1258d764

WIP configconversion: rewrite recursive lookup of linked host_name/service_description

this is a mess. configs may just use "name" instead of "host_name" on
type "host", same goes for service and service_descriptions. well, and
if it's a template, "name" is populated too.

the algorithm is not clean enough, and does not scale at all. there are
bugs, and the hostgroup linking is not yet taken into account too.

basics host -> service dumping of v2 config is implemented.

refs #2743

2013-04-08 09:19:47 +00:00 by (unknown) cf6304bcc263f8fe89d3f6a5a91cf351114a6164

Config Conversion: command macros, templates

refs #2743

2013-04-08 09:19:47 +00:00 by (unknown) 60d4badb9d09944f11de8c6bf5b6bb92a7263990

convertv1->v2 initial import

refs #2743

2013-04-08 09:19:48 +00:00 by (unknown) c4a0fead64ccf1e4a4e6b6235d0cdb28e7470cf8

ConfigConvert: refactor host_name/service_description link resolving

previous algorithm was buggy, as well get_host_name always looked up
host template objects, even if the template object was a service. this
is now fixed by re-using the __TYPE attribute (set on Icinga 1x config
read).

the algorithm is now like

                       |---------------------------------|
                      \/                                 |
                   svc_desc?                             |
                0 /        \ 1                           |
              use tmpl?    END -------> [svc_desc]       |
             0 /   \ 1                                   |
[undef] <- BROKEN  getobjbyattr(['use'], __TYPE, svcdesc |
                    |                                    |
                 getsvcdesc(obj)                         |
                    |                                    |
                    --------------------------------------

refs #2743

2013-04-08 09:19:49 +00:00 by (unknown) 5d2a15c3f446577190121552eaba74d6171d5c67

ConfigConvert: *interval, max_check_attempts dumped as numbers

see
https://git.icinga.org/?p=icinga2.git;a=blob_plain;f=lib/icinga/icinga-type.conf;hb=HEAD

refs #2743

2013-04-08 09:19:49 +00:00 by (unknown) 8d8890845de4f291b59cefe9c436ef465aee2986

ConfigConvert: refactor host-svc links, add full service/usergroup relinking

due to the relinking afterwards we actually modify the service objects
already prepared for 2x. since the *group magic depends on the
host/services/users already prepared, we get a perpetuum mobile here
with the host loop and resolving service relations.

in order to safely fix the issue, there's a seperate host-service link
loop after resolving all the other needed objects, which may cost a
little bit more performance, but is safe and standalone, getting all
previous modifications, migrations and also hacks.

next to the refactored flow, the issue with resolving the correct
servicegroups and stashing them into an array is solved, as well as
converting the existing contactgroups to usergroups, as well as
re-linking existing contactgroup->members to their new home,
user->usergroups.

note: when parsing the servicegroup members into an array, it must not
be sorted afterwards, because we will shift 2 objects (host, service) in
order to identify the correct service object for adding the servicegroup
item.

some code reorganisation too, plus a minor comma fix for the host
address macro.

the used 1x configuration will be addressed in 2743.cfg on
icinga-core.git, with all future additions.

refs #2743

2013-04-08 09:19:49 +00:00 by (unknown) 61d6203fe7b1dfdb5679480227a39a09d04ab3b1

ConfigConvert: refactor multiple host_name's on service object detection

this is ugly. a service object may contain 'host_name' with
'host1,host2,host3' and so on. treating this as string won't allow us to
look into the template tree for valid host attributes, so we need to
rewrite the getter function, allowing some special treatment on
host_name arrays.

for the service object preparation this means: while in the service
loop, we need to loop again over all hosts, then dclone the hashref
object for the service, and add the unique host_name attribute again.

we might require some loop unrolling later, but for now this works as
expected.

refs #2743

2013-04-08 09:19:49 +00:00 by (unknown) 4ca947a5877a8601cbe4c822b6ffcf95958ccda7

ConfigConvert: fix service linking not unique, add hostgroup->members re-link to host->hostgroups

while working on the missing servicegroups and their facepalm members
syntax (host1,svc1,host2,svc2 - awesome to parse), i figured that the
whole detection of services by their attribute 'service_description' is
not uniquely implemented. now the getter functions are duplicated, and
not modular anymore, for the sake of having a service identified by its
host_name + service_description. since that lookup is recursive, we must
pass the host_name from the very beginning - otherwise we could
accidently overwrite that with a template entry.

the hostgroup re-linking works, also thanks to the fact that the inner
object structure is just an array in the hashref, which allows smart
push.

contact/user groups are tricky again due to the different naming.

further todo: sort all macros and hostservice links. right now this
looks like chaos.

refs #2743

2013-04-08 09:19:49 +00:00 by (unknown) b3796b98b1ac303800a652c5adcfa5bb2906df68

ConfigConvert: add more host/service attributes, groups

*_interval are automatically mapped, while the *groups attribute it
converted into an array in order to easily stash more groups on it.

still a todo - loop over existing groups and re-link their members into
the respective objects, as 2.x only supports that location.

fix for the host->service relation - use the already processed service
2x hashref in order to do some magic with host->{'SERVICE'} = service

all 2x attributes are now encapsulated with "", to stay safe.
todo - more generic config 2x dump.

furthermore, add some more code comments for the respective sections.

refs #2743

2013-04-08 09:19:49 +00:00 by (unknown) 7ee1298a4fb2180b7776cbddb1b75dc4aedaa380

ConfigConvert: fix 4 little big thinkos on import/convert/dump

1) do not skip lines containing ;.* - there may actually be a comment on
attr->val line. rather clean the line safely, and let the magic happen.

2) the type counter was implemented in order to have unique object ids
by type, since 1x config does not provide us with such. problem - the
function had a local var, saving the counter for each file, overwriting
the hash attributes later on, starting again with 0. nasty bug, hard to
figure out. fixed by feeding the type_cnt into the cfg_obj hive for now.
revamped the state machine logic as well, like so

I: define TYPE { 	--> __TYPE = TYPE
II: attr val		--> {type}->{type_cnt->cnt}->{attr} = val
III: }			--> type_cnt->cnt++
IV: <empty/comment>

3) also skip service templates (__IS_TEMPLATE) sooner, and do not try to
calculate some host_name/service_description magic out of them - they
just can't go down one level to the host, but only up with 'use'.

4) host and service templates on 2x config dump must check if
__USES_TEMPLATE is actually set to 1, checking for defined is not
enough.

whatthecommit.com:

A long time ago, in a galaxy far far away...

refs #2743

2013-04-08 09:19:50 +00:00 by (unknown) 84162a4daa6fafb96d65dc704c562fb914bd9f6e

ConfigConvert: fix undocumented contact templates conversion

refs #2743

2013-05-03 13:52:22 +00:00 by (unknown) 1d4a69330f85a88b02930615923b036c4a9acb16

WIP configconversion: rewrite recursive lookup of linked host_name/service_description

this is a mess. configs may just use "name" instead of "host_name" on
type "host", same goes for service and service_descriptions. well, and
if it's a template, "name" is populated too.

the algorithm is not clean enough, and does not scale at all. there are
bugs, and the hostgroup linking is not yet taken into account too.

basics host -> service dumping of v2 config is implemented.

refs #2743

2013-05-03 13:52:22 +00:00 by (unknown) 446707f3405ecc881581537ee97a709ad0fac36d

Config Conversion: command macros, templates

refs #2743

2013-05-03 13:52:22 +00:00 by (unknown) 9861b74f55918b3b43e6c81e8793b74fd7571ac6

convertv1->v2 initial import

refs #2743

2013-05-03 13:52:23 +00:00 by (unknown) fdf244a67c9d185bcfd2c0e6233da9ef6588df35

ConfigConvert: *interval, max_check_attempts dumped as numbers

see
https://git.icinga.org/?p=icinga2.git;a=blob_plain;f=lib/icinga/icinga-type.conf;hb=HEAD

refs #2743

2013-05-03 13:52:23 +00:00 by (unknown) 496cea45be1f0d15d35c72f56d1628084e0d35be

ConfigConvert: refactor host-svc links, add full service/usergroup relinking

due to the relinking afterwards we actually modify the service objects
already prepared for 2x. since the *group magic depends on the
host/services/users already prepared, we get a perpetuum mobile here
with the host loop and resolving service relations.

in order to safely fix the issue, there's a seperate host-service link
loop after resolving all the other needed objects, which may cost a
little bit more performance, but is safe and standalone, getting all
previous modifications, migrations and also hacks.

next to the refactored flow, the issue with resolving the correct
servicegroups and stashing them into an array is solved, as well as
converting the existing contactgroups to usergroups, as well as
re-linking existing contactgroup->members to their new home,
user->usergroups.

note: when parsing the servicegroup members into an array, it must not
be sorted afterwards, because we will shift 2 objects (host, service) in
order to identify the correct service object for adding the servicegroup
item.

some code reorganisation too, plus a minor comma fix for the host
address macro.

the used 1x configuration will be addressed in 2743.cfg on
icinga-core.git, with all future additions.

refs #2743

2013-05-03 13:52:23 +00:00 by (unknown) 392d00b557da1c047e2fdb422306f0ebc73c690e

ConfigConvert: refactor multiple host_name's on service object detection

this is ugly. a service object may contain 'host_name' with
'host1,host2,host3' and so on. treating this as string won't allow us to
look into the template tree for valid host attributes, so we need to
rewrite the getter function, allowing some special treatment on
host_name arrays.

for the service object preparation this means: while in the service
loop, we need to loop again over all hosts, then dclone the hashref
object for the service, and add the unique host_name attribute again.

we might require some loop unrolling later, but for now this works as
expected.

refs #2743

2013-05-03 13:52:23 +00:00 by (unknown) 3becb39f625ab99b2cb448cc8c2bf11d7021eb51

ConfigConvert: fix service linking not unique, add hostgroup->members re-link to host->hostgroups

while working on the missing servicegroups and their facepalm members
syntax (host1,svc1,host2,svc2 - awesome to parse), i figured that the
whole detection of services by their attribute 'service_description' is
not uniquely implemented. now the getter functions are duplicated, and
not modular anymore, for the sake of having a service identified by its
host_name + service_description. since that lookup is recursive, we must
pass the host_name from the very beginning - otherwise we could
accidently overwrite that with a template entry.

the hostgroup re-linking works, also thanks to the fact that the inner
object structure is just an array in the hashref, which allows smart
push.

contact/user groups are tricky again due to the different naming.

further todo: sort all macros and hostservice links. right now this
looks like chaos.

refs #2743

2013-05-03 13:52:23 +00:00 by (unknown) ba8584eba43bfce71cdcf0737e52366e466963f0

ConfigConvert: add more host/service attributes, groups

*_interval are automatically mapped, while the *groups attribute it
converted into an array in order to easily stash more groups on it.

still a todo - loop over existing groups and re-link their members into
the respective objects, as 2.x only supports that location.

fix for the host->service relation - use the already processed service
2x hashref in order to do some magic with host->{'SERVICE'} = service

all 2x attributes are now encapsulated with "", to stay safe.
todo - more generic config 2x dump.

furthermore, add some more code comments for the respective sections.

refs #2743

2013-05-03 13:52:23 +00:00 by (unknown) 0ad145fdb350787942d8939ece5c10cef1d30641

ConfigConvert: fix 4 little big thinkos on import/convert/dump

1) do not skip lines containing ;.* - there may actually be a comment on
attr->val line. rather clean the line safely, and let the magic happen.

2) the type counter was implemented in order to have unique object ids
by type, since 1x config does not provide us with such. problem - the
function had a local var, saving the counter for each file, overwriting
the hash attributes later on, starting again with 0. nasty bug, hard to
figure out. fixed by feeding the type_cnt into the cfg_obj hive for now.
revamped the state machine logic as well, like so

I: define TYPE { 	--> __TYPE = TYPE
II: attr val		--> {type}->{type_cnt->cnt}->{attr} = val
III: }			--> type_cnt->cnt++
IV: <empty/comment>

3) also skip service templates (__IS_TEMPLATE) sooner, and do not try to
calculate some host_name/service_description magic out of them - they
just can't go down one level to the host, but only up with 'use'.

4) host and service templates on 2x config dump must check if
__USES_TEMPLATE is actually set to 1, checking for defined is not
enough.

whatthecommit.com:

A long time ago, in a galaxy far far away...

refs #2743

2013-05-03 13:52:23 +00:00 by (unknown) 5bfc2ccaef80c9d173aa804f9699630b8bc511ca

ConfigConvert: refactor host_name/service_description link resolving

previous algorithm was buggy, as well get_host_name always looked up
host template objects, even if the template object was a service. this
is now fixed by re-using the __TYPE attribute (set on Icinga 1x config
read).

the algorithm is now like

                       |---------------------------------|
                      \/                                 |
                   svc_desc?                             |
                0 /        \ 1                           |
              use tmpl?    END -------> [svc_desc]       |
             0 /   \ 1                                   |
[undef] <- BROKEN  getobjbyattr(['use'], __TYPE, svcdesc |
                    |                                    |
                 getsvcdesc(obj)                         |
                    |                                    |
                    --------------------------------------

refs #2743

2013-05-03 13:52:24 +00:00 by (unknown) 82f242bb16e3193e174ae149a2e4d68598ac3038

configconvert: support 'name' for groups' if *group_name is not set

this is a fallback for broken configs only, and since i got some, added
a small fix.

refs #2743

2013-05-03 13:52:24 +00:00 by (unknown) 937f78580a9c769abc50261b83d32f0375d20117

configconvert: fix multiple templates usage, template object lookup error

multiple host/service templates seperated by commas will cause some
irritation, therefore this is treated as array internally, like group
members. for the config export and "inherits", this is easy to fix. for
the actual host_name lookup for service objects, this unveiled another
bug when looping through all available templates - they are unique by
'name' and not by hostname/servicedesc, and require their very own
getter - obj_get_tmpl_obj_by_tmpl_name() - which makes sure to return
the object which is then looked into recursively if there's a host_name
provided.

possible bug for now - multiple service templates used and the host_name is
defined in one of them. but that's not the usual case, and won't be
supported for now.

refs #2743
fixes #3932

2013-05-03 13:52:24 +00:00 by (unknown) 61d39a073c53714ad65db7a50362203125e25cb5

ConfigConvert: fix undocumented contact templates conversion

refs #2743

2013-05-03 13:52:25 +00:00 by (unknown) 0e1963c40e8ff3a3e7d81eafda67f20975a84674

configconvert: refactor service-hg-hosts for one hosthg template and multiple services

we need to first loop over all services, getting the key ids, collecting
them for each hostgroup_name (this is the unique identifier, because
this is our hosthg template later on).

then we loop over the collected unique hostgroups and build the 2.x
template logic. the difference here is now, that the code is refactored,
and loops over the service keys (getting their objects) only once,
pushing their templates plus a relation to a single (1) hosthg-template.

there's still some space for enhancements - the service template names
as well as hosthg template names as well as service object names are
generated with some hardcoded strings/numbers.

refs #2743
refs #4016

2013-05-03 13:52:25 +00:00 by (unknown) f3cdb895b5b44e773404893bed3c85a5af9a11e9

configconvert: add service->hostgroup<-hostmembers conversion to template support

WIP: there's multiple service->hostgroup relations - duplicated hosthg
templates. must be fixed.

refs #2743
refs #4016

2013-05-03 13:52:26 +00:00 by (unknown) 2bf990cd341de5aad30e162ef3bb57e620c4fa11

configconvert: update requirements, perl deps

refs #2743

2013-05-03 13:52:26 +00:00 by (unknown) 7ae9ee82710eeb14c31e8e7be5217c45957050d5

configconvert: add small main config file for standalone tests

refs #2743

2013-05-03 13:52:27 +00:00 by (unknown) 0c28da2c0149ff273f6899a21bf7d4826465a53b

configconvert: export check_period for hosts/services

refs #2743

2013-05-28 18:27:50 +00:00 by (unknown) 4a6c13029b68f8a150e8baae799ce1114186c47a

convertv1->v2 initial import

refs #2743

2013-05-28 18:27:51 +00:00 by (unknown) 51fad8355cf40d9799a7a8624dd5f43f81bca2b7

Config Conversion: command macros, templates

refs #2743

2013-05-28 18:27:51 +00:00 by (unknown) 016482e820b266960564602d4d2b2eb4309655a8

WIP configconversion: rewrite recursive lookup of linked host_name/service_description

this is a mess. configs may just use "name" instead of "host_name" on
type "host", same goes for service and service_descriptions. well, and
if it's a template, "name" is populated too.

the algorithm is not clean enough, and does not scale at all. there are
bugs, and the hostgroup linking is not yet taken into account too.

basics host -> service dumping of v2 config is implemented.

refs #2743

2013-05-28 18:27:51 +00:00 by (unknown) a2844899d7d788dfc93e710cd66a9e649df516a7

ConfigConvert: refactor host_name/service_description link resolving

previous algorithm was buggy, as well get_host_name always looked up
host template objects, even if the template object was a service. this
is now fixed by re-using the __TYPE attribute (set on Icinga 1x config
read).

the algorithm is now like

                       |---------------------------------|
                      \/                                 |
                   svc_desc?                             |
                0 /        \ 1                           |
              use tmpl?    END -------> [svc_desc]       |
             0 /   \ 1                                   |
[undef] <- BROKEN  getobjbyattr(['use'], __TYPE, svcdesc |
                    |                                    |
                 getsvcdesc(obj)                         |
                    |                                    |
                    --------------------------------------

refs #2743

2013-05-28 18:27:51 +00:00 by (unknown) ee8db4aca62241de236d7e4bf737f45059bf5f91

ConfigConvert: fix 4 little big thinkos on import/convert/dump

1) do not skip lines containing ;.* - there may actually be a comment on
attr->val line. rather clean the line safely, and let the magic happen.

2) the type counter was implemented in order to have unique object ids
by type, since 1x config does not provide us with such. problem - the
function had a local var, saving the counter for each file, overwriting
the hash attributes later on, starting again with 0. nasty bug, hard to
figure out. fixed by feeding the type_cnt into the cfg_obj hive for now.
revamped the state machine logic as well, like so

I: define TYPE { 	--> __TYPE = TYPE
II: attr val		--> {type}->{type_cnt->cnt}->{attr} = val
III: }			--> type_cnt->cnt++
IV: <empty/comment>

3) also skip service templates (__IS_TEMPLATE) sooner, and do not try to
calculate some host_name/service_description magic out of them - they
just can't go down one level to the host, but only up with 'use'.

4) host and service templates on 2x config dump must check if
__USES_TEMPLATE is actually set to 1, checking for defined is not
enough.

whatthecommit.com:

A long time ago, in a galaxy far far away...

refs #2743

2013-05-28 18:27:51 +00:00 by (unknown) 53d61a2837adfbeec5d7d4c718e6b59f1cf5843b

ConfigConvert: add more host/service attributes, groups

*_interval are automatically mapped, while the *groups attribute it
converted into an array in order to easily stash more groups on it.

still a todo - loop over existing groups and re-link their members into
the respective objects, as 2.x only supports that location.

fix for the host->service relation - use the already processed service
2x hashref in order to do some magic with host->{'SERVICE'} = service

all 2x attributes are now encapsulated with "", to stay safe.
todo - more generic config 2x dump.

furthermore, add some more code comments for the respective sections.

refs #2743

2013-05-28 18:27:52 +00:00 by (unknown) 2229a0dbc1b5f8fa5ce2a9f8dc3ddec94237fd7f

ConfigConvert: fix service linking not unique, add hostgroup->members re-link to host->hostgroups

while working on the missing servicegroups and their facepalm members
syntax (host1,svc1,host2,svc2 - awesome to parse), i figured that the
whole detection of services by their attribute 'service_description' is
not uniquely implemented. now the getter functions are duplicated, and
not modular anymore, for the sake of having a service identified by its
host_name + service_description. since that lookup is recursive, we must
pass the host_name from the very beginning - otherwise we could
accidently overwrite that with a template entry.

the hostgroup re-linking works, also thanks to the fact that the inner
object structure is just an array in the hashref, which allows smart
push.

contact/user groups are tricky again due to the different naming.

further todo: sort all macros and hostservice links. right now this
looks like chaos.

refs #2743

2013-05-28 18:27:52 +00:00 by (unknown) 6c45a76cabda3db497ba9a7bc575b9ac4a945b1f

ConfigConvert: refactor multiple host_name's on service object detection

this is ugly. a service object may contain 'host_name' with
'host1,host2,host3' and so on. treating this as string won't allow us to
look into the template tree for valid host attributes, so we need to
rewrite the getter function, allowing some special treatment on
host_name arrays.

for the service object preparation this means: while in the service
loop, we need to loop again over all hosts, then dclone the hashref
object for the service, and add the unique host_name attribute again.

we might require some loop unrolling later, but for now this works as
expected.

refs #2743

2013-05-28 18:27:52 +00:00 by (unknown) 8131a3188d75b70df6899c395c41aac5ff55b92a

ConfigConvert: refactor host-svc links, add full service/usergroup relinking

due to the relinking afterwards we actually modify the service objects
already prepared for 2x. since the *group magic depends on the
host/services/users already prepared, we get a perpetuum mobile here
with the host loop and resolving service relations.

in order to safely fix the issue, there's a seperate host-service link
loop after resolving all the other needed objects, which may cost a
little bit more performance, but is safe and standalone, getting all
previous modifications, migrations and also hacks.

next to the refactored flow, the issue with resolving the correct
servicegroups and stashing them into an array is solved, as well as
converting the existing contactgroups to usergroups, as well as
re-linking existing contactgroup->members to their new home,
user->usergroups.

note: when parsing the servicegroup members into an array, it must not
be sorted afterwards, because we will shift 2 objects (host, service) in
order to identify the correct service object for adding the servicegroup
item.

some code reorganisation too, plus a minor comma fix for the host
address macro.

the used 1x configuration will be addressed in 2743.cfg on
icinga-core.git, with all future additions.

refs #2743

2013-05-28 18:27:52 +00:00 by (unknown) 51cb2c00b0aff9f910e790cc44c73e1d5427f9ff

ConfigConvert: *interval, max_check_attempts dumped as numbers

see
https://git.icinga.org/?p=icinga2.git;a=blob_plain;f=lib/icinga/icinga-type.conf;hb=HEAD

refs #2743

2013-05-28 18:27:52 +00:00 by (unknown) 7b69f5548ee0dcac7ef623d3281a12b4c860a3e6

ConfigConvert: fix undocumented contact templates conversion

refs #2743

2013-05-28 18:27:53 +00:00 by (unknown) 870a9e663e31fa5c9870cc72b6b83af7b3e8902a

configconvert: fix multiple templates usage, template object lookup error

multiple host/service templates seperated by commas will cause some
irritation, therefore this is treated as array internally, like group
members. for the config export and "inherits", this is easy to fix. for
the actual host_name lookup for service objects, this unveiled another
bug when looping through all available templates - they are unique by
'name' and not by hostname/servicedesc, and require their very own
getter - obj_get_tmpl_obj_by_tmpl_name() - which makes sure to return
the object which is then looked into recursively if there's a host_name
provided.

possible bug for now - multiple service templates used and the host_name is
defined in one of them. but that's not the usual case, and won't be
supported for now.

refs #2743
fixes #3932

2013-05-28 18:27:53 +00:00 by (unknown) fd379564ab9acc0d5b9801fee943a00e1d4044de

configconvert: support 'name' for groups' if *group_name is not set

this is a fallback for broken configs only, and since i got some, added
a small fix.

refs #2743

2013-05-28 18:27:53 +00:00 by (unknown) 669c28b0e027ad90f5ce3453ba16cda7e54d4c0b

configconvert: add service->hostgroup<-hostmembers conversion to template support

WIP: there's multiple service->hostgroup relations - duplicated hosthg
templates. must be fixed.

refs #2743
refs #4016

2013-05-28 18:27:53 +00:00 by (unknown) 13990b6c9ee9a305aa103f75cdb61591f00916e4

configconvert: refactor service-hg-hosts for one hosthg template and multiple services

we need to first loop over all services, getting the key ids, collecting
them for each hostgroup_name (this is the unique identifier, because
this is our hosthg template later on).

then we loop over the collected unique hostgroups and build the 2.x
template logic. the difference here is now, that the code is refactored,
and loops over the service keys (getting their objects) only once,
pushing their templates plus a relation to a single (1) hosthg-template.

there's still some space for enhancements - the service template names
as well as hosthg template names as well as service object names are
generated with some hardcoded strings/numbers.

refs #2743
refs #4016

2013-05-28 18:27:54 +00:00 by (unknown) 0c562a190cb8dc78a51ecef1d8728135cb8f48fb

configconvert: add small main config file for standalone tests

refs #2743

2013-05-28 18:27:55 +00:00 by (unknown) 7ef3ae9c69703dbe1399d80982eb5997494950a1

configconvert: update requirements, perl deps

refs #2743

2013-05-28 18:27:55 +00:00 by (unknown) c75089088349e4784902016b53def048c705364b

configconvert: export check_period for hosts/services

refs #2743

2013-05-29 13:15:59 +00:00 by (unknown) 76dd67dbfeade98cfa34420a3e04560458192737

configconvert: update README with usage and todos

refs #2743

2013-06-10 11:56:38 +00:00 by (unknown) 216a6098e9683f140cfb86ad0263bccf92765ac0

convertv1->v2 initial import

refs #2743

2013-06-10 11:56:38 +00:00 by (unknown) 9da16aa23f4594d0eae35e261f2ca8bde8f21419

Config Conversion: command macros, templates

refs #2743

2013-06-10 11:56:38 +00:00 by (unknown) 0bc5962d79612d4d4fbee6d9b045b86ded085f7f

WIP configconversion: rewrite recursive lookup of linked host_name/service_description

this is a mess. configs may just use "name" instead of "host_name" on
type "host", same goes for service and service_descriptions. well, and
if it's a template, "name" is populated too.

the algorithm is not clean enough, and does not scale at all. there are
bugs, and the hostgroup linking is not yet taken into account too.

basics host -> service dumping of v2 config is implemented.

refs #2743

2013-06-10 11:56:39 +00:00 by (unknown) e93ead15b3fb1b97b90609f836ce3282ec13b252

ConfigConvert: refactor host_name/service_description link resolving

previous algorithm was buggy, as well get_host_name always looked up
host template objects, even if the template object was a service. this
is now fixed by re-using the __TYPE attribute (set on Icinga 1x config
read).

the algorithm is now like

                       |---------------------------------|
                      \/                                 |
                   svc_desc?                             |
                0 /        \ 1                           |
              use tmpl?    END -------> [svc_desc]       |
             0 /   \ 1                                   |
[undef] <- BROKEN  getobjbyattr(['use'], __TYPE, svcdesc |
                    |                                    |
                 getsvcdesc(obj)                         |
                    |                                    |
                    --------------------------------------

refs #2743

2013-06-10 11:56:39 +00:00 by (unknown) 8393e6579b18effdd27c68b2d090cb11d1932a54

ConfigConvert: fix 4 little big thinkos on import/convert/dump

1) do not skip lines containing ;.* - there may actually be a comment on
attr->val line. rather clean the line safely, and let the magic happen.

2) the type counter was implemented in order to have unique object ids
by type, since 1x config does not provide us with such. problem - the
function had a local var, saving the counter for each file, overwriting
the hash attributes later on, starting again with 0. nasty bug, hard to
figure out. fixed by feeding the type_cnt into the cfg_obj hive for now.
revamped the state machine logic as well, like so

I: define TYPE { 	--> __TYPE = TYPE
II: attr val		--> {type}->{type_cnt->cnt}->{attr} = val
III: }			--> type_cnt->cnt++
IV: <empty/comment>

3) also skip service templates (__IS_TEMPLATE) sooner, and do not try to
calculate some host_name/service_description magic out of them - they
just can't go down one level to the host, but only up with 'use'.

4) host and service templates on 2x config dump must check if
__USES_TEMPLATE is actually set to 1, checking for defined is not
enough.

whatthecommit.com:

A long time ago, in a galaxy far far away...

refs #2743

2013-06-10 11:56:39 +00:00 by (unknown) 7d1a3cbf273aa16d52bbda62b024851789f54cd6

ConfigConvert: add more host/service attributes, groups

*_interval are automatically mapped, while the *groups attribute it
converted into an array in order to easily stash more groups on it.

still a todo - loop over existing groups and re-link their members into
the respective objects, as 2.x only supports that location.

fix for the host->service relation - use the already processed service
2x hashref in order to do some magic with host->{'SERVICE'} = service

all 2x attributes are now encapsulated with "", to stay safe.
todo - more generic config 2x dump.

furthermore, add some more code comments for the respective sections.

refs #2743

2013-06-10 11:56:39 +00:00 by (unknown) b1a69ea22d625686cd16e561a8236e048bd855fe

ConfigConvert: fix service linking not unique, add hostgroup->members re-link to host->hostgroups

while working on the missing servicegroups and their facepalm members
syntax (host1,svc1,host2,svc2 - awesome to parse), i figured that the
whole detection of services by their attribute 'service_description' is
not uniquely implemented. now the getter functions are duplicated, and
not modular anymore, for the sake of having a service identified by its
host_name + service_description. since that lookup is recursive, we must
pass the host_name from the very beginning - otherwise we could
accidently overwrite that with a template entry.

the hostgroup re-linking works, also thanks to the fact that the inner
object structure is just an array in the hashref, which allows smart
push.

contact/user groups are tricky again due to the different naming.

further todo: sort all macros and hostservice links. right now this
looks like chaos.

refs #2743

2013-06-10 11:56:39 +00:00 by (unknown) a4ba58184022e4d839a5520d27034baa35b028b1

ConfigConvert: refactor multiple host_name's on service object detection

this is ugly. a service object may contain 'host_name' with
'host1,host2,host3' and so on. treating this as string won't allow us to
look into the template tree for valid host attributes, so we need to
rewrite the getter function, allowing some special treatment on
host_name arrays.

for the service object preparation this means: while in the service
loop, we need to loop again over all hosts, then dclone the hashref
object for the service, and add the unique host_name attribute again.

we might require some loop unrolling later, but for now this works as
expected.

refs #2743

2013-06-10 11:56:39 +00:00 by (unknown) 55f87a8b2606176fa3ae3686e9117127ca0c1e54

ConfigConvert: refactor host-svc links, add full service/usergroup relinking

due to the relinking afterwards we actually modify the service objects
already prepared for 2x. since the *group magic depends on the
host/services/users already prepared, we get a perpetuum mobile here
with the host loop and resolving service relations.

in order to safely fix the issue, there's a seperate host-service link
loop after resolving all the other needed objects, which may cost a
little bit more performance, but is safe and standalone, getting all
previous modifications, migrations and also hacks.

next to the refactored flow, the issue with resolving the correct
servicegroups and stashing them into an array is solved, as well as
converting the existing contactgroups to usergroups, as well as
re-linking existing contactgroup->members to their new home,
user->usergroups.

note: when parsing the servicegroup members into an array, it must not
be sorted afterwards, because we will shift 2 objects (host, service) in
order to identify the correct service object for adding the servicegroup
item.

some code reorganisation too, plus a minor comma fix for the host
address macro.

the used 1x configuration will be addressed in 2743.cfg on
icinga-core.git, with all future additions.

refs #2743

2013-06-10 11:56:39 +00:00 by (unknown) 4aaae70874e9ac168a78a22d3a8363b3106bbfba

ConfigConvert: *interval, max_check_attempts dumped as numbers

see
https://git.icinga.org/?p=icinga2.git;a=blob_plain;f=lib/icinga/icinga-type.conf;hb=HEAD

refs #2743

2013-06-10 11:56:39 +00:00 by (unknown) 6b4ea793ee2455d9158ba6681777bc63b5c72c97

ConfigConvert: fix undocumented contact templates conversion

refs #2743

2013-06-10 11:56:40 +00:00 by (unknown) 8f059172dce5b9e8c80c459e205d25d2883c0e60

configconvert: fix multiple templates usage, template object lookup error

multiple host/service templates seperated by commas will cause some
irritation, therefore this is treated as array internally, like group
members. for the config export and "inherits", this is easy to fix. for
the actual host_name lookup for service objects, this unveiled another
bug when looping through all available templates - they are unique by
'name' and not by hostname/servicedesc, and require their very own
getter - obj_get_tmpl_obj_by_tmpl_name() - which makes sure to return
the object which is then looked into recursively if there's a host_name
provided.

possible bug for now - multiple service templates used and the host_name is
defined in one of them. but that's not the usual case, and won't be
supported for now.

refs #2743
fixes #3932

2013-06-10 11:56:40 +00:00 by (unknown) 363e88fb93fec14f1b534bf9f9a539f0ac320c7c

configconvert: support 'name' for groups' if *group_name is not set

this is a fallback for broken configs only, and since i got some, added
a small fix.

refs #2743

2013-06-10 11:56:40 +00:00 by (unknown) c4c4b0b2194e85e797a1d37b5955c43e78cdb2ff

configconvert: add service->hostgroup<-hostmembers conversion to template support

WIP: there's multiple service->hostgroup relations - duplicated hosthg
templates. must be fixed.

refs #2743
refs #4016

2013-06-10 11:56:40 +00:00 by (unknown) ace19fb7b98e6928ef7ce6e7476f78586e3557b4

configconvert: refactor service-hg-hosts for one hosthg template and multiple services

we need to first loop over all services, getting the key ids, collecting
them for each hostgroup_name (this is the unique identifier, because
this is our hosthg template later on).

then we loop over the collected unique hostgroups and build the 2.x
template logic. the difference here is now, that the code is refactored,
and loops over the service keys (getting their objects) only once,
pushing their templates plus a relation to a single (1) hosthg-template.

there's still some space for enhancements - the service template names
as well as hosthg template names as well as service object names are
generated with some hardcoded strings/numbers.

refs #2743
refs #4016

2013-06-10 11:56:41 +00:00 by (unknown) 3a5090be2414e2eb0203fd75a4547a2bac9d009d

configconvert: add small main config file for standalone tests

refs #2743

2013-06-10 11:56:41 +00:00 by (unknown) 4e929329c0b9bd62c5cb32185da50f7b85e51c47

configconvert: update requirements, perl deps

refs #2743

2013-06-10 11:56:41 +00:00 by (unknown) c9e249a0c3e7557a7056aca856f3feb53c5e859f

configconvert: export check_period for hosts/services

refs #2743

2013-06-10 11:56:42 +00:00 by (unknown) 6805fb4a1322990779a44ca0480c6588d013ca79

configconvert: update README with usage and todos

refs #2743

2013-06-20 14:39:14 +00:00 by (unknown) bcf2ff2f36c62258880fd32afb67bc9814ed839f

convertv1->v2 initial import

refs #2743

2013-06-20 14:39:15 +00:00 by (unknown) 09b8fe63e3bc6b1c870f09ebabc6db1b33c87a89

Config Conversion: command macros, templates

refs #2743

2013-06-20 14:39:15 +00:00 by (unknown) 827be2c5594b8d8374d93966ffd2b6eedf6ce2f4

WIP configconversion: rewrite recursive lookup of linked host_name/service_description

this is a mess. configs may just use "name" instead of "host_name" on
type "host", same goes for service and service_descriptions. well, and
if it's a template, "name" is populated too.

the algorithm is not clean enough, and does not scale at all. there are
bugs, and the hostgroup linking is not yet taken into account too.

basics host -> service dumping of v2 config is implemented.

refs #2743

2013-06-20 14:39:15 +00:00 by (unknown) 424c261e83dddeeef08b0422546dfa19b2fb736c

ConfigConvert: refactor host_name/service_description link resolving

previous algorithm was buggy, as well get_host_name always looked up
host template objects, even if the template object was a service. this
is now fixed by re-using the __TYPE attribute (set on Icinga 1x config
read).

the algorithm is now like

                       |---------------------------------|
                      \/                                 |
                   svc_desc?                             |
                0 /        \ 1                           |
              use tmpl?    END -------> [svc_desc]       |
             0 /   \ 1                                   |
[undef] <- BROKEN  getobjbyattr(['use'], __TYPE, svcdesc |
                    |                                    |
                 getsvcdesc(obj)                         |
                    |                                    |
                    --------------------------------------

refs #2743

2013-06-20 14:39:15 +00:00 by (unknown) 43a9220b8bbf38c587442091fffa5db2ae5eae99

ConfigConvert: fix 4 little big thinkos on import/convert/dump

1) do not skip lines containing ;.* - there may actually be a comment on
attr->val line. rather clean the line safely, and let the magic happen.

2) the type counter was implemented in order to have unique object ids
by type, since 1x config does not provide us with such. problem - the
function had a local var, saving the counter for each file, overwriting
the hash attributes later on, starting again with 0. nasty bug, hard to
figure out. fixed by feeding the type_cnt into the cfg_obj hive for now.
revamped the state machine logic as well, like so

I: define TYPE { 	--> __TYPE = TYPE
II: attr val		--> {type}->{type_cnt->cnt}->{attr} = val
III: }			--> type_cnt->cnt++
IV: <empty/comment>

3) also skip service templates (__IS_TEMPLATE) sooner, and do not try to
calculate some host_name/service_description magic out of them - they
just can't go down one level to the host, but only up with 'use'.

4) host and service templates on 2x config dump must check if
__USES_TEMPLATE is actually set to 1, checking for defined is not
enough.

whatthecommit.com:

A long time ago, in a galaxy far far away...

refs #2743

2013-06-20 14:39:15 +00:00 by (unknown) e0b7278130fc2e4a75bfd964883698a86a129077

ConfigConvert: add more host/service attributes, groups

*_interval are automatically mapped, while the *groups attribute it
converted into an array in order to easily stash more groups on it.

still a todo - loop over existing groups and re-link their members into
the respective objects, as 2.x only supports that location.

fix for the host->service relation - use the already processed service
2x hashref in order to do some magic with host->{'SERVICE'} = service

all 2x attributes are now encapsulated with "", to stay safe.
todo - more generic config 2x dump.

furthermore, add some more code comments for the respective sections.

refs #2743

2013-06-20 14:39:15 +00:00 by (unknown) d01e4ff273a88e2fc9157b5a5857d6b684adc7dd

ConfigConvert: fix service linking not unique, add hostgroup->members re-link to host->hostgroups

while working on the missing servicegroups and their facepalm members
syntax (host1,svc1,host2,svc2 - awesome to parse), i figured that the
whole detection of services by their attribute 'service_description' is
not uniquely implemented. now the getter functions are duplicated, and
not modular anymore, for the sake of having a service identified by its
host_name + service_description. since that lookup is recursive, we must
pass the host_name from the very beginning - otherwise we could
accidently overwrite that with a template entry.

the hostgroup re-linking works, also thanks to the fact that the inner
object structure is just an array in the hashref, which allows smart
push.

contact/user groups are tricky again due to the different naming.

further todo: sort all macros and hostservice links. right now this
looks like chaos.

refs #2743

2013-06-20 14:39:15 +00:00 by (unknown) 152d65c62898c514d26f9250b7d6e6fd00c115b8

ConfigConvert: refactor multiple host_name's on service object detection

this is ugly. a service object may contain 'host_name' with
'host1,host2,host3' and so on. treating this as string won't allow us to
look into the template tree for valid host attributes, so we need to
rewrite the getter function, allowing some special treatment on
host_name arrays.

for the service object preparation this means: while in the service
loop, we need to loop again over all hosts, then dclone the hashref
object for the service, and add the unique host_name attribute again.

we might require some loop unrolling later, but for now this works as
expected.

refs #2743

2013-06-20 14:39:15 +00:00 by (unknown) b19745091e24579728fa112a63d42bbbe1a2ef10

ConfigConvert: refactor host-svc links, add full service/usergroup relinking

due to the relinking afterwards we actually modify the service objects
already prepared for 2x. since the *group magic depends on the
host/services/users already prepared, we get a perpetuum mobile here
with the host loop and resolving service relations.

in order to safely fix the issue, there's a seperate host-service link
loop after resolving all the other needed objects, which may cost a
little bit more performance, but is safe and standalone, getting all
previous modifications, migrations and also hacks.

next to the refactored flow, the issue with resolving the correct
servicegroups and stashing them into an array is solved, as well as
converting the existing contactgroups to usergroups, as well as
re-linking existing contactgroup->members to their new home,
user->usergroups.

note: when parsing the servicegroup members into an array, it must not
be sorted afterwards, because we will shift 2 objects (host, service) in
order to identify the correct service object for adding the servicegroup
item.

some code reorganisation too, plus a minor comma fix for the host
address macro.

the used 1x configuration will be addressed in 2743.cfg on
icinga-core.git, with all future additions.

refs #2743

2013-06-20 14:39:15 +00:00 by (unknown) 476067ad6ecef5535b934d7b35896fb5e1934af2

ConfigConvert: *interval, max_check_attempts dumped as numbers

see
https://git.icinga.org/?p=icinga2.git;a=blob_plain;f=lib/icinga/icinga-type.conf;hb=HEAD

refs #2743

2013-06-20 14:39:15 +00:00 by (unknown) f3976192ee65ca1e8b90271d088088e2e108465e

ConfigConvert: fix undocumented contact templates conversion

refs #2743

2013-06-20 14:39:16 +00:00 by (unknown) 9b77a6fca86c7d3d8b74f2560cf1368880a243a3

configconvert: fix multiple templates usage, template object lookup error

multiple host/service templates seperated by commas will cause some
irritation, therefore this is treated as array internally, like group
members. for the config export and "inherits", this is easy to fix. for
the actual host_name lookup for service objects, this unveiled another
bug when looping through all available templates - they are unique by
'name' and not by hostname/servicedesc, and require their very own
getter - obj_get_tmpl_obj_by_tmpl_name() - which makes sure to return
the object which is then looked into recursively if there's a host_name
provided.

possible bug for now - multiple service templates used and the host_name is
defined in one of them. but that's not the usual case, and won't be
supported for now.

refs #2743
fixes #3932

2013-06-20 14:39:16 +00:00 by (unknown) cac207d2600b21a8b0312548e0265c74a5ce55c4

configconvert: support 'name' for groups' if *group_name is not set

this is a fallback for broken configs only, and since i got some, added
a small fix.

refs #2743

2013-06-20 14:39:16 +00:00 by (unknown) 0affa37dbeacf2f54cf31fb7099deafb6b2725a9

configconvert: add service->hostgroup<-hostmembers conversion to template support

WIP: there's multiple service->hostgroup relations - duplicated hosthg
templates. must be fixed.

refs #2743
refs #4016

2013-06-20 14:39:16 +00:00 by (unknown) 782fe129fc486f1328427030df6ee53f4f535761

configconvert: refactor service-hg-hosts for one hosthg template and multiple services

we need to first loop over all services, getting the key ids, collecting
them for each hostgroup_name (this is the unique identifier, because
this is our hosthg template later on).

then we loop over the collected unique hostgroups and build the 2.x
template logic. the difference here is now, that the code is refactored,
and loops over the service keys (getting their objects) only once,
pushing their templates plus a relation to a single (1) hosthg-template.

there's still some space for enhancements - the service template names
as well as hosthg template names as well as service object names are
generated with some hardcoded strings/numbers.

refs #2743
refs #4016

2013-06-20 14:39:16 +00:00 by (unknown) 396bcfe12076daf7797b0c6a17218e013527e9f6

configconvert: add small main config file for standalone tests

refs #2743

2013-06-20 14:39:16 +00:00 by (unknown) 0ec61182e3049d7e032b5021489c01b5bba89b19

configconvert: update requirements, perl deps

refs #2743

2013-06-20 14:39:17 +00:00 by (unknown) b0138d39d159b081a1d180187a51ddee72eb55e5

configconvert: export check_period for hosts/services

refs #2743

2013-06-20 14:39:17 +00:00 by (unknown) 18c2fc97b85a926d3355e3ee438bbb3afc2cd443

configconvert: update README with usage and todos

refs #2743

2013-06-21 07:06:33 +00:00 by (unknown) bb9e38a1d8d87ecbcb9cc0cf29bfc21550eac33d

configconvert: remove obsolete itl notification template

and check if defined when used.

refs #2743

2013-06-21 16:02:14 +00:00 by (unknown) b7806a4f91ac78f237eaca061777aee0211268ce

Config Conversion: add conversion script

Squashed Rebase, commit msg below.

convertv1->v2 initial import

refs #2743

itl: fix inclusion of notification.conf

Config Conversion: command macros, templates

refs #2743

WIP: try resolving the host->svc relation from templates and tricks

not finished yet, there's heavy recursion required

WIP configconversion: rewrite recursive lookup of linked host_name/service_description

this is a mess. configs may just use "name" instead of "host_name" on
type "host", same goes for service and service_descriptions. well, and
if it's a template, "name" is populated too.

the algorithm is not clean enough, and does not scale at all. there are
bugs, and the hostgroup linking is not yet taken into account too.

basics host -> service dumping of v2 config is implemented.

refs #2743

ConfigConvert: split into modules, add objects.cache read, dump cmd line

basically it works with

- dumping a host with all services, using templates
- check_command and all arguments/user macros translation
- reading the objects.cache file location from icinga.cfg
=> this is reserved only for getting dedicated relations
=> we do not want to duplicate the work of xodtemplate.c in perl here
- all important functions have been split up into their respective
  modules in order to support better re-usage (i.e. lconfexport)

still missing important bits:

- detect service->group<-host links and build templates
- detect other ugly template methods
- dump templates
- the ugly deprecated normal|retry_check_interval mapping
- timeperiod mapping
- contact => user mapping
- notifications rework (dedicated object)
- dependencies, escalations (to be documented/implemented)
- the infamous rest

ConfigConvert: fix hash keys for convert/dump in perl 5.14

ConfigConvert: improved template handling, host/service dump 2x

refactored code again, removed nested loop bottlenecks. still, the
resolval of host_name/service_description requires more love.

templates are now correctly detected, linked, and printed in 2x syntax.
service templates are _not_ linked against host definitions in 2x as
this is not possible.

commands for hosts do not exist in 2x, therefore the command_name of an
1x host will be taken and guessed against its related services. if
there's a match, the service will be linked as 2x 'hostcheck'.

*_interval still needs proper handling, as the default interval is 1m,
but 2x requires the identifier.

ConfigConvert: refactor host_name/service_description link resolving

previous algorithm was buggy, as well get_host_name always looked up
host template objects, even if the template object was a service. this
is now fixed by re-using the __TYPE attribute (set on Icinga 1x config
read).

the algorithm is now like

                       |---------------------------------|
                      \/                                 |
                   svc_desc?                             |
                0 /        \ 1                           |
              use tmpl?    END -------> [svc_desc]       |
             0 /   \ 1                                   |
[undef] <- BROKEN  getobjbyattr(['use'], __TYPE, svcdesc |
                    |                                    |
                 getsvcdesc(obj)                         |
                    |                                    |
                    --------------------------------------

refs #2743

ConvertConfig: add basic support for users, timeperiods, *groups

as well as display_name as attribute to print something.

contact => user mapping is added as well, manipulating the __TYPE var
too. furthermore display_name on the host will be overwritten by the
alias, if set.

the groups don't dump much, only the display_name if set. their dump
function is implemented generic, based on the __TYPE

ConfigConvert: fix 4 little big thinkos on import/convert/dump

1) do not skip lines containing ;.* - there may actually be a comment on
attr->val line. rather clean the line safely, and let the magic happen.

2) the type counter was implemented in order to have unique object ids
by type, since 1x config does not provide us with such. problem - the
function had a local var, saving the counter for each file, overwriting
the hash attributes later on, starting again with 0. nasty bug, hard to
figure out. fixed by feeding the type_cnt into the cfg_obj hive for now.
revamped the state machine logic as well, like so

I: define TYPE { 	--> __TYPE = TYPE
II: attr val		--> {type}->{type_cnt->cnt}->{attr} = val
III: }			--> type_cnt->cnt++
IV: <empty/comment>

3) also skip service templates (__IS_TEMPLATE) sooner, and do not try to
calculate some host_name/service_description magic out of them - they
just can't go down one level to the host, but only up with 'use'.

4) host and service templates on 2x config dump must check if
__USES_TEMPLATE is actually set to 1, checking for defined is not
enough.

whatthecommit.com:

A long time ago, in a galaxy far far away...

refs #2743

ConfigConvert: add more host/service attributes, groups

*_interval are automatically mapped, while the *groups attribute it
converted into an array in order to easily stash more groups on it.

still a todo - loop over existing groups and re-link their members into
the respective objects, as 2.x only supports that location.

fix for the host->service relation - use the already processed service
2x hashref in order to do some magic with host->{'SERVICE'} = service

all 2x attributes are now encapsulated with "", to stay safe.
todo - more generic config 2x dump.

furthermore, add some more code comments for the respective sections.

refs #2743

ConfigConvert: fix service linking not unique, add hostgroup->members re-link to host->hostgroups

while working on the missing servicegroups and their facepalm members
syntax (host1,svc1,host2,svc2 - awesome to parse), i figured that the
whole detection of services by their attribute 'service_description' is
not uniquely implemented. now the getter functions are duplicated, and
not modular anymore, for the sake of having a service identified by its
host_name + service_description. since that lookup is recursive, we must
pass the host_name from the very beginning - otherwise we could
accidently overwrite that with a template entry.

the hostgroup re-linking works, also thanks to the fact that the inner
object structure is just an array in the hashref, which allows smart
push.

contact/user groups are tricky again due to the different naming.

further todo: sort all macros and hostservice links. right now this
looks like chaos.

refs #2743

ConfigConvert: basic servicegroup parsing method

ConfigConvert: refactor multiple host_name's on service object detection

this is ugly. a service object may contain 'host_name' with
'host1,host2,host3' and so on. treating this as string won't allow us to
look into the template tree for valid host attributes, so we need to
rewrite the getter function, allowing some special treatment on
host_name arrays.

for the service object preparation this means: while in the service
loop, we need to loop again over all hosts, then dclone the hashref
object for the service, and add the unique host_name attribute again.

we might require some loop unrolling later, but for now this works as
expected.

refs #2743

ConvertConfig: disable debug output, some reformatting of dump

ConfigConvert: refactor host-svc links, add full service/usergroup relinking

due to the relinking afterwards we actually modify the service objects
already prepared for 2x. since the *group magic depends on the
host/services/users already prepared, we get a perpetuum mobile here
with the host loop and resolving service relations.

in order to safely fix the issue, there's a seperate host-service link
loop after resolving all the other needed objects, which may cost a
little bit more performance, but is safe and standalone, getting all
previous modifications, migrations and also hacks.

next to the refactored flow, the issue with resolving the correct
servicegroups and stashing them into an array is solved, as well as
converting the existing contactgroups to usergroups, as well as
re-linking existing contactgroup->members to their new home,
user->usergroups.

note: when parsing the servicegroup members into an array, it must not
be sorted afterwards, because we will shift 2 objects (host, service) in
order to identify the correct service object for adding the servicegroup
item.

some code reorganisation too, plus a minor comma fix for the host
address macro.

the used 1x configuration will be addressed in 2743.cfg on
icinga-core.git, with all future additions.

refs #2743

ConfigConvert: *interval, max_check_attempts dumped as numbers

see
https://git.icinga.org/?p=icinga2.git;a=blob_plain;f=lib/icinga/icinga-type.conf;hb=HEAD

refs #2743

ConfigConvert: fix undocumented contact templates conversion

refs #2743

s/DumpIcinga2Cfg/ExportIcinga2Cfg/g

just for Import/Export clarification.

configconvert: use special prefix for internal attributes

__I2CONVERT_ should do the trick, not to interfere with existing custom
variables.

configconvert: fix leftover from rename

configconvert: properly escape strings with double quotes

* command_line and command_args
* notification commands
* action_url, notes_url
* notes
* icon_image, icon_image_alt

fixes #3931

configconvert: fix multiple templates usage, template object lookup error

multiple host/service templates seperated by commas will cause some
irritation, therefore this is treated as array internally, like group
members. for the config export and "inherits", this is easy to fix. for
the actual host_name lookup for service objects, this unveiled another
bug when looping through all available templates - they are unique by
'name' and not by hostname/servicedesc, and require their very own
getter - obj_get_tmpl_obj_by_tmpl_name() - which makes sure to return
the object which is then looked into recursively if there's a host_name
provided.

possible bug for now - multiple service templates used and the host_name is
defined in one of them. but that's not the usual case, and won't be
supported for now.

refs #2743
fixes #3932

configconvert: dump modular timperiod attr and values

we need to ignore all other attributes which are to be cleaned sooner,
just for safety.

minor flaw: the keys are not sorted by weekdays now, but dumped like the
hash provides them.

fixes #4013

configconvert: support 'name' for groups' if *group_name is not set

this is a fallback for broken configs only, and since i got some, added
a small fix.

refs #2743

configconvert: add service->hostgroup<-hostmembers conversion to template support

WIP: there's multiple service->hostgroup relations - duplicated hosthg
templates. must be fixed.

refs #2743
refs #4016

configconvert: refactor service-hg-hosts for one hosthg template and multiple services

we need to first loop over all services, getting the key ids, collecting
them for each hostgroup_name (this is the unique identifier, because
this is our hosthg template later on).

then we loop over the collected unique hostgroups and build the 2.x
template logic. the difference here is now, that the code is refactored,
and loops over the service keys (getting their objects) only once,
pushing their templates plus a relation to a single (1) hosthg-template.

there's still some space for enhancements - the service template names
as well as hosthg template names as well as service object names are
generated with some hardcoded strings/numbers.

refs #2743
refs #4016

configconversion: remove debug output

configconvert: only dump macros if there are key-val pairs

configconvert: code cleanup

configconversion: explicitely check __I2CONVERT_USES_TEMPLATE == 1 when dumping service templates

refs #4020

configconvert: refactor how services without host_name are handled

this is mainly the cause when using hostgroup relations, or other object
tricks. we still need the single loop run to convert all 2.x object
attributes in one run, and deal with the missing attributes later on.

configconvert: WIP notification conversion

- refactored notification_commands parsing and storage
- do not add duplicated notification_command names to the 2x
  notification object hive
- create notifications based on the notification command linked from
  users
- move host->service link magic to the end again

refs #4008

configconvert: WIP notifications, how service/hosts relate to users and notifications

there may be more than one notification for the user, and we already had
the type in place. currently, that type is not taken into account (bug
to fix).

the rest with service -> user -> notification linking works in the first
implementation.

refs #4008

configconvert: final stage, rework notification type handling, fix naming amd template output

the config dump must take care of which notification type is dumped,
otherwise there would be yet another look required. Instead we are just
passing a reference from users to hosts/services with all prepared
notification attributes, and check them lazy on dump then.

further fixe on the notification names - they are not unique by their
command (now used on host/service scope, not user/contact) so we'll add
some magic number as suffix.

fixed template name dumping due to changed conversion vars too.

refs #4008

configconvert: write config files, refactor how objects are exported

structure is currently hardcoded, but may be changed to getopts later
on. all files are overridden into conf/ (testing only right on).

refactored export code, removed everything from Convert.pm, and export
is now called from the script directly, wrapped all dump loops and added
more function layers in betweed. open/close file handles take care of
everything, next to a header on top of the files for getting to know
their origin better (our hard work, ey?).

refs #4036

configconvert: fix service description handling, it's now an inner conversion value

previously, i've just re-used 'service_description' which isn't a valid
2.x attribute either. the lookup of service_description attribute in 1.x
templates works already, but populated __I2CONVERT_SERVICEDESCRIPTION
instead. in favor of having a generated value for all our objects, we'll
use that one, also for dumping the configuration.

even further, this is also changed for the service->hostgroup<-hosts
conversion then.

this also avoids writing empty service names into host->service objects.

fixes #4019

configconvert: add small main config file for standalone tests

refs #2743

configconvert: s/usergroups/groups/ for User config dump

configconvert: add README

configconvert: add ITL templates automatically (for services, notifications)

this currently only makes sense for services and notifications.

refs #4037

configconvert: fix timeperiod ranges, add template support for ITL inherits

refs #4037
refs #4013

configconvert: update requirements, perl deps

refs #2743

configconvert: fix import parser - timeperiods require regex (thx LConfImport)

somehow, the Icinga2 import still fails with us holiday definitions. bug
that's not yet determined whose bug that is.

refs #4039
refs #4013

configconvert: add getopts and pod2usage incl help

fixes #4041

configconvert: add notification_interval|period

and refactor check|retry_interval vs normal|retry_check_interval

refs #4008

configconvert: make host->service linked service a template object, referenced by the host

this is not the best solution, as it it creates a service template for
each host-service relation. if you have many host_name entries defined
in your Icinga 1.x config for a service, this will create duplicates
then. requires some more code refactoring, therefore leaving the issue
open.

refs #3933

configconvert: drop config file prefix 'icinga2'

just makes it hard to work with.

refs #4036

configconvert: code cleanup

configconvert: export check_period for hosts/services

refs #2743

configconvert: WIP dependencies - for host based on host_name and parents

refs #4011

configconvert: s/Timeperiod/TimePeriod/g

refs #4013

configconvert: add hostdependency with hostgroup_name hosts unrolling

refs #4011

configconvert: add servicedependency support (host_name)

missing - the loop fun with hostgroups.

special config is here:
https://git.icinga.org/?p=icinga-core.git;a=blob;f=tests/etc/2743.cfg;hb=refs/heads/next#l376

refs #4011

configconvert: add service dependency support for hostgroups

well, a lot of looping required here:

- loop through all child hostgroup hosts and get their hostnames
- get the servive object based on each hostname (loop again) and
  the child service description
- loop through all master hostgroup hosts and get their hostnames
- get the master hostname based on each hostname (loop again) and
  the master service description, save that as service dependency

given that implementation, dependencies may be converted for now.

once we decide which options we support, we may add them as well.

refs #4011

configconvert: add support for * as service host_name next to comma seperated list

this is currently a proof of concept for services only, but should
target all the object tricks later on. this will be done on host_name
lookup and stored as array.

http://docs.icinga.org/latest/en/objecttricks.html

refs #4010

configconvert: refactor commaseperated list split

... to list of stripped strings into a function.

fixes #4046

configconvert: handle excluded hosts, ignore them on split to array

exclusions/exceptions cannot be treated by icinga2 the same way as in
1.x so it's better to not create unwanted objects.

fixes #4007

configconvert: replace colon in object names with underscore

it's a special delimiter and therefore forbidden.

fixes #4225

configconvert: detect additive inheritance for *groups and use += on export

i guess this can be used for host/service contact(groups) and other foo
as well, so let's see.

refs #4006

configconvert: add wildcard detection for 'members *' in hostgroup

currently adds itself to the host's hostgroups array, but maybe a global
template where all hosts inherit from, plus additive inheritance fit
better here.

refs #4010

configconvert: add a note about servicedeps wildcards todo

refs #4010

configconvert: svg-hg-hst logic may contain multiple hgnames for services

the object tricks section on the 1.x documentation contains everything
which makes the code less readable even here.

luckily the code is rather modular, so the extension for split string to
array, and looping doesn't hurt much.

refs #4010

configconvert: update README with usage and todos

refs #2743

configconvert: fix perl 5.14, skip non-existing objects

configconvert: escape display_name (may contain quotes)

refs #3931

configconvert: refactor using command objects (check/notification)

eventhandlers are missing.

fixes #4305

configconvert: add volatile attribute

fixes #4321

configconvert: eventhandler as EventCommand objects

fixes #4327

update TODOs

configconvert: remove obsolete itl notification template

and check if defined when used.

refs #2743

configconvert: write compat log too in icinga2 conf

Revert "itl: fix inclusion of notification.conf"

This reverts commit 02eb54dc1a818fdcafa6c85817e9f6341cf2831a.

configconvert: fix thinko with check_command|event_command in service

refs #2743
refs #4327
refs #4305

2013-06-24 07:32:47 +00:00 by (unknown) 350b095979ce8b2c6c92ddbdc3d937e2c0ec022d

Config Conversion: add conversion script

Squashed Rebase, commit msg below.

convertv1->v2 initial import

refs #2743

itl: fix inclusion of notification.conf

Config Conversion: command macros, templates

refs #2743

WIP: try resolving the host->svc relation from templates and tricks

not finished yet, there's heavy recursion required

WIP configconversion: rewrite recursive lookup of linked host_name/service_description

this is a mess. configs may just use "name" instead of "host_name" on
type "host", same goes for service and service_descriptions. well, and
if it's a template, "name" is populated too.

the algorithm is not clean enough, and does not scale at all. there are
bugs, and the hostgroup linking is not yet taken into account too.

basics host -> service dumping of v2 config is implemented.

refs #2743

ConfigConvert: split into modules, add objects.cache read, dump cmd line

basically it works with

- dumping a host with all services, using templates
- check_command and all arguments/user macros translation
- reading the objects.cache file location from icinga.cfg
=> this is reserved only for getting dedicated relations
=> we do not want to duplicate the work of xodtemplate.c in perl here
- all important functions have been split up into their respective
  modules in order to support better re-usage (i.e. lconfexport)

still missing important bits:

- detect service->group<-host links and build templates
- detect other ugly template methods
- dump templates
- the ugly deprecated normal|retry_check_interval mapping
- timeperiod mapping
- contact => user mapping
- notifications rework (dedicated object)
- dependencies, escalations (to be documented/implemented)
- the infamous rest

ConfigConvert: fix hash keys for convert/dump in perl 5.14

ConfigConvert: improved template handling, host/service dump 2x

refactored code again, removed nested loop bottlenecks. still, the
resolval of host_name/service_description requires more love.

templates are now correctly detected, linked, and printed in 2x syntax.
service templates are _not_ linked against host definitions in 2x as
this is not possible.

commands for hosts do not exist in 2x, therefore the command_name of an
1x host will be taken and guessed against its related services. if
there's a match, the service will be linked as 2x 'hostcheck'.

*_interval still needs proper handling, as the default interval is 1m,
but 2x requires the identifier.

ConfigConvert: refactor host_name/service_description link resolving

previous algorithm was buggy, as well get_host_name always looked up
host template objects, even if the template object was a service. this
is now fixed by re-using the __TYPE attribute (set on Icinga 1x config
read).

the algorithm is now like

                       |---------------------------------|
                      \/                                 |
                   svc_desc?                             |
                0 /        \ 1                           |
              use tmpl?    END -------> [svc_desc]       |
             0 /   \ 1                                   |
[undef] <- BROKEN  getobjbyattr(['use'], __TYPE, svcdesc |
                    |                                    |
                 getsvcdesc(obj)                         |
                    |                                    |
                    --------------------------------------

refs #2743

ConvertConfig: add basic support for users, timeperiods, *groups

as well as display_name as attribute to print something.

contact => user mapping is added as well, manipulating the __TYPE var
too. furthermore display_name on the host will be overwritten by the
alias, if set.

the groups don't dump much, only the display_name if set. their dump
function is implemented generic, based on the __TYPE

ConfigConvert: fix 4 little big thinkos on import/convert/dump

1) do not skip lines containing ;.* - there may actually be a comment on
attr->val line. rather clean the line safely, and let the magic happen.

2) the type counter was implemented in order to have unique object ids
by type, since 1x config does not provide us with such. problem - the
function had a local var, saving the counter for each file, overwriting
the hash attributes later on, starting again with 0. nasty bug, hard to
figure out. fixed by feeding the type_cnt into the cfg_obj hive for now.
revamped the state machine logic as well, like so

I: define TYPE { 	--> __TYPE = TYPE
II: attr val		--> {type}->{type_cnt->cnt}->{attr} = val
III: }			--> type_cnt->cnt++
IV: <empty/comment>

3) also skip service templates (__IS_TEMPLATE) sooner, and do not try to
calculate some host_name/service_description magic out of them - they
just can't go down one level to the host, but only up with 'use'.

4) host and service templates on 2x config dump must check if
__USES_TEMPLATE is actually set to 1, checking for defined is not
enough.

whatthecommit.com:

A long time ago, in a galaxy far far away...

refs #2743

ConfigConvert: add more host/service attributes, groups

*_interval are automatically mapped, while the *groups attribute it
converted into an array in order to easily stash more groups on it.

still a todo - loop over existing groups and re-link their members into
the respective objects, as 2.x only supports that location.

fix for the host->service relation - use the already processed service
2x hashref in order to do some magic with host->{'SERVICE'} = service

all 2x attributes are now encapsulated with "", to stay safe.
todo - more generic config 2x dump.

furthermore, add some more code comments for the respective sections.

refs #2743

ConfigConvert: fix service linking not unique, add hostgroup->members re-link to host->hostgroups

while working on the missing servicegroups and their facepalm members
syntax (host1,svc1,host2,svc2 - awesome to parse), i figured that the
whole detection of services by their attribute 'service_description' is
not uniquely implemented. now the getter functions are duplicated, and
not modular anymore, for the sake of having a service identified by its
host_name + service_description. since that lookup is recursive, we must
pass the host_name from the very beginning - otherwise we could
accidently overwrite that with a template entry.

the hostgroup re-linking works, also thanks to the fact that the inner
object structure is just an array in the hashref, which allows smart
push.

contact/user groups are tricky again due to the different naming.

further todo: sort all macros and hostservice links. right now this
looks like chaos.

refs #2743

ConfigConvert: basic servicegroup parsing method

ConfigConvert: refactor multiple host_name's on service object detection

this is ugly. a service object may contain 'host_name' with
'host1,host2,host3' and so on. treating this as string won't allow us to
look into the template tree for valid host attributes, so we need to
rewrite the getter function, allowing some special treatment on
host_name arrays.

for the service object preparation this means: while in the service
loop, we need to loop again over all hosts, then dclone the hashref
object for the service, and add the unique host_name attribute again.

we might require some loop unrolling later, but for now this works as
expected.

refs #2743

ConvertConfig: disable debug output, some reformatting of dump

ConfigConvert: refactor host-svc links, add full service/usergroup relinking

due to the relinking afterwards we actually modify the service objects
already prepared for 2x. since the *group magic depends on the
host/services/users already prepared, we get a perpetuum mobile here
with the host loop and resolving service relations.

in order to safely fix the issue, there's a seperate host-service link
loop after resolving all the other needed objects, which may cost a
little bit more performance, but is safe and standalone, getting all
previous modifications, migrations and also hacks.

next to the refactored flow, the issue with resolving the correct
servicegroups and stashing them into an array is solved, as well as
converting the existing contactgroups to usergroups, as well as
re-linking existing contactgroup->members to their new home,
user->usergroups.

note: when parsing the servicegroup members into an array, it must not
be sorted afterwards, because we will shift 2 objects (host, service) in
order to identify the correct service object for adding the servicegroup
item.

some code reorganisation too, plus a minor comma fix for the host
address macro.

the used 1x configuration will be addressed in 2743.cfg on
icinga-core.git, with all future additions.

refs #2743

ConfigConvert: *interval, max_check_attempts dumped as numbers

see
https://git.icinga.org/?p=icinga2.git;a=blob_plain;f=lib/icinga/icinga-type.conf;hb=HEAD

refs #2743

ConfigConvert: fix undocumented contact templates conversion

refs #2743

s/DumpIcinga2Cfg/ExportIcinga2Cfg/g

just for Import/Export clarification.

configconvert: use special prefix for internal attributes

__I2CONVERT_ should do the trick, not to interfere with existing custom
variables.

configconvert: fix leftover from rename

configconvert: properly escape strings with double quotes

* command_line and command_args
* notification commands
* action_url, notes_url
* notes
* icon_image, icon_image_alt

fixes #3931

configconvert: fix multiple templates usage, template object lookup error

multiple host/service templates seperated by commas will cause some
irritation, therefore this is treated as array internally, like group
members. for the config export and "inherits", this is easy to fix. for
the actual host_name lookup for service objects, this unveiled another
bug when looping through all available templates - they are unique by
'name' and not by hostname/servicedesc, and require their very own
getter - obj_get_tmpl_obj_by_tmpl_name() - which makes sure to return
the object which is then looked into recursively if there's a host_name
provided.

possible bug for now - multiple service templates used and the host_name is
defined in one of them. but that's not the usual case, and won't be
supported for now.

refs #2743
fixes #3932

configconvert: dump modular timperiod attr and values

we need to ignore all other attributes which are to be cleaned sooner,
just for safety.

minor flaw: the keys are not sorted by weekdays now, but dumped like the
hash provides them.

fixes #4013

configconvert: support 'name' for groups' if *group_name is not set

this is a fallback for broken configs only, and since i got some, added
a small fix.

refs #2743

configconvert: add service->hostgroup<-hostmembers conversion to template support

WIP: there's multiple service->hostgroup relations - duplicated hosthg
templates. must be fixed.

refs #2743
refs #4016

configconvert: refactor service-hg-hosts for one hosthg template and multiple services

we need to first loop over all services, getting the key ids, collecting
them for each hostgroup_name (this is the unique identifier, because
this is our hosthg template later on).

then we loop over the collected unique hostgroups and build the 2.x
template logic. the difference here is now, that the code is refactored,
and loops over the service keys (getting their objects) only once,
pushing their templates plus a relation to a single (1) hosthg-template.

there's still some space for enhancements - the service template names
as well as hosthg template names as well as service object names are
generated with some hardcoded strings/numbers.

refs #2743
refs #4016

configconversion: remove debug output

configconvert: only dump macros if there are key-val pairs

configconvert: code cleanup

configconversion: explicitely check __I2CONVERT_USES_TEMPLATE == 1 when dumping service templates

refs #4020

configconvert: refactor how services without host_name are handled

this is mainly the cause when using hostgroup relations, or other object
tricks. we still need the single loop run to convert all 2.x object
attributes in one run, and deal with the missing attributes later on.

configconvert: WIP notification conversion

- refactored notification_commands parsing and storage
- do not add duplicated notification_command names to the 2x
  notification object hive
- create notifications based on the notification command linked from
  users
- move host->service link magic to the end again

refs #4008

configconvert: WIP notifications, how service/hosts relate to users and notifications

there may be more than one notification for the user, and we already had
the type in place. currently, that type is not taken into account (bug
to fix).

the rest with service -> user -> notification linking works in the first
implementation.

refs #4008

configconvert: final stage, rework notification type handling, fix naming amd template output

the config dump must take care of which notification type is dumped,
otherwise there would be yet another look required. Instead we are just
passing a reference from users to hosts/services with all prepared
notification attributes, and check them lazy on dump then.

further fixe on the notification names - they are not unique by their
command (now used on host/service scope, not user/contact) so we'll add
some magic number as suffix.

fixed template name dumping due to changed conversion vars too.

refs #4008

configconvert: write config files, refactor how objects are exported

structure is currently hardcoded, but may be changed to getopts later
on. all files are overridden into conf/ (testing only right on).

refactored export code, removed everything from Convert.pm, and export
is now called from the script directly, wrapped all dump loops and added
more function layers in betweed. open/close file handles take care of
everything, next to a header on top of the files for getting to know
their origin better (our hard work, ey?).

refs #4036

configconvert: fix service description handling, it's now an inner conversion value

previously, i've just re-used 'service_description' which isn't a valid
2.x attribute either. the lookup of service_description attribute in 1.x
templates works already, but populated __I2CONVERT_SERVICEDESCRIPTION
instead. in favor of having a generated value for all our objects, we'll
use that one, also for dumping the configuration.

even further, this is also changed for the service->hostgroup<-hosts
conversion then.

this also avoids writing empty service names into host->service objects.

fixes #4019

configconvert: add small main config file for standalone tests

refs #2743

configconvert: s/usergroups/groups/ for User config dump

configconvert: add README

configconvert: add ITL templates automatically (for services, notifications)

this currently only makes sense for services and notifications.

refs #4037

configconvert: fix timeperiod ranges, add template support for ITL inherits

refs #4037
refs #4013

configconvert: update requirements, perl deps

refs #2743

configconvert: fix import parser - timeperiods require regex (thx LConfImport)

somehow, the Icinga2 import still fails with us holiday definitions. bug
that's not yet determined whose bug that is.

refs #4039
refs #4013

configconvert: add getopts and pod2usage incl help

fixes #4041

configconvert: add notification_interval|period

and refactor check|retry_interval vs normal|retry_check_interval

refs #4008

configconvert: make host->service linked service a template object, referenced by the host

this is not the best solution, as it it creates a service template for
each host-service relation. if you have many host_name entries defined
in your Icinga 1.x config for a service, this will create duplicates
then. requires some more code refactoring, therefore leaving the issue
open.

refs #3933

configconvert: drop config file prefix 'icinga2'

just makes it hard to work with.

refs #4036

configconvert: code cleanup

configconvert: export check_period for hosts/services

refs #2743

configconvert: WIP dependencies - for host based on host_name and parents

refs #4011

configconvert: s/Timeperiod/TimePeriod/g

refs #4013

configconvert: add hostdependency with hostgroup_name hosts unrolling

refs #4011

configconvert: add servicedependency support (host_name)

missing - the loop fun with hostgroups.

special config is here:
https://git.icinga.org/?p=icinga-core.git;a=blob;f=tests/etc/2743.cfg;hb=refs/heads/next#l376

refs #4011

configconvert: add service dependency support for hostgroups

well, a lot of looping required here:

- loop through all child hostgroup hosts and get their hostnames
- get the servive object based on each hostname (loop again) and
  the child service description
- loop through all master hostgroup hosts and get their hostnames
- get the master hostname based on each hostname (loop again) and
  the master service description, save that as service dependency

given that implementation, dependencies may be converted for now.

once we decide which options we support, we may add them as well.

refs #4011

configconvert: add support for * as service host_name next to comma seperated list

this is currently a proof of concept for services only, but should
target all the object tricks later on. this will be done on host_name
lookup and stored as array.

http://docs.icinga.org/latest/en/objecttricks.html

refs #4010

configconvert: refactor commaseperated list split

... to list of stripped strings into a function.

fixes #4046

configconvert: handle excluded hosts, ignore them on split to array

exclusions/exceptions cannot be treated by icinga2 the same way as in
1.x so it's better to not create unwanted objects.

fixes #4007

configconvert: replace colon in object names with underscore

it's a special delimiter and therefore forbidden.

fixes #4225

configconvert: detect additive inheritance for *groups and use += on export

i guess this can be used for host/service contact(groups) and other foo
as well, so let's see.

refs #4006

configconvert: add wildcard detection for 'members *' in hostgroup

currently adds itself to the host's hostgroups array, but maybe a global
template where all hosts inherit from, plus additive inheritance fit
better here.

refs #4010

configconvert: add a note about servicedeps wildcards todo

refs #4010

configconvert: svg-hg-hst logic may contain multiple hgnames for services

the object tricks section on the 1.x documentation contains everything
which makes the code less readable even here.

luckily the code is rather modular, so the extension for split string to
array, and looping doesn't hurt much.

refs #4010

configconvert: update README with usage and todos

refs #2743

configconvert: fix perl 5.14, skip non-existing objects

configconvert: escape display_name (may contain quotes)

refs #3931

configconvert: refactor using command objects (check/notification)

eventhandlers are missing.

fixes #4305

configconvert: add volatile attribute

fixes #4321

configconvert: eventhandler as EventCommand objects

fixes #4327

update TODOs

configconvert: remove obsolete itl notification template

and check if defined when used.

refs #2743

configconvert: write compat log too in icinga2 conf

Revert "itl: fix inclusion of notification.conf"

This reverts commit 02eb54dc1a818fdcafa6c85817e9f6341cf2831a.

configconvert: fix thinko with check_command|event_command in service

refs #2743
refs #4327
refs #4305

2013-06-24 13:19:39 +00:00 by (unknown) d050ee0

Config Conversion: add conversion script

Squashed Rebase, commit msg below.

convertv1->v2 initial import

refs #2743

itl: fix inclusion of notification.conf

Config Conversion: command macros, templates

refs #2743

WIP: try resolving the host->svc relation from templates and tricks

not finished yet, there's heavy recursion required

WIP configconversion: rewrite recursive lookup of linked host_name/service_description

this is a mess. configs may just use "name" instead of "host_name" on
type "host", same goes for service and service_descriptions. well, and
if it's a template, "name" is populated too.

the algorithm is not clean enough, and does not scale at all. there are
bugs, and the hostgroup linking is not yet taken into account too.

basics host -> service dumping of v2 config is implemented.

refs #2743

ConfigConvert: split into modules, add objects.cache read, dump cmd line

basically it works with

- dumping a host with all services, using templates
- check_command and all arguments/user macros translation
- reading the objects.cache file location from icinga.cfg
=> this is reserved only for getting dedicated relations
=> we do not want to duplicate the work of xodtemplate.c in perl here
- all important functions have been split up into their respective
  modules in order to support better re-usage (i.e. lconfexport)

still missing important bits:

- detect service->group<-host links and build templates
- detect other ugly template methods
- dump templates
- the ugly deprecated normal|retry_check_interval mapping
- timeperiod mapping
- contact => user mapping
- notifications rework (dedicated object)
- dependencies, escalations (to be documented/implemented)
- the infamous rest

ConfigConvert: fix hash keys for convert/dump in perl 5.14

ConfigConvert: improved template handling, host/service dump 2x

refactored code again, removed nested loop bottlenecks. still, the
resolval of host_name/service_description requires more love.

templates are now correctly detected, linked, and printed in 2x syntax.
service templates are _not_ linked against host definitions in 2x as
this is not possible.

commands for hosts do not exist in 2x, therefore the command_name of an
1x host will be taken and guessed against its related services. if
there's a match, the service will be linked as 2x 'hostcheck'.

*_interval still needs proper handling, as the default interval is 1m,
but 2x requires the identifier.

ConfigConvert: refactor host_name/service_description link resolving

previous algorithm was buggy, as well get_host_name always looked up
host template objects, even if the template object was a service. this
is now fixed by re-using the __TYPE attribute (set on Icinga 1x config
read).

the algorithm is now like

                       |---------------------------------|
                      \/                                 |
                   svc_desc?                             |
                0 /        \ 1                           |
              use tmpl?    END -------> [svc_desc]       |
             0 /   \ 1                                   |
[undef] <- BROKEN  getobjbyattr(['use'], __TYPE, svcdesc |
                    |                                    |
                 getsvcdesc(obj)                         |
                    |                                    |
                    --------------------------------------

refs #2743

ConvertConfig: add basic support for users, timeperiods, *groups

as well as display_name as attribute to print something.

contact => user mapping is added as well, manipulating the __TYPE var
too. furthermore display_name on the host will be overwritten by the
alias, if set.

the groups don't dump much, only the display_name if set. their dump
function is implemented generic, based on the __TYPE

ConfigConvert: fix 4 little big thinkos on import/convert/dump

1) do not skip lines containing ;.* - there may actually be a comment on
attr->val line. rather clean the line safely, and let the magic happen.

2) the type counter was implemented in order to have unique object ids
by type, since 1x config does not provide us with such. problem - the
function had a local var, saving the counter for each file, overwriting
the hash attributes later on, starting again with 0. nasty bug, hard to
figure out. fixed by feeding the type_cnt into the cfg_obj hive for now.
revamped the state machine logic as well, like so

I: define TYPE { 	--> __TYPE = TYPE
II: attr val		--> {type}->{type_cnt->cnt}->{attr} = val
III: }			--> type_cnt->cnt++
IV: <empty/comment>

3) also skip service templates (__IS_TEMPLATE) sooner, and do not try to
calculate some host_name/service_description magic out of them - they
just can't go down one level to the host, but only up with 'use'.

4) host and service templates on 2x config dump must check if
__USES_TEMPLATE is actually set to 1, checking for defined is not
enough.

whatthecommit.com:

A long time ago, in a galaxy far far away...

refs #2743

ConfigConvert: add more host/service attributes, groups

*_interval are automatically mapped, while the *groups attribute it
converted into an array in order to easily stash more groups on it.

still a todo - loop over existing groups and re-link their members into
the respective objects, as 2.x only supports that location.

fix for the host->service relation - use the already processed service
2x hashref in order to do some magic with host->{'SERVICE'} = service

all 2x attributes are now encapsulated with "", to stay safe.
todo - more generic config 2x dump.

furthermore, add some more code comments for the respective sections.

refs #2743

ConfigConvert: fix service linking not unique, add hostgroup->members re-link to host->hostgroups

while working on the missing servicegroups and their facepalm members
syntax (host1,svc1,host2,svc2 - awesome to parse), i figured that the
whole detection of services by their attribute 'service_description' is
not uniquely implemented. now the getter functions are duplicated, and
not modular anymore, for the sake of having a service identified by its
host_name + service_description. since that lookup is recursive, we must
pass the host_name from the very beginning - otherwise we could
accidently overwrite that with a template entry.

the hostgroup re-linking works, also thanks to the fact that the inner
object structure is just an array in the hashref, which allows smart
push.

contact/user groups are tricky again due to the different naming.

further todo: sort all macros and hostservice links. right now this
looks like chaos.

refs #2743

ConfigConvert: basic servicegroup parsing method

ConfigConvert: refactor multiple host_name's on service object detection

this is ugly. a service object may contain 'host_name' with
'host1,host2,host3' and so on. treating this as string won't allow us to
look into the template tree for valid host attributes, so we need to
rewrite the getter function, allowing some special treatment on
host_name arrays.

for the service object preparation this means: while in the service
loop, we need to loop again over all hosts, then dclone the hashref
object for the service, and add the unique host_name attribute again.

we might require some loop unrolling later, but for now this works as
expected.

refs #2743

ConvertConfig: disable debug output, some reformatting of dump

ConfigConvert: refactor host-svc links, add full service/usergroup relinking

due to the relinking afterwards we actually modify the service objects
already prepared for 2x. since the *group magic depends on the
host/services/users already prepared, we get a perpetuum mobile here
with the host loop and resolving service relations.

in order to safely fix the issue, there's a seperate host-service link
loop after resolving all the other needed objects, which may cost a
little bit more performance, but is safe and standalone, getting all
previous modifications, migrations and also hacks.

next to the refactored flow, the issue with resolving the correct
servicegroups and stashing them into an array is solved, as well as
converting the existing contactgroups to usergroups, as well as
re-linking existing contactgroup->members to their new home,
user->usergroups.

note: when parsing the servicegroup members into an array, it must not
be sorted afterwards, because we will shift 2 objects (host, service) in
order to identify the correct service object for adding the servicegroup
item.

some code reorganisation too, plus a minor comma fix for the host
address macro.

the used 1x configuration will be addressed in 2743.cfg on
icinga-core.git, with all future additions.

refs #2743

ConfigConvert: *interval, max_check_attempts dumped as numbers

see
https://git.icinga.org/?p=icinga2.git;a=blob_plain;f=lib/icinga/icinga-type.conf;hb=HEAD

refs #2743

ConfigConvert: fix undocumented contact templates conversion

refs #2743

s/DumpIcinga2Cfg/ExportIcinga2Cfg/g

just for Import/Export clarification.

configconvert: use special prefix for internal attributes

__I2CONVERT_ should do the trick, not to interfere with existing custom
variables.

configconvert: fix leftover from rename

configconvert: properly escape strings with double quotes

* command_line and command_args
* notification commands
* action_url, notes_url
* notes
* icon_image, icon_image_alt

fixes #3931

configconvert: fix multiple templates usage, template object lookup error

multiple host/service templates seperated by commas will cause some
irritation, therefore this is treated as array internally, like group
members. for the config export and "inherits", this is easy to fix. for
the actual host_name lookup for service objects, this unveiled another
bug when looping through all available templates - they are unique by
'name' and not by hostname/servicedesc, and require their very own
getter - obj_get_tmpl_obj_by_tmpl_name() - which makes sure to return
the object which is then looked into recursively if there's a host_name
provided.

possible bug for now - multiple service templates used and the host_name is
defined in one of them. but that's not the usual case, and won't be
supported for now.

refs #2743
fixes #3932

configconvert: dump modular timperiod attr and values

we need to ignore all other attributes which are to be cleaned sooner,
just for safety.

minor flaw: the keys are not sorted by weekdays now, but dumped like the
hash provides them.

fixes #4013

configconvert: support 'name' for groups' if *group_name is not set

this is a fallback for broken configs only, and since i got some, added
a small fix.

refs #2743

configconvert: add service->hostgroup<-hostmembers conversion to template support

WIP: there's multiple service->hostgroup relations - duplicated hosthg
templates. must be fixed.

refs #2743
refs #4016

configconvert: refactor service-hg-hosts for one hosthg template and multiple services

we need to first loop over all services, getting the key ids, collecting
them for each hostgroup_name (this is the unique identifier, because
this is our hosthg template later on).

then we loop over the collected unique hostgroups and build the 2.x
template logic. the difference here is now, that the code is refactored,
and loops over the service keys (getting their objects) only once,
pushing their templates plus a relation to a single (1) hosthg-template.

there's still some space for enhancements - the service template names
as well as hosthg template names as well as service object names are
generated with some hardcoded strings/numbers.

refs #2743
refs #4016

configconversion: remove debug output

configconvert: only dump macros if there are key-val pairs

configconvert: code cleanup

configconversion: explicitely check __I2CONVERT_USES_TEMPLATE == 1 when dumping service templates

refs #4020

configconvert: refactor how services without host_name are handled

this is mainly the cause when using hostgroup relations, or other object
tricks. we still need the single loop run to convert all 2.x object
attributes in one run, and deal with the missing attributes later on.

configconvert: WIP notification conversion

- refactored notification_commands parsing and storage
- do not add duplicated notification_command names to the 2x
  notification object hive
- create notifications based on the notification command linked from
  users
- move host->service link magic to the end again

refs #4008

configconvert: WIP notifications, how service/hosts relate to users and notifications

there may be more than one notification for the user, and we already had
the type in place. currently, that type is not taken into account (bug
to fix).

the rest with service -> user -> notification linking works in the first
implementation.

refs #4008

configconvert: final stage, rework notification type handling, fix naming amd template output

the config dump must take care of which notification type is dumped,
otherwise there would be yet another look required. Instead we are just
passing a reference from users to hosts/services with all prepared
notification attributes, and check them lazy on dump then.

further fixe on the notification names - they are not unique by their
command (now used on host/service scope, not user/contact) so we'll add
some magic number as suffix.

fixed template name dumping due to changed conversion vars too.

refs #4008

configconvert: write config files, refactor how objects are exported

structure is currently hardcoded, but may be changed to getopts later
on. all files are overridden into conf/ (testing only right on).

refactored export code, removed everything from Convert.pm, and export
is now called from the script directly, wrapped all dump loops and added
more function layers in betweed. open/close file handles take care of
everything, next to a header on top of the files for getting to know
their origin better (our hard work, ey?).

refs #4036

configconvert: fix service description handling, it's now an inner conversion value

previously, i've just re-used 'service_description' which isn't a valid
2.x attribute either. the lookup of service_description attribute in 1.x
templates works already, but populated __I2CONVERT_SERVICEDESCRIPTION
instead. in favor of having a generated value for all our objects, we'll
use that one, also for dumping the configuration.

even further, this is also changed for the service->hostgroup<-hosts
conversion then.

this also avoids writing empty service names into host->service objects.

fixes #4019

configconvert: add small main config file for standalone tests

refs #2743

configconvert: s/usergroups/groups/ for User config dump

configconvert: add README

configconvert: add ITL templates automatically (for services, notifications)

this currently only makes sense for services and notifications.

refs #4037

configconvert: fix timeperiod ranges, add template support for ITL inherits

refs #4037
refs #4013

configconvert: update requirements, perl deps

refs #2743

configconvert: fix import parser - timeperiods require regex (thx LConfImport)

somehow, the Icinga2 import still fails with us holiday definitions. bug
that's not yet determined whose bug that is.

refs #4039
refs #4013

configconvert: add getopts and pod2usage incl help

fixes #4041

configconvert: add notification_interval|period

and refactor check|retry_interval vs normal|retry_check_interval

refs #4008

configconvert: make host->service linked service a template object, referenced by the host

this is not the best solution, as it it creates a service template for
each host-service relation. if you have many host_name entries defined
in your Icinga 1.x config for a service, this will create duplicates
then. requires some more code refactoring, therefore leaving the issue
open.

refs #3933

configconvert: drop config file prefix 'icinga2'

just makes it hard to work with.

refs #4036

configconvert: code cleanup

configconvert: export check_period for hosts/services

refs #2743

configconvert: WIP dependencies - for host based on host_name and parents

refs #4011

configconvert: s/Timeperiod/TimePeriod/g

refs #4013

configconvert: add hostdependency with hostgroup_name hosts unrolling

refs #4011

configconvert: add servicedependency support (host_name)

missing - the loop fun with hostgroups.

special config is here:
https://git.icinga.org/?p=icinga-core.git;a=blob;f=tests/etc/2743.cfg;hb=refs/heads/next#l376

refs #4011

configconvert: add service dependency support for hostgroups

well, a lot of looping required here:

- loop through all child hostgroup hosts and get their hostnames
- get the servive object based on each hostname (loop again) and
  the child service description
- loop through all master hostgroup hosts and get their hostnames
- get the master hostname based on each hostname (loop again) and
  the master service description, save that as service dependency

given that implementation, dependencies may be converted for now.

once we decide which options we support, we may add them as well.

refs #4011

configconvert: add support for * as service host_name next to comma seperated list

this is currently a proof of concept for services only, but should
target all the object tricks later on. this will be done on host_name
lookup and stored as array.

http://docs.icinga.org/latest/en/objecttricks.html

refs #4010

configconvert: refactor commaseperated list split

... to list of stripped strings into a function.

fixes #4046

configconvert: handle excluded hosts, ignore them on split to array

exclusions/exceptions cannot be treated by icinga2 the same way as in
1.x so it's better to not create unwanted objects.

fixes #4007

configconvert: replace colon in object names with underscore

it's a special delimiter and therefore forbidden.

fixes #4225

configconvert: detect additive inheritance for *groups and use += on export

i guess this can be used for host/service contact(groups) and other foo
as well, so let's see.

refs #4006

configconvert: add wildcard detection for 'members *' in hostgroup

currently adds itself to the host's hostgroups array, but maybe a global
template where all hosts inherit from, plus additive inheritance fit
better here.

refs #4010

configconvert: add a note about servicedeps wildcards todo

refs #4010

configconvert: svg-hg-hst logic may contain multiple hgnames for services

the object tricks section on the 1.x documentation contains everything
which makes the code less readable even here.

luckily the code is rather modular, so the extension for split string to
array, and looping doesn't hurt much.

refs #4010

configconvert: update README with usage and todos

refs #2743

configconvert: fix perl 5.14, skip non-existing objects

configconvert: escape display_name (may contain quotes)

refs #3931

configconvert: refactor using command objects (check/notification)

eventhandlers are missing.

fixes #4305

configconvert: add volatile attribute

fixes #4321

configconvert: eventhandler as EventCommand objects

fixes #4327

update TODOs

configconvert: remove obsolete itl notification template

and check if defined when used.

refs #2743

configconvert: write compat log too in icinga2 conf

Revert "itl: fix inclusion of notification.conf"

This reverts commit 02eb54dc1a818fdcafa6c85817e9f6341cf2831a.

configconvert: fix thinko with check_command|event_command in service

refs #2743
refs #4327
refs #4305

2013-06-24 14:19:58 +00:00 by (unknown) 966be8f

configconvert: update README

refs #2743

2013-06-25 13:54:32 +00:00 by (unknown) 9a6fe2e3db351fdb3b80f81593487a2350447a57

configconvert: only export servicegroups when available

refs #2743

2013-06-25 14:00:29 +00:00 by (unknown) 053d9da83aeb1f0adbbce2a92ff643c04233184a

configconvert: rename unique notification object identifier

refs #2743

2013-06-25 15:59:30 +00:00 by (unknown) 66c61232d9f664d250c05f4197654dcca03cb064

configconvert: notification* attributes for services and users

refs #2743

2013-06-26 07:23:01 +00:00 by (unknown) 8eccb97

configconvert: only export servicegroups when available

refs #2743

2013-06-26 07:23:01 +00:00 by (unknown) bb2cbd0

configconvert: rename unique notification object identifier

refs #2743

2013-06-26 07:23:01 +00:00 by (unknown) 6e3afe7

configconvert: notification* attributes for services and users

refs #2743

2013-06-26 12:29:31 +00:00 by (unknown) 2985eee

configconvert: treat 'null' (disable inheritance) as '0' instead

refs #2743

2013-06-26 12:29:57 +00:00 by (unknown) 12916ec

configconvert: update README (NOTES and TODO)

refs #2743

2013-06-26 14:23:33 +00:00 by (unknown) 7599e85

configconvert: update README

refs #2743

2013-06-26 15:52:54 +00:00 by (unknown) 6ed811c

configconvert: fix already replaced quotes escaping

refs #2743

2013-07-02 11:03:29 +00:00 by (unknown) 2dc7cd2

configconvert: make host check_command a new service and link it as hostcheck

refs #2743

2013-07-02 11:03:29 +00:00 by (unknown) 6b649b8

configconvert: lookup host check_command in template tree for hostcheck magic

requires recursive template tree lookup in order to create the new
service linked as hostcheck directly on the host object.

refs #2743

2013-07-22 12:26:18 +00:00 by (unknown) 81b3b48

livestatus: add = operator for lists comparison

refs #2743

2013-08-29 11:14:59 +00:00 by (unknown) 53a72fc

Config Conversion: Fixes.

refs #2743

Relations:

@icinga-migration
Copy link
Author

Updated by gbeutner on 2012-08-22 06:42:34 +00:00

  • Target Version changed from Milestone 1 to Milestone 2

@icinga-migration
Copy link
Author

Updated by gbeutner on 2012-10-19 10:37:36 +00:00

  • Priority changed from High to Normal

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-06 13:00:54 +00:00

one thought - would it make sense to convert 1.x text files to 2.x text files, or rather, should the script just read 1.x text config, and dump all resolved objects into the newly adapted dynamic config api?
i would rather go for the second option, and reschedule that todo after the general api is in place.

@icinga-migration
Copy link
Author

Updated by gbeutner on 2013-01-30 19:40:59 +00:00

  • Assigned to set to mfriedrich

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-03-12 10:34:07 +00:00

  • Target Version changed from Milestone 2 to 111

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-04-04 18:43:47 +00:00

https://wiki.icinga.org/display/icinga2/Configuration+v1+and+v2

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-04-04 21:05:03 +00:00

to get an idea how ugly this has gotten:

on a host object, the host_name attribute is unique.
on a service object, you may define a comma seperated list of host_name attributes.

which makes the lookup in the template tree for possible host_name on the service object awesome hard.

for gods sake, i keep writing manual test configs, which are awesome for their uniqueness.

https://git.icinga.org/?p=icinga-core.git;a=blob;f=tests/etc/3088.cfg;hb=HEAD

define service {
        service_description             3088service1
        host_name                       3088localhost1,3088localhost2
        check_command                   3088test2
        use                             generic-service
}


DEBUG: service 3088localhost1 3088localhost2
$VAR1 = {
          'service_description' => '3088service1',
          '__IS_TEMPLATE' => 0,
          '__HOSTNAME' => [
                            '3088localhost1',
                            '3088localhost2'
                          ],
          '__USES_TEMPLATE' => 1,
          '__SERVICE_HOSTNAME' => '3088localhost1',
          'check_command' => '3088test2',
          'use' => 'generic-service',
          'host_name' => '3088localhost1,3088localhost2',
          '__TEMPLATE_NAME' => undef,
          '__TYPE' => 'service',
          '__SERVICEDESCRIPTION' => '3088service1'
        };

$VAR1 = {
          'service_description' => '3088service1',
          '__IS_TEMPLATE' => 0,
          '__HOSTNAME' => [
                            '3088localhost1',
                            '3088localhost2'
                          ],
          '__USES_TEMPLATE' => 1,
          '__SERVICE_HOSTNAME' => '3088localhost2',
          'check_command' => '3088test2',
          'use' => 'generic-service',
          'host_name' => '3088localhost1,3088localhost2',
          '__TEMPLATE_NAME' => undef,
          '__TYPE' => 'service',
          '__SERVICEDESCRIPTION' => '3088service1'
        };



object Host "3088localhost1" {
        display_name = "3088localhost1",
        macros = {
                address = "127.0.0.1"
        },

        hostgroups = [ "3088hg_A" ],
        check_interval = "5.000000m",
        retry_interval = "1.000000m",
        max_check_attempts = "10",
        services["3088service1"] = {
                templates = [ "generic-service" ],

                macros = {
                },
                check_command = "/bin/echo "3088 service"",
        },

        services["3088service2"] = {
                templates = [ "generic-service" ],

                macros = {
                },
                check_command = "/bin/echo "3088 service"",
        },

}       

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-04-04 21:13:46 +00:00

missed the second host.

remember - this is not the final output!

object Host "3088localhost2" {
        display_name = "3088localhost2",
        macros = {
                address = "127.0.0.1"
        },

        hostgroups = [ "3088hg_B" ],
        check_interval = "5.000000m",
        retry_interval = "1.000000m",
        max_check_attempts = "10",
        services["3088service2"] = {
                templates = [ "generic-service" ],

                macros = {
                },
                check_command = "/bin/echo "3088 service"",
        },

        services["3088service1"] = {
                templates = [ "generic-service" ],

                macros = {
                },
                check_command = "/bin/echo "3088 service"",
        },

}

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-04-04 21:13:51 +00:00

  • Status changed from New to Assigned

@icinga-migration
Copy link
Author

Updated by gbeutner on 2013-05-14 07:46:42 +00:00

  • Target Version changed from 111 to 115

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-06-22 09:43:24 +00:00

https://wiki.icinga.org/display/icinga2/Conversion+Script

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-06-24 16:08:08 +00:00

  • Status changed from Assigned to 8
  • Done % changed from 0 to 80

first version merged into master. there are still todos open, but the initial version works for us as test basis for existing configuration, triggering bugs for the upcoming milestone.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-06-24 16:08:23 +00:00

  • Status changed from 8 to Resolved
  • Done % changed from 80 to 100

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-09-23 12:51:54 +00:00

  • Project changed from Icinga 2 to 40

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-09-23 14:06:37 +00:00

  • Target Version changed from 115 to Milestone 1.x Compat

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-09-16 09:10:37 +00:00

  • Project changed from 40 to Icinga 2
  • Category set to Migration

@icinga-migration icinga-migration added enhancement New feature or request Migration labels Jan 17, 2017
@icinga-migration icinga-migration added this to the Milestone 1.x Compat milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant