20. 06. 2025 Andrea Mariani NetEye, Unified Monitoring

NEP Telegram Notification

Some time ago, my colleague Giuseppe Di Garbo published this article on the NetEye Blog, where he explained how to integrate NetEye notifications with Telegram.
It was a great starting point, and in fact many of us used it to enable NetEye’s notification system to send alerts directly to the Telegram app for many customers.

Later on, Telegram introduced the possibility to use threads (topics) within groups, so something more structured and easier to manage was needed both in terms of installation and configuration.

Well, today we can say it: we have a NEP for Telegram notifications!

Let’s see how to install and configure it

Obviously, installation follows what has been the standard procedure for NEP packages for a few years now.
Once the NEP package list has been updated, you can run:

nep-setup list

nep-setup install nep-notification-telegram

Now comes the slightly more complex part: creating the bot and retrieving the following values: bot_token, thread_id, and chat_id.

As already described in Giuseppe’s article, the basic configuration is essentially unchanged:

  • Open Telegram and search for @BotFather
  • Send /newbot and follow the instructions
  • Choose a name and a username (e.g., myname_bot, NOTE: it must end with _bot)
  • In the end, you’ll receive a token like this:
123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11

Save it, we’ll need it later.

Now:

  • Create a group
  • Add the bot as a member
  • If you want to use threads, enable “Topics” in the group settings
  • Write a message in the group or in a thread (e.g., “test”)

Retrieve all id’s via curl

After sending a message in the group, run:

curl -s "https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates"

Check the response. You should see something like this:

{
  "message": {
    "chat": {
      "id": -1001234567890,
      "title": "NetEye Notifications"
    },
    "message_thread_id": 33,
    "text": "test"
  }
}

Take note of the following:

  • chat.id = this is your chat ID, to use as telegram_chat_id
  • message_thread_id = this is your thread ID (optional, but very useful if you’re using topics), to use as telegram_thread_id

Test message sending

Before configuring NetEye, you can test if everything works with:

curl -s -X POST "https://api.telegram.org/bot<YOUR_TOKEN>/sendMessage" \
  -d "chat_id=-1001234567890" \
  -d "message_thread_id=33" \
  -d "text=Test notification from NetEye" \
  -d "parse_mode=HTML"

Final step

Now take all the IDs and tokens you’ve collected so far and insert them into the User Notification Template in NetEye.

Andrea Mariani

Andrea Mariani

Author

Andrea Mariani

Leave a Reply

Your email address will not be published. Required fields are marked *

Archive