A Docker State Change Monitor and Notifier (Telegram, Discord, Gotify, Ntfy, Pushbullet, Pushover, Slack) as linux service
pip install -r requirements.txt
config.json
{
"TELEGRAM": {
"ON": true,
"TOKENS": [
"first tocken",
"second tocken",
"...."
],
"CHAT_IDS": [
"first chat_id",
"second chat_id",
"...."
]
},
"DISCORD": {
"ON": false,
"TOKENS": [
"first tocken",
"second tocken",
"...."
]
},
"SLACK": {
"ON": false,
"TOKENS": [
"first tocken",
"second tocken",
"...."
]
},
"GOTIFY": {
"ON": false,
"TOKENS": [
"first tocken",
"second tocken",
"...."
],
"CHAT_URLS": [
"first server_url",
"second server_url",
"...."
]
},
"NTFY": {
"ON": true,
"TOKENS": [
"first tocken",
"second tocken",
"...."
],
"CHAT_URLS": [
"first server_url",
"second server_url",
"...."
]
},
"PUSHBULLET": {
"ON": false,
"TOKENS": [
"first tocken",
"second tocken",
"...."
]
},
"PUSHOVER": {
"ON": true,
"TOKENS": [
"first tocken",
"second tocken",
"...."
],
"USER_KEYS": [
"first user_key",
"second user_key",
"...."
]
},
"SEC_REPEAT": 10
}
make as service
nano /etc/systemd/system/dockcheck.service
[Unit]
Description=docker state change monitor
After=multi-user.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/python3 /opt/dockcheck/dockcheck.py
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable dockcheck.service
systemctl start dockcheck.service