monitoringlocalagentcheck-mk

Installing local checks for Check_MK's agent


I'm trying to write local checks for a Check_MK instance on a computer with OMD installed. I don't have admin rights on this machine, so I work as an OMD site like this:

sudo omd su $MY_SITE

And, like my standard user, the site user does not have admin rights either.

In the Check_MK documentation for writing agent-based checks I find that I have two options for doing this:

  1. Editing /usr/bin/check_mk_agent, which is impossible with the rights I have or

  2. Creating a script in /usr/lib/check_mk_agent/plugins/, which is also impossible because this folder is only writeable to root.

When I run cmk --paths I see that there's a folder for "locally installed agents and plugins" at $MY_SITE_HOME/local/share/check_mk/agents/. This folder has a subfolder named plugins. If I put a script in there, however, its output doesn't show up when I run check_mk -d localhost. It is set to be executable and it does produce valid output, as far as I can tell:

<<<helloworld>>>
Hello world!

Am I putting the script in the wrong folder? Is it necessary to have admin rights in order to write agent based checks in Check_MK?


Solution

  • One way of doing this without admin rights would have been to edit main.mk to include include a new datasource program. I would have liked to have a local folder that was analog to /usr/lib/check_mk_agent/plugins/, but it seems that this is not possible. I ended up having one of our admins give me the rights to /usr/lib/check_mk_agent/plugins/.