Want to add a sub-section in WATO -> Agent Rules

As we’re writing a lot of plugins now, we would like to create an additional sub-section in the “Agent Rules” page in WATO.

Reading the sources, I found the sub-sections being defined in lib/check_mk/gui/cee/plugins/wato/agent_bakery/rulespecs/utils.py

So I tried to create a “my_utils.py” in ~/local/share/check_mk/web/plugins/wato which defines the new sub-section “My fancy plugins”, but with no result.

But… when I add the code for creating the sub-section to a plugin script that consumes the new sub-section (in its “group” at rulespec_registry.register), then it works!

Question: what is the correct way to create this sub-section?

Have a look at the extension here: https://github.com/HeinleinSupport/check_mk_extensions

You will find multiple examples of bakery plugins including rulesets, one is https://github.com/HeinleinSupport/check_mk_extensions/blob/cmk2.0/ceph/web/plugins/wato/ceph_cee.py

Hi Robert,

thanks for the link!

But I already know how to add a plugin to the bakery with “rulespec_registry.register”.

What I want is to create a new group for the rulespec_registry, something like this:

@rulespec_group_registry.register
class RulespecGroupMonitoringAgentsAgentPluginsMine(RulespecSubGroup):
@property
def main_group(self):
return RulespecGroupMonitoringAgents

@property
def sub_group_name(self):
    return "agent_plugins_mine"

@property
def title(self):
    return _("My Own Agent Plugins")

Putting that code into my python file that does the rulespec_registry.register works, but I would like to use that new group in other plugins too, so I’d like to define that group somehow “global”… but it doesn’t work when creating the group in a separate file…