- Notifications
You must be signed in to change notification settings - Fork0
Bash script that posts Docker Events to Telegram
License
JulyIghor/DockerEvents
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A simple Bash script that posts Docker Events to Telegram. It is minimal implementation and it is using a few MB of RAM and low CPU usage.
It is built for all architectures supported byalpine docker image.
By default it is sending containerstart/stop/unhealthy status for non zero exit codes and ignoring containers that started with the restart policy valueno.
You can defineHOST_NAME for each instance, or mount/etc/hostname as read only. That will be used in notification message title.
Also you can set up filters using environment variables to get notifications you need. Use bash patternswiki.bash-hackers.org/syntax/pattern
TELEGRAM_API_TOKEN - Telegram bot API keyTELEGRAM_GROUP_ID - Telegram group idTELEGRAM_MENTION - list of Telegram usernames to mention, separated by spaces
FILTER_NAME - filter container name (default:+(*))FILTER_IMAGE - filter image name (default:+(*))FILTER_HEALTH - filter health status (default:!(healthy))FILTER_EXITCODE - filter exit code (default:!(0|130))FILTER_RESTART_POLICY - filter restart policy (default:!(no))
HOST_NAME - define a host name for notifications, by default it reads the/etc/hostname fileTIMEZONE - optional time zone for event time, for exampleAmerica/New_York
docker run -d --name='DockerEvents' -e 'TELEGRAM_MENTION'='@ighor' -e 'TIMEZONE'='America/New_York' -e 'TELEGRAM_API_TOKEN'='..' -e 'TELEGRAM_GROUP_ID'='..' -v '/var/run/docker.sock':'/var/run/docker.sock':'ro' -v '/etc/hostname':'/etc/hostname':'ro' --cpus="0.1" -m 50M --restart always 'julyighor/dockerevents:latest'
gitlab.com/ighor/DockerEvents
github.com/JulyIghor/DockerEvents
hub.docker.com/r/julyighor/dockerevents
registry.gitlab.com/ighor/dockerevents
About
Bash script that posts Docker Events to Telegram
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.