a Collection of handy Mikrotik Scripts
Many of these scripts rely on Telegram to send notifications to your telegram bot with variables set in the setGlobals script. More details below on how to activate your bot.
Detailed instructions for setting up the Telegram Bot: https://www.forsomedefinition.com/automation/creating-telegram-bot-notifications/
Simplified instructions:
- Use telegram
- Chat with @botfather
- Type /newbot
- Give your bot a name... e.g. myMikrotik
- Give your bot a username... e.g. MyMikrotikBot
- You will get a message like this:
- RECORD THE TOKEN SHOWN IN THE MESSAGE
- Start a chat with your bot and type /start
- Exit aforementioned chat and create a Telegram Group conversation. Call it something like "Mikrotik Notifications"
- Invite your bot to the group.
- Access the following page (insert your bot's TOKEN and remove the <<< and >>> characters):
https://api.telegram.org/bot<<<TOKEN>>>/getUpdates
- Look for the group's ID as shown in green below. The group ID will normally be preceded by a minus sign. RECORD THE GROUPID:
- Do a test - You should now get a hello world message in the telegram group from your bot. If this didn't work, check steps 1-11 again.
https://api.telegram.org/bot<<<TOKEN>>>/sendMessage?chat_id=<<<-GROUPID>>>&text=Hello+World
- Keep your GROUPID and TOKEN and replace the values accordingly in setGlobals Script.