Hello_bakery, windows and yaml

Hi team,
Looking for some guidance, I have been playing around with making my first plugin, have read till I am seeing cross-eyed…
Building off the hello_bakery mkp I have been able to build it out, and is working great on Linux.

The challenge comes with windows, in the bakery example we have this :

# Just because we can we will also write a Windows configuration. In contrast to
# Unices, Windows configuration is kept in a centralized file, not in
# individual files for each plugin.

Which unless I wrong… ( 3 days of :face_with_head_bandage: ) writes my cfg to the check_mk.bakery.yml file, which has two issues.

  1. Powershell does not natively read YAML
  2. Conflicting other scripts either putting it in check_mk.user.yml or create their own custom ( mk_oracle as example )

So I have managed to make something work, by loading powershell-yaml in my script, this is not great, and in fact slows the plugin down, since I either need to “pre-load” it on all my windows boxes, or I needed a -Force to get around prompts and do not get my started on security…

So some help from the great team here would be appreciated. Or do I need to go down the path of converting my PS1 to VBS :fearful:

Thanks always,

For Windows you should do it the way i have done it with my “Windows Patch day” plugin

It writes a own config file that will then be read by the plugin.
Inside the plugin API you have the function “PluginConfig” and it is working like expected.

As always Andreas comes in for the win :wink:

Thanks bud, working like a charm.