Skip to content

Automatic docker health check monitoring and reporting

License

Notifications You must be signed in to change notification settings

zackelia/docker-healthmon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-healthmon

Docker Image CI

Automatic docker health check monitoring and reporting

About

healthmon is a Docker image that monitors all containers on the running system that report health checks. Upon a change, it sends a notification using Apprise.

Usage

healthmon can be run simply with a docker-compose.yml file.

services:
  healthmon:
    image: ghcr.io/zackelia/healthmon:latest
    container_name: healthmon
    restart: unless-stopped
    hostname: my-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
        # Find all supported URLs at: https://github.com/caronc/apprise
      - APPRISE_URL=mailto://userid:pass@domain.com

Advanced

For services not supported by Apprise, you can create custom/hooks.py and mount it at ./custom:/custom. The content of this file can be created using Apprise's Custom Notifications page. On container start, healthmon will log that it loaded the custom hooks.

Security

healthmon requires mounting in /var/run/docker.sock which is inherently dangerous as it allows trivial access to root on the host.

To remedy this, healthmon creates a non-privileged user that is only allowed to run a specific docker events command to subscribe to health status messages. No other elevated permissions are granted.