theme-sticky-logo-alt
rundeck notify

Sending Rundeck Notifications to Telegram Using Rundeck-Notify

This article will guide you through setting up Telegram notifications for your Rundeck Community Edition jobs using a custom webhook-based notification system. We’ll specifically use the custom-built GoLang application, rundeck-notify, to ensure reliable, instant alerts directly to your Telegram.

Why Telegram Notifications?

Telegram offers instant messaging with excellent reliability and widespread accessibility. By integrating Rundeck with Telegram via webhook notifications, you’ll immediately receive alerts about job completions, failures, and critical system events directly on your mobile device or desktop.

About Rundeck-Notify Application

rundeck-notify is a lightweight GoLang application designed specifically to act as a notification proxy between Rundeck and Telegram. It listens for webhook notifications from Rundeck and forwards formatted messages to your configured Telegram channel or group.

Key Features:

  • Easy and quick integration
  • Lightweight and robust
  • Simple JSON-based configuration
  • Specifically optimized for Telegram messaging

You can download rundeck-notify along with its configuration files (config.json and rundeck-notify.service) from here.

Installation Steps

Follow these simple instructions to set up rundeck-notify:

Step 1: Download and Uncompress the Application

Use wget to download the ZIP file:

wget https://lab53.uk/download/641/?tmstv=1744225307 -O rundeck-notify.zip --no-check-certificate

unzip rundeck-notify.zip
Step 2: Obtain Telegram Bot Token and Chat ID
  1. Open Telegram and search for BotFather.
  2. Start a chat and use the command /newbot to create a new bot.
  3. Follow the instructions provided by BotFather to get your Bot Token.
  4. Next, find your Chat ID by sending a message to your bot and then visiting the following URL:https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdatesReplace <YOUR_BOT_TOKEN> with the token obtained earlier. Your chat ID will be shown in the JSON response as "id": <CHAT_ID>.

Step 3: Configure the Application

  1. Edit config-sample.json with your Telegram Bot Token and Chat ID:
{
    "telegram": {
      "enabled": true,
      "bot_token": "",
      "chat_id": ""
    }
  }

Add in your bot token and chat id.

  1. Rename config-sample.json to config.json:
mv config-sample.json config.json
Step 4: Install the Application

Execute the following commands to set up the application:

sudo mkdir -p /opt/rundeck-notify
sudo mv rundeck-notify /opt/rundeck-notify/
sudo mv config-sample.json /opt/rundeck-notify/config.json
sudo chmod +x /opt/rundeck-notify/rundeck-notify
sudo mv rundeck-notify.service /etc/systemd/system/rundeck-notify.service
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable rundeck-notify
sudo systemctl start rundeck-notify
sudo systemctl status rundeck-notify

These commands ensure your application runs as a reliable systemd service.

Integrating Rundeck with rundeck-notify

In Rundeck Community Edition, configure your jobs to send webhook notifications to the rundeck-notify application endpoint. Rundeck sends a webhook HTTP POST request whenever the specified event (job failure, completion, etc.) occurs.

Ensuring Reliable Notifications

rundeck-notify ensures that all critical alerts from Rundeck reach your Telegram instantly. Manage the application with these common commands:

sudo systemctl restart rundeck-notify
sudo systemctl stop rundeck-notify

Recommended Practices:

  • Categorize and clearly format alerts (Critical, Warning, Info).
  • Regularly test the integration to ensure reliable alert delivery.
  • Ensure your Telegram bot and chat IDs are correctly configured in config.json.

Conclusion

Using rundeck-notify to integrate Rundeck with Telegram significantly improves your monitoring and alerting capabilities, ensuring immediate visibility of critical job events. Stay connected to your systems reliably with this simple yet powerful integration.

Share:
PREVIOUS POST
10 Strategies to Create Your Own Homelab Using Proxmox

0 Comment

LEAVE A REPLY

15 49.0138 8.38624 1 0 4000 1 https://lab53.uk 300 1