/TelegramAlert

TelegramNotification Plugin for Graylog

Primary LanguageJavaMIT LicenseMIT

TelegramNotification Plugin for Graylog

Build Status GitHub Release Graylog Marketplace Donate

TelegramNotification allows you to send Graylog alert messages to a specified Telegram chat.

Requirements

Requires Graylog 3.1 or later. It's recommended to use the latest Graylog release.

Installation

  1. Download the latest TelegramNotification release and place the graylog-plugin-telegram-notification-x.x.x.jar file in your plugin_dir that is configured in your graylog.conf as described in the Graylog documentation.

  2. Restart your graylog-server, i.e. systemctl restart graylog-server.

  3. Configure an alert notification as described in the next section.

Usage

Step 1 - Create Bot

Create a new Telegram bot with the BotFather and copy the bot token.

Step 2 - Get Channel ID

Use the Message Tool to find the Chat ID of the desired chat.

You can use a private chat, add the bot to a group-chat or to a channel. Just make sure to copy the correct Channel ID.

Step 3 - Add Notification

Navigate to Alerts > Notifications in your Graylog-interface and select Telegram Notification as the notification type.

The message is a template that can be configured as described in the Graylog Documentation

Settings

Update

To update the plugin you need to remove the old graylog-plugin-telegram-notification-x.x.x.jar (or telegram-alert-x.x.x.jar) file from your plugins folder and follow the installation instructions again.

You may need to remove and re-create your Telegram Notifications.

Development

Getting started

This project is using Maven 3 and requires Java 8 or higher.

  • Clone this repository.
  • Run mvn clean package to build a JAR file.
  • Optional: Run mvn jdeb:jdeb and mvn rpm:rpm to create a DEB and RPM package respectively.
  • Copy generated JAR file in target directory to your Graylog plugin directory.
  • Restart Graylog.

You can improve your development experience for the web interface part of your plugin dramatically by making use of hot reloading. To do this, do the following:

  • git clone https://github.com/Graylog2/graylog2-server.git
  • cd graylog2-server/graylog2-web-interface
  • ln -s $YOURPLUGIN plugin/
  • npm install && npm start

Plugin Release

We are using the maven release plugin:

mvn release:prepare
# ...
mvn release:perform

This sets the version numbers, creates a tag and pushes to GitHub. Travis CI will build the release artifacts and upload to GitHub automatically.

Credits

Thanks to:

  • Alexey Medov (@kakogoxepa) - for his valuable ideas and generous donation!
  • Everyone that starred this repository ⭐️ - you keep me motivated 🙂
  • Contributors that submitted useful pull-requests or opened good issues with suggestions or a detailed bug report.