Skip to content

oviniciusfeitosa/discord-container-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord container notifier

Notify at Discord channel when docker containers are down.

How to use

Create your config.sh file.

cp config.sh.example config.sh

Edit the config.sh

url='https://discord.com/api/webhooks/99999999999999999999/______very_crazy_hash______'
username='MyBotName'
listOfContainers="mycontainer1 mycontainer2"

Start the script

./start.sh

Work with task scheduling

To work with a schedule to execute this script you can set following below.

  • Set the env DISCORD_CONTAINER_NOTIFIER_DIR globally to current dir
sudo sh -c "echo \"DISCORD_CONTAINER_NOTIFIER_DIR=$(pwd)\" >> /etc/environment"
  • Add scheduled job
crontab -e

  */5 * * * * sh -c "$DISCORD_CONTAINER_NOTIFIER_DIR/start.sh"

Monitor job schedule logs

grep CRON /var/log/syslog

# or

tail -f /var/log/syslog | grep CRON

References

About

Notify at Discord channel when docker containers are down.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages