.mkp installed, but how to enable?

I have downloaded and installed the ‘hello_world’ and ‘uname’ .mkp files from the exchange. 'mkp list ’ seems to show things correctly installed. However, even after some time, Checkmk does not detect any new services.

I noticed that the check-mk-agent package contains some empty directories that looked like they were intended for local checks/plugins, so I ran:

SITENAME=default

ln -s /omd/sites/$SITENAME/local/share/check_mk/agents/plugins/uname /usr/lib/check_mk_agent/local/uname

ln -s /omd/sites/$SITENAME/local/share/check_mk/agents/plugins/hello_world /usr/lib/check_mk_agent/local/hello_world

and shortly afterwards new services are discovered using these checks. Then I could activate the changes. So now to my question:

Should the ln-s (or mv or cp) command that I ran happen automatically or is it correct that I do it manually? If so, then is this step documented somewhere? I did not find any reference to this step at Checkmk extension packages (MKPs) - Integrating extensions from the community into Checkmk.

Thanks!

Alexis

Hi @alexis and welcome back to the community!

Well the symlinking will not help you if you need the check on a different host.
How you go about MKP in general is this:

  1. Install the MKP
  2. Activate Changes
  3. If an agent plugin is necessary make sure it is on the monitored host
  4. Discover services

The way how the plugin files come to the monitored system depend on your environment. If you have the CEE or CME you can distribute the plugin facilitating the agent bakery. Here it depends on the MKP if you get a nice rule for that plugin in the UI or if you need to deploy the file using the Deploy custom files with agent rule.
If you are running CRE you generally need to distribute the plugin files yourself. Either by copying them manually to the necessary host or by using some kind of automation like Ansible.

1 Like

Hi @robin.gierse, thanks for your reply. I’m not sure if I’m being a bit stupid or what, so let me describe in more detail what happens if I follow your instructions:

First, I cleaned up totally (‘mkp remove uname; mkp remove hello_world; rm /usr/lib/check_mk_agent/local/*’; navigate to Monitor–>All Hosts–>chifferi–>Host (menu)–>Service Configuration–>Fix All to fix the two vanished services).

Instruction #1:

chifferi# omd su default
OMD[default]:~$ wget -q https://exchange.checkmk.com/packages/hello-world/687/hello_world-0.1.3.mkp
OMD[default]:~$ mkp install hello_world-0.1.3.mkp
OMD[default]:~$

I went to my main dashboard and wait for an alert for host chifferi for ‘1 unmonitored service’ but it does not come. Perhaps that’s okay; I still have three instructions to go :slight_smile:

Instruction #2:

I navigated to Monitor–>All Hosts–>chifferi–>Host (menu)–>Service Configuration. There are ‘No pending changes’, so I can’t Activate Changes.

Instruction #3:

I skipped this because I’ve installed the plugin on the Checkmk server itself, which Checkmk is monitoring. (But I do understand that if I was trying to monitor this service on a remote host then I would need to do it.)

Instruction #4:

I don’t find anything like ‘Discover services’ on the ‘Services of host chifferi’ screen. The nearest is Hosts (menu)–>Services Configuration and then Actions (menu)–>Remove Old And Find New, which causes one activatable change:

2021-11-29 19:31:27 alexis Refreshed check configuration of host ‘chifferi’

So I activate that and then go back to the main dashboard and wait for new services to be detected. But again they are not.

A bit more research:

If I run check-mk-agent directly then it is clear it is not running the new check:

chifferi# /usr/bin/check_mk_agent | grep -i hello | grep -v grep
chifferi#

(My ‘grep -v grep’ is necessary because Checkmk is installed in an LXC container and so the ‘grep -i hello’ process would be displayed by check_mk_agent otherwise.)

But if I make the symlink (this time I’ll symlink the plugin to the plugin directory, which is probably more correct than symlinking it to the checks directory) and rerun check_mk_agent the agent now calls the plugin:

chifferi# /usr/bin/check_mk_agent | grep -i hello | grep -v grep
<<<hello_world>>>
hello_world 32.24537433085952
chifferi#

Now I go back to the main dashboard but, as before, I still don’t get an alert for host chifferi for ‘1 unmonitored service’.

So now I repeat your instruction #2 then ‘Hello World’ is now listed as an undecided service and I can click ‘Fix All’ to fix this and now everything works.

So it seems to me the instructions should be:

  1. install the plugin
  2. symlink it to where check_mk_agent will find it
  3. discover services

Any assistance you or anyone else can give would be appreciated! Thanks!

Alexis

Ah, I get it!

check-mk-agent will only see the plugin if it is installed in /usr/lib/check_mk_agent/plugins, so the mkp command is not adequate even on the Checkmk server! An extra step is needed.

In the case of the enterprise edition the extra step is that the bakery copies (locally or remotely) there.

In the case of the raw edition some other means (cp/ln/ansible if locally or scp/ansible if remotely) must put in there even on the Checkmk server.

So the mkp command is not really “installing” the plugin; instead it is unpacking it into a staging area, from where one of the two above extra steps still needs to be done.

You are getting close! :+1:

the mkp command installs the plugin and all supporting files for the server.
The agent bakery or you take care of installing the plugin for the agent.

Read this thoroughly to understand the agent and this for further reading on MKPs.

Hi Alexis, which are these steps can u be more verbose ??
Im using distributed monitoring: Master Check_MK → Slave Check_MK → Host with agent
I installed maxdb plugin with mkp in raw edition on the Master and seems all ok, I create the Rule, activated it, but after when I try to check the service on the host I couldn’t find any service.
I tried to bring maxdb.py on both path on the client part with winscp:
/usr/lib/check_mk_agent/local
/usr/lib/check_mk_agent/plugins
but still I didn’t find the service, any help who know better this topic?

Thx
Artan

Hi Artan, it’s been a long time since i looked at this, but I documented what I learned and did here. You can search that page for ‘mkp’. Good luck.

Alexis

Thx so much Alexis!!!

For the whole bakery process we wrote the hello_bakery example. This accompanies the article on the bakery API:

hello_world was meant to accompany the article on “Writing your own check plug-ins” (this article will get some restructuring later this year) and “Checkmk extension packages (MKPs)”.

1 Like