Add a Discord webhook to the Ofelia Docker container

Tiempo de lectura: < 1 minuto

Today, we’ll learn how to set up Ofelia to notify us via Discord about the executions of the Jobs it performs.

The Ofelia container (https://github.com/mcuadros/ofelia) allows us to automate tasks with cron among our Docker containers. I find it very useful as it enables us to quickly save and replicate a Cron configuration in our projects for automated tasks.

By default, Ofelia allows sending notifications to Slack, but it doesn’t have a configuration for Discord.

This configuration can only be used with the [global] tag. Go to your config.ini file and add the following:

[global]
slack-webhook = https://discord.com/api/webhooks/XXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX/slack

We have placed the URL of our Discord webhook (bot) and added /slack at the end of the URL. This way, Ofelia will send a message when the automated task is completed:

Leave a Comment