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

silence in the wood`s ?!?!?!

@BH2005

No official way, however:

1 Like

Hi @BH2005,

We are currently looking into options for embedding custom widgets in Checkmk 2.5 dashboards.

Right now, the most feasible approach is using the Embed URL widget to load your custom widget inside an IFrame. To make this much more useful, our plan is to support passing dashboard filters (both default and runtime) as URL parameters so your custom widget receives the full context of the dashboard.

Would this solution work for your use case?

Additionally, you mentioned wanting “custom dashlet types in CMK 2.5 that actually appear in the Vue dashboard picker”. Could you share a bit more about why having them directly in the widget picker is important for you?

Best,
Mathieu