Sending notifications with Telegram BOT from Vigor Router

Telegram is a popular instant messaging (IM) service that allows users to exchange messages, share media and files, make private and group voice or video calls, and conduct public live broadcasts. Using IM services is becoming more and more popular in today's world. Following the trend, Vigor routers can also be configured to send notifications/alarms of network events through Telegram Bot, including VPN disconnected/ reconnected, WAN disconnected/ reconnected, and Web login/SSH login/ Configuration change events. All the current Vigor Router support sending notifications via Telegram. The complete list of supported events will be listed in the Notification Object and can be various depending on the model and firmware version.

Imagine that the Vigor router encounters an abnormal situation when the IT staff is not in the office during non-working hours. Users continue to try to create connections but fail due to the VPN being down or the server being interrupted due to WAN downtime. If the IT staff can receive warning messages from the Vigor router through Telegram on his phone, it will help to solve the problem rapidly and shorten the time it takes for the server to return online.

This article will guide you through the configuration steps to set this up in a Vigor router.

Step 1: Create a chatbot on Telegram from your phone
  • 1.1 Search for @BotFather and add it to your contacts. @BotFather is a Bot used to create other Bots.
  • 1.2 Send a message /newbot to the bot, which will lead to creating your bot for sending the notifications.
  • -If it replies “choose a name for your bot”, you can enter the name like Vigor3912_Bot. The name must end in _Bot.

    -If it replies, “This username is already taken,” the name is already used. You must try a different name (also ending in _bot).

    -When the Bot is created successfully, it will reply to the token info.

    The token info will be used on the Vigor Router’s configuration later.

    Add your bot to your contacts by clicking the t.me/XXXX_Bot link

  • 1.3 Similarly, you can search for @userinfobot on Telegram and add it to your contacts. @userinfobot is a Bot you can ask for the Chat ID or user ID. Send a message /start to the bot, and he will reply with the Telegram Chat ID/User ID. The ID info will be used in the Vigor Router configuration.
  • Step 2: Router Configuration

    2.1 Create a customized SMS provider profile

  • Go to Objects Setting >> SMS/Mail Service Object
  • Select a custom profile, can be index 9 or index 10
  • Enter the name of the Service Provider.
  • Enter the following API of the Telegram Bot. The token we got from Step 1.2 needs to be filled in the API without double quotes. https://api.telegram.org/bot”Your Bot Token”/sendMessage?chat_id=###txtDest###&text=###txtMsg###


    2.2 Send a Test message

    This will confirm if the Telegram Bot created can send the message correctly.

    Click Send a Test Message button.


    Enter the Telegram ID from step 1.3 as the cellphone number, then click OK. Vigor Router will send the test message to the Telegram ID.


    Then check the Telegram App on the phone and see if the test message is received.

    2.3 Create Notification Object

    Go to Objects Setting >> Notification Object, select an index, and configure the events that need the notification.


    2.4 Configure SMS/Mail Alert Service

    Go to Applications >> SMS/Mail Alert Service, check to Enable an index, select the SMS service provider we created for TelegramBot, the notification profile, and enter the Recipient Number. The Recipient Number is the network administrator's Telegram User Chat ID got from step 1.3.


    The network administrator will now receive the notification of Vigor Router on the Telegram App when the defined events happen.


    1. Set up an SMS profile on the Vigor2136 by navigating to Configuration/ Notification Services/SMS Provider and adding a new profile. In this example, we use the Customized Service Provider option to send notifications via Telegram. Refer to this article to register a Telegram Bot account and get the Telegram Bot token.

  • Give a name for this profile
  • Switch on Enabled to enable it
  • Select the WAN interface that SMS connection will be created from
  • Select Customized for the Service Provider
  • Enter the SMS Provider API URL
  • The API for different providers may not be the same. Please find the information from the provider’s website. For Telegram, it is https://api.telegram.org/bot/sendMessage?chat_id=&text=

    To verify if the SMS message can be sent successfully, please enter the Recipient Number into the SMS Provider API URL, then click the Send Test Message button.

    https://api.telegram.org/bot/sendMessage?chat_id=0912345678&text=this is a test message

  • Select POST as the HTTP Method
  • Click Send Test Message. The Vigor Router will display the Send Status. If the status shows SUCCESS, the SMS API settings are correct.
  • Check if the recipient receives the Telegram message.
  • After confirming that the SMS settings work, change the Telegram’s SMS Provider API URL back to the standard format: https://api.telegram.org/bot/sendMessage?chat_id=&text=
  • Modify the SMS API parameters according to the Service Provider’s API requirements. For Telegram, use text to specify the message content and chat_id to specify the recipient number. Note: chat_id will be able to save in firmware version 5.3.0.1.
  • 2. Enter SMS/Telegram Number (chat_id) information for the Admin account by editing the admin profile via System Maintenance / Account & Permission. Switch On Enable SMS and enter the SMS number.

    3. Navigate to Configuration / Notification Services, then click +Add to create a notification profile.

  • Enter a Profile Name
  • Select the Events that will trigger the router to send an alarm
  • Switch On to enable SMS Alert
  • Select the account(s) which should receive the notifications
  • 4. The Vigor router will now notify the administrator via SMS whenever a WAN or VPN connection disconnects or reconnects, or when someone logs in or changes the router settings.

    Published On:2025-03-11 

    Share

    Was this helpful?   

    book icon

    Knowledge Base