Writing your own plugin - Checkmk won't find services

Hello everyone,

following the guide (Writing your own check plug-ins) I have created a Python3 plugin for the host (Debian 9) which adds a new section to the Checkmk Agent output. The script is placed in /usr/lib/check_mk_agent/plugins/.
The agent adds the plugins output as expected.

For the Checkmk Server I have written a custom Python3 check plugin with check, discover and register in it (as stated in the guide) and placed the script in the Sites context in local/lib/check_mk/base/plugins/agent_based/.
The plugin is executable (755) and owned by the Sites user and group and ends with “.py”.

Doing a “cmk --detect-plugins=<myplugin> -vI <myhost>” returns “SUCCESS - Found no new services, no new host labels”.

I was not able to find out why the check does not discover the new service.
I went as far as literally copying the entire script from the guide page (" The complete plug-in at a glance") and placing it on the host as well as the Checkmk server, still the same result.
I can see the custom output with “cmk -d <myhost>”:

<<<foobar>>>
West 100 100
East 197 200
North 0 50

The Checkmk Server however still does not find anything when querying with
“cmk --detect-plugins=<myplugin> -vI <myhost>”

Any suggestions?

Checkmk Server is Debian 9 with check-mk-raw-2.0.0p1_0.stretch_amd64.deb installed.This text will be hidden

Can you please share your check plugin (located in your site under ~/local/lib/check_mk/base/plugins/agent_based/.

Or give us a link, where we can find it.

The Check plugin must contain the same identifier as used in the agent output for your section “<<<foobar>>>” and the discover function must yield at least one Service() object.

Best Regards

Markus

It seems as if the “–detect-plugins=<myplugin>” for the cmk command is faulty and actually does not find the plugin in the output.
I just tried it without the “–detect-plugins” option and got a result with the expected values back.

So everything is fine now.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.