I am writing here after searching docs and The Web for a while now without result. So I try to find an answer here. The question is: how can I configure a custom plugin in WATO and bake certain config into an agent, so that this config will be placed in /etc/check_mk at the remote host?
yes, you can do that.
In 2.3 you can use the new bakery api to achieve that. The API Documentation can be found in you site in help - “Plugin API references”.
There is an example integration for different operating systems.
Further examples can be found in the checkmk exchange. I think e.g. the sslcertificates MKP by Robert does exactly that for linux systems.
@aeckstein thanks for the hint! Basically this means on older setup with 2.2.0 there is no way to do so? I just found other configs like mk_inventory.cfg on the host in /etc/check_mk but did not find out how they got there. Maybe the are provided by core Checkmk.
it is also possible to do the same in checkmk 2.2.
You can look into /lib/python3/cmk/base/cee/plugins/bakery like grep -r "yield PluginConfig" /opt/omd/versions/<your version>/lib/python3/cmk/base/cee/*
There are a lot examples how and what can be achieved.
I would also look into MKP packages in the checkmk Exchange where that problem has already been solved e.g. the ceph or the sslcertificates plugin.
If you only want to deploy the config you will need:
The valuespec definition to set the needed values with a rule - /web/plugins/wato/yourplugin.py
The bakery configuration to deploy the configuration file into the package - /lib/python3/cmk/base/cee/plugins/bakery/yourplugin.py
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.