Solved

Monitor docker container

  • 2 November 2022
  • 4 replies
  • 104 views

Badge +1

Hello, I would like your help, I have 2 docker containers that I would like to monitor with Centreon, the truth is that I have no idea how to start or carry out this work, if it is possible for the console to be seen in case the container is down or up

icon

Best answer by gespada 11 November 2022, 10:51

View original

4 replies

Userlevel 3
Badge +12

Hello @cristianandres9 

For Docker you have 3 possibilities dedicated to that.

Docker | Centreon Documentation

cAdvisor API | Centreon Documentation

cAdvisor | Centreon Documentation

With the first you have a mode who would be a solution for you, documentation is not updated.

So you could see here the differents mode for Docker :

https://github.com/centreon/centreon-plugins/blob/e40d869bf4a584d1b5228b3b31686ee49a80606a/cloud/docker/restapi/plugin.pm#L33

With cAdvisor, you have the API :

https://github.com/centreon/centreon-plugins/blob/e40d869bf4a584d1b5228b3b31686ee49a80606a/cloud/cadvisor/restapi/plugin.pm#L33

And By Prometheus cAdvisor : 

https://github.com/centreon/centreon-plugins/blob/e40d869bf4a584d1b5228b3b31686ee49a80606a/cloud/prometheus/exporters/cadvisor/plugin.pm#L33

 

Regards,

Greg

Badge +1

hi and thanks @gespada clone the git repository but I'm stuck in tests I'm doing the perl command centreon_plugins.pl --plugin=cloud::docker::restapi::plugin --mode=node-status --help why I think it's the one I need to see the status of the container but I don't know how to complement it
this is the docker I want to test:

CONTAINER ID   IMAGE                                   COMMAND                  CREATED         STATUS          PORTS                                            NAMES
e39fe4f9a030 docker.elastic.co/kibana/kibana:7.3.1 "/usr/local/bin/dumb…" 3 months ago Up 3 months 0.0.0.0:5601->5601/tcp kibana


I appreciate any guide

Userlevel 3
Badge +12

Hello,

Have you check the differents tips here (first to apply best security practice ) : https://thewatch.centreon.com/product-how-to-21/best-practices-how-to-secure-the-monitoring-of-your-docker-container-266

And here (a deployment in French) : https://www.sugarbug.fr/framboise/clusterhat_pi/monitoring/

According your Docker version, API is : https://docs.docker.com/engine/api/#api-version-matrix

Enable the Rest API is mandatory, in order to monitor Docker with centreon-plugins :  ://docs.centreon.com/pp/integrations/plugin-packs/procedures/applications-docker-restapi/#prerequisites

If you have activated Docker Rest API and you have an retour, please post a detail of your command and error message.

To troubleshoot, you could add --debug option at the command.

Regards,

Badge +1

Hello, @gespada Thanks for the guide, it worked correctly for me.

Reply