0

OMD User

# omd create docker-user
# su - docker-user
  1. How to monitor docker container?
  2. Micro services memory usage inside the docker container?
  3. How to configer docker container as check_mk agent?

Iam using Check_mk for monitoring my servers and know want to monitor for docker as well?

sha
  • 1
  • 2

2 Answers2

0

Here are two options:

  1. when you deploy your container add the check_mk_agent at/during provisioning and using the Check_MK Web-API, add your host, do discovery, etc.

  2. you can use the following plugin to monitor docker containers.

Alternatively if you are using the enterprise version you can use the current innovation release (1.5.x) which has native Docker support.

  • 1.5.x has been release and you can now monitor docker containers without doing anything inside the container. Just deploy the check_mk_agent as usual on your docker hosts and you're set. – Marius Pana Oct 01 '18 at 11:11
0

This is a late answer but since this came on top of my Google search results, I will take some time to add up to Marius Pana's answer. As of now, the raw version of Check_MK also supports natively dockers. However, if you want dedicated checks inside your docker, you will need to actually install a Check_MK agent inside the docker. To do that, you need to start some sort of shell (generally sh or bash) inside the docker with docker exec -it <id> sh. You can get your docker ID with docker ps.

Now that's the easy part. The hard part is to figure out which package manager you are dealing with inside the docker (if any) and how to install inetd/xinetd or your preferred way of communication for your agent (unless it's already installed). If it's a Ubuntu-based image, you will generally need to start with a apt update, apt-get install xinetd and then you can install your packaged Check_MK agent or install it manually if you prefer. If it's a CentOS-based image, you will instead use yum. If the image is based on Arch Linux, you will probably want to use pacman.

Once you managed to install everything in your docker, you can test by adding your docker IP to Check_MK as a host. Please note that if your docker is using the host IP, you will need to forward port 6556 from your docker to another port on your host since I assume you're already monitoring the host through port 6556.

After you've checked everything is working, 2 more things. If you stop there, a simple restart of your docker will cancel every change you've made, so you need to do a docker commit to save your changes to your container image. And lastly, you will want to plan container updates ahead: you can do reinstall the agent every time a new version of the container is pulled (you could even script this), or you could add instructions to your cont-init.d which would be executed every time you launch your docker.

dan
  • 3,439
  • 17
  • 54
  • 82