Skip to content

Docker_Container_monitor is a lightweight CLI tool written in Go that helps monitor running Docker containers and their services.

License

Notifications You must be signed in to change notification settings

Kobeep/Docker_Container_monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

42 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Docker Container Monitor πŸš€

CI Status

Docker Container Monitor is a lightweight CLI tool written in Go that monitors running Docker containers and their services. It provides real-time information about container states, checks service availability, and even supports remote monitoring via SSH. The project also includes a Python installer script for an automated setup.


Table of Contents


Overview

Docker Container Monitor is a powerful yet lightweight CLI tool designed to help you keep an eye on your Docker containers and the services running within them. With features ranging from automatic container detection to remote monitoring support via SSH, this tool makes it easy to ensure that your containerized applications are running smoothly.


Features

  • βœ… Automatic container detection No manual container naming needed.
  • βœ… Service health check Automatically verifies the accessibility of container services.
  • βœ… Remote monitoring support Monitor containers on remote hosts over SSH.
  • βœ… Real-time Docker events monitoring Subscribe to Docker events for dynamic updates.
  • βœ… Multiple output modes Choose from full status, container state, service availability, or event monitoring displays.
  • βœ… Simple CLI commands Use monitor for an instant overview.
  • βœ… Systemd integration Run as a background service for continuous monitoring.
  • βœ… Easy installation Fully automated setup with install.py.

Installation

Prerequisites

  • 🐳 Docker installed and running.
  • 🐍 Python 3 installed.
  • 🦫 Go installed (the installer will install it automatically if not present).
  • πŸ”‘ (Optional) SSH access for remote monitoring:
    • A configured ~/.ssh/config file, or
    • A private key for manual SSH authentication.

Steps to Install

  1. Clone the repository:
git clone https://github.com/Kobeep/Docker_Container_monitor.git
cd Docker_Container_monitor
  1. Run the installation script:
python3 install.py
  1. Verify installation:
monitor --help

Usage

Display full container and service status:

monitor

monitor

Display only container states:

monitor state

monitor

Display only service availability:

monitor service

monitor

Monitor Docker containers on a remote host:

monitor remote --host <hostalias>

Monitor Docker events in real time:

monitor events

For JSON output, use:

monitor events --json

Check systemd service status:

systemctl status monitor

How It Works

πŸš€ Retrieves a list of running Docker containers using docker ps πŸ”Œ Gets exposed ports for each container 🌐 Attempts an HTTP request to determine if the service inside the container is responsive πŸ”” Subscribes to Docker events for real-time monitoring. πŸ“Š Displays results based on the selected mode

Uninstallation

To remove the tool:

sudo systemctl stop monitor
sudo systemctl disable monitor
sudo rm /usr/local/bin/monitor
sudo rm /etc/systemd/system/monitor.service
rm -rf ~/Docker_Container_monitor

Contributing

πŸ’‘ Contributions are welcome! Feel free to submit a pull request or open an issue.

License

πŸ“œ This project is licensed under the GNU GPL License.

Author

πŸ‘¨β€πŸ’» Author: Jakub Pospieszny

GitHub

πŸ“Œ GitHub: Kobeep

About

Docker_Container_monitor is a lightweight CLI tool written in Go that helps monitor running Docker containers and their services.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •