Icinga / Nagios plugins to check metrics of Docker / PodMan containers

Pylint pycodestyle Unit tests Release



  • this repository contains a collection of Icinga / Nagios plugins to check Docker / PodMan containers
  • Written for python3
  • Only requires standard python modules, no additional dependencies
  • To be executed i.e. via NRPE on the container host, uses the local "docker"/"podman" binary to query container metrics


Usage example

# default usage
./ -c containername
OK - containername (b343972b5de9) is Up 3 days - CPU: 8.65%, Memory: 10.62 GiB, PIDs: 304 | cpu=8.65%;;;; pids=304;;;; mem=11403138171B;;;;33565169418 net_send=2570000000B;;;; net_recv=2750000000B;;;; disk_read=1580000000B;;;; disk_write=3760000000B;;;;

# With custom socket file location (i.e. for rootless docker or multiple instances of docker daemon on one host)
./ -c containername --socket 'unix:///run/user/1000/docker.sock'

# Search for a container that matches ** (default is to only search for exact matches)
./ -c containername --wildcard


usage: [-h] -c CONTAINER_NAME [-t TIMEOUT]
                                       [-s SOCKET] [--wildcard]
                                       [--cpuwarn CPUWARN] [--cpucrit CPUCRIT]
                                       [--memwarn MEMWARN] [--memcrit MEMCRIT]
                                       [--pidwarn PIDWARN] [--pidcrit PIDCRIT]

Icinga/Nagios plugin which checks health and statistics of a Container

optional arguments:
  -h, --help            show this help message and exit
                        Name of the Container which should be checked
  -t TIMEOUT, --timeout TIMEOUT
                        timeout in seconds
  -s SOCKET, --socket SOCKET
                        Path to Docker socket, sets environment variable
  --wildcard            --container is a wildcard, not an exact match

  --cpuwarn CPUWARN     warning threshold for CPU usage (in %)
  --cpucrit CPUCRIT     critical threshold for CPU usage (in %)
  --memwarn MEMWARN     warning threshold for memory usage (in Bytes)
  --memcrit MEMCRIT     critical threshold for memory usage (in Bytes)
  --pidwarn PIDWARN     warning threshold for number of processes in container
  --pidcrit PIDCRIT     critical threshold for number of processes in

Icinga2 service check Icinga2 service check


  • You're welcome to open issues or pull requests