Questions to build custom dashlets

Is there an official/supported way to create custom dashlet types in CMK 2.5 that actually appear in the Vue dashboard picker? For example via a plugin registration that extends INTERNAL_TO_API_TYPE_NAME or WidgetContent?

Is ABCFigureDashlet still usable for third-party plugins, and if so — does it appear in the picker, or is it also limited to the hardcoded list?

Is there a roadmap entry or documentation for third-party dashlet development in CMK 2.5? The Exchange still has 2.4-style dashlets that are silently broken.

Investigation

What I found when porting to CMK 2.5:

After investigating the CMK 2.5 source on a 2.5.0p7 site, I found three fundamental changes:

1. show() is completely gone. Dashlet.show() no longer exists in cmk.gui.dashboard.dashlet.base. The dashboard is now fully Vue-based. There is no Python HTML-rendering path for dashlets anymore.

2. The Vue frontend only knows hardcoded widget types. In cmk/gui/dashboard/api/_utils.py there is a hardcoded dict INTERNAL_TO_API_TYPE_NAME with ~30 entries (url, hoststats, servicestats, nodata, linked_view, etc.). DashboardConstants.generate_api_response() uses this dict — only types listed here appear in the dashboard picker. Custom types registered via dashlet_registry.register(MyClass) are silently ignored by the frontend.

3. WidgetContent is a fixed Pydantic discriminated union. In cmk/gui/dashboard/api/model/widget_content/__init__.py the WidgetContent type is a hardcoded Annotated[TypeA | TypeB | ... | URLContent | ..., Discriminator("type")]. Custom dashlet types are not in this union and would fall into NotSupportedContent.

Greetz Bernd

1 Like