Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: 6ff5fbfe64c42da693bacade88aac7b1339ca999
https://github.com/tribe29/checkmk/commit/6ff5fbfe64c42da693bacade88aac7b13…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2021-08-05 (Thu, 05 Aug 2021)
Changed paths:
M bin/.f12
A bin/post-rename-site
M cmk/.f12
A cmk/post_rename_site/__init__.py
A cmk/post_rename_site/main.py
A cmk/post_rename_site/plugins/__init__.py
A cmk/post_rename_site/plugins/actions/__init__.py
A cmk/post_rename_site/plugins/actions/sites.py
A cmk/post_rename_site/registry.py
M cmk/update_config.py
M omd/packages/check_mk/check_mk.make
A omd/packages/check_mk/scripts/post-cp/01_cmk-post-rename-site
A omd/packages/check_mk/scripts/post-mv/01_cmk-post-rename-site
A omd/packages/check_mk/scripts/post-rename/01_cmk-post-rename-site
A omd/packages/check_mk/scripts/update-pre-hooks/01_mkp-disable-outdated
A omd/packages/check_mk/scripts/update-pre-hooks/02_cmk-update-config
R omd/packages/check_mk/update-pre-hooks/01_mkp-disable-outdated
R omd/packages/check_mk/update-pre-hooks/02_cmk-update-config
M omd/packages/omd/omdlib/main.py
M tests/testlib/pylint_checker_cmk_module_layers.py
A tests/unit/cmk/post_rename_site/plugins/actions/test_sites.py
A tests/unit/cmk/post_rename_site/test_main.py
Log Message:
-----------
Introduce management of site renamings
Users which execute `omd mv` or `omd cp` expect Checkmk to not only
rename the site, but also migrate the Checkmk configuration in a way
that they can continue seamlessly with their existing Checkmk
configuration.
This feature did not exist before and was a common misunderstanding.
OMD itself is only caring about migrating the files and file parts that
are initially installed with the skel hierarchy of OMD and under control
of it. *Clearer:* If you create a clean site and then execute `grep -r
$OMD_SITE etc` in your site, you can see a lot of files which contain
the ID of the site. These things are already migrated by OMD.
But OMD is not aware of the configuration files of the applications
shipped with OMD. For example the Checkmk configuration files are not
understood by OMD. And that's totally fine from an architectural point
of view, because OMD is an separate component that manages installation
of different applications, but must not mess with their individual
files.
However, from a users perspective it's clear that you also want the
application files to be migrated during site renaming. And this is
what we'll now start to work on.
This change introduces the general mechanism:
- OMD detects changes of the site ID (mv, cp or restore)
- Then it executes the command `post-rename-site -v -o [OLD_SITE_ID]`
- The command `post-rename-site` then takes care of the Checkmk
configuration updates
- It can also detect some situations it can not solve on it's own
and warns the user about potential manual steps to do afterwards.
The migration steps are realized in so called rename action plugins.
One first example can be found in
`cmk/post_rename_site/plugins/actions/sites.py`. More to come...
CMK-5346
Change-Id: I67d892fee381eb32bccceb60016efccb8b0bad00
Commit: 63556ed73f54ff3cd8fb9bdb2a5f98e2b3b3a064
https://github.com/tribe29/checkmk/commit/63556ed73f54ff3cd8fb9bdb2a5f98e2b…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2021-08-05 (Thu, 05 Aug 2021)
Changed paths:
M cmk/post_rename_site/main.py
A cmk/post_rename_site/plugins/actions/hosts_and_folders.py
M cmk/post_rename_site/plugins/actions/sites.py
A tests/unit/cmk/post_rename_site/plugins/actions/conftest.py
A tests/unit/cmk/post_rename_site/plugins/actions/test_hosts_and_folders_action.py
M tests/unit/cmk/post_rename_site/plugins/actions/test_sites.py
M tests/unit/cmk/post_rename_site/test_main.py
Log Message:
-----------
Add post rename action for host and folders `site` attribute
It updates explicitly set `site` attributes and also rewrites
the `site` host_tags entries in hosts.mk files.
Change-Id: Ia6379ca877c4f46464a2fb29943bf79e8b1604a7
Commit: 078c154e7eb95f04a1f536bcec3a6e4d040358ee
https://github.com/tribe29/checkmk/commit/078c154e7eb95f04a1f536bcec3a6e4d0…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2021-08-05 (Thu, 05 Aug 2021)
Changed paths:
M cmk/post_rename_site/main.py
M tests/unit/cmk/post_rename_site/test_main.py
Log Message:
-----------
Add post rename action for dynamic host configuration `site` attribute
Change-Id: I1af93f22a1932f42de2910d69327cf0d0d2c37b4
Commit: 42d81ca2cc7b85f6c175b14a07d3556547fabb42
https://github.com/tribe29/checkmk/commit/42d81ca2cc7b85f6c175b14a07d355654…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2021-08-05 (Thu, 05 Aug 2021)
Changed paths:
A cmk/post_rename_site/plugins/actions/update_core_config.py
A cmk/post_rename_site/plugins/actions/warn_about_not_migrated_configs.py
A cmk/post_rename_site/plugins/actions/warn_changed_ports.py
A cmk/post_rename_site/plugins/actions/warn_remote_site.py
M tests/unit/cmk/post_rename_site/test_main.py
Log Message:
-----------
Post rename: Update core config; Add some warnings
* After all the configuration changes the core config needs to
be updated to enable the site to be started afterwards.
* Add some warnings for things the user needs to know after renaming a
site.
Change-Id: Id10e9668786b10c02b10142032de94a81d9f875c
Commit: de6101091fbefcc4c127e55b009d099915e09768
https://github.com/tribe29/checkmk/commit/de6101091fbefcc4c127e55b009d09991…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2021-08-05 (Thu, 05 Aug 2021)
Changed paths:
A .werks/12850
Log Message:
-----------
12850 Migrating Checkmk configurations during site renamings
Users which execute <tt>omd mv</tt> or <tt>omd cp</tt> expect
Checkmk to not
only rename the site, but also migrate the Checkmk configuration in a way that
they can continue seamlessly with their existing Checkmk configuration.
This feature did not exist before and was a common misunderstanding. The
commands listed above did not take care of the Checkmk configuration files. In
fact the site management, which is realizing the renaming of a site, does not
know anything about the Checkmk configuration files.
However, with this change we create the integration of both worlds. In the
moment a site renaming or copy is performed, the site management informs
Checkmk about this action and gives it the chance to update it's configuration
files.
The most important parts of the Checkmk configuration are now updated:
<ul>
<li>Distributed monitoring (sites) configuration</li>
<li>Host & folder site attributes</li>
<li>Dynamic host configuration site attribute</li>
</ul>
The new logic is also trying to detect specific situations and displays
warnings about things that can (currently) not be migrated automatically.
For example, if the renaming of a distributed remote site is detected, a
warning is now displayed that you also have to update the distributed
monitoring configuration in the central site of your setup.
<i>Details:</i>
OMD, which is responsible for providing the site management of Checkmk, itself
is only caring about migrating the files and file parts that are initially
installed when creating a new Checkmk site. <b>Clearer:</b> If you create a
clean site and then execute <tt>grep -r $OMD_SITE etc</tt> in your site, you
can see a lot of files which contain the ID of the site. These things are
already migrated by OMD.
But OMD is not aware of the configuration files of the applications shipped
with OMD. For example the Checkmk configuration files are not understood by
OMD. And that's totally fine from an architectural point of view, because OMD
is an separate component that manages installation of different applications,
but must not mess with their individual files.
However, from a users perspective it's clear that you also want the application
files to be migrated during site renaming.
This change introduces the general mechanism:
<ul>
<li>OMD detects changes of the site ID (mv, cp or restore)</li>
<li>Then it executes the command <tt>post-rename-site -v -o
[OLD_SITE_ID]</tt></li>
<li>The command <tt>post-rename-site</tt> then takes care of the
Checkmk
configuration updates</li>
<li>It can also detect some situations it can not solve on it's own
and warns the user about potential manual steps to do afterwards.</li>
</ul>
The migration steps are realized in so called rename action plugins which can
easily be extended. In the git you can find them at
<tt>cmk/post_rename_site/plugins/actions</tt>.
Change-Id: I2d63fad256e2fa1fad8285e38de97a95cd8270f2
Compare:
https://github.com/tribe29/checkmk/compare/19f1899a09c1...de6101091fbe