Service labels in custom plugins

I everyone,

I´m in the middle of writing some checkmk plugins and want to know how to automatically assign a label to a service using the plugin.

I seem to miss the information in the documentation or did I misunderstand? In the documentation it says “automatic host and service labels are possible”.

Hi,

I think you can put the following in your output:

<<<labels:sep(0)>>>
{ "mykey": "myval" }

Please try.
Kind regards, Christian

This is for host labels. Service labels have to be generated in the discovery function of the check plugin. Have a look at check_mk_extensions/sslcertificates/lib/check_mk/base/plugins/agent_based/sslcertificates.py at 17c17fd3c6af140e2c95f61b95c6bbb623f95cb7 · HeinleinSupport/check_mk_extensions · GitHub

1 Like

@r.sander Thank you for the tip. It worked!

1 Like