Wir nutzen Cookies, um Ihnen eine optimale Nutzung dieser Webseite zu ermöglichen. Mehr Informationen finden Sie im Datenschutzhinweis. Wir nehmen an, dass Sie damit einverstanden sind, falls Sie diese Webseite weiter besuchen.

Ihre Cookie-Einstellungen
Ihre Einstellungen wurden aktualisiert.
Damit die Änderungen wirksam werden, löschen Sie bitte Ihre Browser-Cookies und den Cache und laden dann die Seite neu.

Werk #10199: Bakery plugins must save the configuration into yml_store parameter

KomponenteChecks & Agents
TitelBakery plugins must save the configuration into yml_store parameter
Datum2019-11-14 12:21:48
Checkmk EditionCheckmk Raw Edition (CRE)
Checkmk Version1.7.0i1
LevelTrivial Change
KlasseNew Feature
KompatibilitätKompatibel - benötigt kein manuelles Eingreifen

Previously the Bakery configured Windows Agent using check_mk.ini configuration file: every script in enterprise/agents/bakery directory could write own configuration data into the own file. All those files had been later gathered into one check_mk.ini configuration file.

Since this release the Bakery configures Windows Agent using only check_mk.bakery.yml. All data located in the ini file will be ignored.

To correctly configure Windows Agent you must use new parameter in your bake_*** function named yml_store. This parameter has type YamlStore and imported automatically from agent_bakery_plugins.py.

Now the configuration data of all plugins are stored in a standard Python dictionary, which replicates the structure of the Windows Agent's configuration file.

The following sample bake function sets the agent port setting for the Yaml file. It receives the configured port for the agent configuration and creates two entries, "enabled" and "port" in the "global" section.

def bake_agent_port(opsys, conf, conf_dir, plugins_dir, yml_store):
#                                                     ^^^^^^^^^
global_section = yml_store.make_section["global"] # mandatory to get dict
#                                        ^^^^^^
global_section["enabled"] = True  # mandatory also

global_section["port"] = conf  # configures the Agent port
#               ^^^^     ^^^^

The function above creates the following definitions in the check_mk.bakery.yml:

global:
enabled: True
port: 6551