Hello icinga-community,
I just installed a icinga2 instance to monitor our internal infrastructure.
The infrastructur contains multiple VMs and also containers.
We used nagios before.
Icinga2 (Icingaweb2+director) is installed on our monitoring-server and on the dockerhost icinga2 and the monitoring-plugins are installed.
I “walked” through the icinga wizard on the client (dockerhost) :
icinga2 node wizard
Both are able to communicate with eachother and the standard-plugins are working fine.
But we need to monitor the docker-container as well.
The plugin is the following → GitHub - timdaman/check_docker: Nagios plugin to check docker containers · GitHub
What I did:
- I added the “check_docker” script to the dockerhost, also installed the “python docker library” on the dockerhost and I added the Command to /etc/icinga2/conf.d/commands.conf .
object CheckCommand "check_docker" {
import "plugin-check-command"
command = [ PluginDir + "/check_docker" ]
arguments = {
"--containers" = {
value = "$container_name$"
description = "Container Name"
}
"--status" = {
value = "$container_status$"
description = "Status of the container"
}
}
vars.container_name = all
vars.container_status = running
}
- The user nagios is allowed to use the script (check_docker) by using sudo without a password on the dockerhost.
- I created a command in the director and it looks like that:
-
Next I defined some data fileds for the connection, the container and the status:
-
The Preview looks like this:
-
At next I created a service template for just one container (PiHole for example)









