How to monitor Docker and Dockerised application with Icinga2

This forum was archived to /woltlab and is now in read-only mode.
  • Hi,


    I've setup a demo environment using Icinga2 and icinaweb2 on AWS and have integrated it with graphite and grafana. The setup is working fine and I am able to monitor the windows and linux host. however i don't see a way to monitor docker and the application running on it.


    Our infrastructure is on AWS and the our applications architecture is web based that is running as micro-services in docker containers and we are using the dropwizard framework for our application.


    My goal is to monitor all those microservices, responses, communication between the containers and performance of the application and containers.


    There is a plugin "check_docker" for Nagios but it doesn't have support for Icinga2


    Can you please help!


    Thanks,
    Amir

  • Icinga plugins are actually nagios plugins, so if you have a check_docker nagios plugin, it should work perfectly well in icinga.
    Just be sure to write a corresponding CheckCommand. You can see how it is done by looking at icinga ITL.
    example: https://github.com/Icinga/icin…command-plugins.conf#L311
    (this is if icinga agent runs locally on the docker servers, else you want to use something like nrpe)


    You can also directly monitor your microservices from the outside if they are reachable from your monitoring system.


    Cheers

  • Thank you for the help!


    In our current our current monitoring set(collectd, graphite, grafana, seyren), we are using collectd agent running parallely in a docker container to collect the matrices from of the docker containers and services running on them.


    Would it be possible to run the Icinga client locally on the docker host and able to gather all the matrices(containers/applications/hosts) by using this check_docker plugin.


    Also how can I monitor the micro-services from outside?

  • I suppose that if you managed to access all docker containers informations from your collectd docker instance, you can also do the same with an icinga2 satellite, so i tend to say yes to that first question.


    To monitor the micro-services from outside, you'll need an instance of icinga running on another host.
    (technically it could be on the same host, but monitoring from there doesn't seem cool if the host crashes)
    You can then check your webservices using check_http.


    If you need more in-depth informations, you can setup a /monitoring endpoint on the webservices, that, for example, tries to connect to its database and/or the services it depends on and reports a 200 if it's fine, a 500 if there are errors.
    I also suggest that you add an IP whitelist and/or authentication for this endpoint and report 403/401 if not allowed, to avoid being vulnerable to DOS.