
This Go application monitors Docker containers on a remote server and displays their status in the Tmux status bar.
- The configuration file has been renamed from
.env
to.tmux-docker-env
. - The
.tmux-docker-env
file is now located in the user's home directory (~/
). - The binary is now installed in
~/.local/bin/
. - All comments in the code have been translated from Portuguese to English.
- Ensure you have Go installed on your system.
- Clone this repository:
git clone https://github.com/yourusername/tmux-docker-monitor.git cd tmux-docker-monitor
- Build the application:
go build -o ~/.local/bin/tmux-docker-monitor
-
Create a
.tmux-docker-env
file in your home directory:touch ~/.tmux-docker-env
-
Add the following content to the
.tmux-docker-env
file, replacing the values with your actual server details:DOCKER_USER=your_username REMOTE_SERVER_IP=your_server_ip DOCKER_PASSWORD=your_password
- Ensure Tmux is running.
- Execute the Tmux Docker Monitor:
~/.local/bin/tmux-docker-monitor
The Tmux status bar will now display information about your Docker containers in the following format:
Total: X | Up: Y | Down: Z | Died: W
Where:
- X is the total number of containers
- Y is the number of running containers
- Z is the number of stopped containers
- W is the number of containers in a "dead" state
To have the Tmux Docker Monitor run automatically when you start Tmux, add the following line to your ~/.tmux.conf
file:
set-option -g status-interval 60
run-shell "~/.local/bin/tmux-docker-monitor"
This will update the status every 60 seconds. Adjust the interval as needed.
If you encounter any issues:
- Ensure the
.tmux-docker-env
file is correctly placed and formatted. - Check that the binary is correctly installed in
~/.local/bin/
. - Verify that you have SSH access to the remote server.
- Ensure the remote server has Docker installed and that your user has permissions to run Docker commands.
Contributions are welcome! Please feel free to submit a Pull Request.