How to declare a host attribute in a plugin so its renderable in table and searchable?


i want to write a plugin an declare host attributes, that are visible in tables and searchable.

I found that there are two ways, to declare.

Old Style with:


and new style with:

class HostAttributeExample(ABCHostAttributeText):
    def name(self):
        return "example"

    def title(self):
        return "Example"

    def topic(self):
        return HostAttributeTopicBasicSettings

    def openapi_field(self):
        return fields.String(

The Attributes are both visible and editable in the Host/Folder Forms.
But i cant use them in tables.

I wrote a Painter:

class PainterExample(Painter):
    def ident(self) -> str:
        return "example"

    def title(self, cell: Cell) -> str:
        return _("Example")

    def columns(self):
        return ["example"]

    def render(self, row: Row, cell: Cell):
        return ("", row["example"])

And it not show up. I think its because its not know in livestatus.
So i decided to use cmk.base.config, but after doing a config.load() and config.get_config_cache().get_host_config(row["host_name")).
I cant see the attribute anywhere.

Anyone know how to do it the right way?

Kind regards