Community discussions

MikroTik App
 
User avatar
PKSpeleo
newbie
Topic Author
Posts: 28
Joined: Fri May 13, 2022 6:02 pm
Location: Munchen

Telegram bot message when internet is down.

Mon Aug 15, 2022 11:43 pm

Hello!
I have an idea to run on my MT script which will send me telegram message when it is NO internet on it or MT switched off =)
Sounds interesting, doesn't it?
How MT will send a message if it is down or no internet?

But I have an idea!
When router loaded and have an internet - it will send me message "I am back"
Then MT will create scheduled message with 5 minuted delay.
After 4 minutes MT should delete this message and create new b]scheduled message[/b] and so on.
If it will be no internet - MT will not able to delete the previous message and this message will be automatically sent by Telegram even if MT is offline!

What do you think of my idea?
Maybe someone can explain the flaws of this idea to me, or maybe someone has already done it and can share the script?
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1070
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Telegram bot message when internet is down.

Wed Aug 17, 2022 1:08 am

I have a script/module to Send notifications via Telegram. If notification can not be sent it is queued and sent later. Is that what you want?
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1070
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Telegram bot message when internet is down.

Wed Aug 17, 2022 1:20 am

The message looks like this when coming from queue...
Screenshot_2022-08-17_00-17-41.png
This one was sent by Forward log messages via notification.
You do not have the required permissions to view the files attached to this post.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Telegram bot message when internet is down.

Wed Aug 17, 2022 3:16 pm

The user want a mesasge when routerboard is down or offline.
But whant that message instantly, not when the routerboard come back online.
 
holvoetn
Forum Guru
Forum Guru
Posts: 5317
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: Telegram bot message when internet is down.

Wed Aug 17, 2022 3:27 pm

Conceptually I think the idea of OP is definitely not wrong.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Telegram bot message when internet is down.

Wed Aug 17, 2022 3:59 pm

Yes, but usually I use separate device on battery than send a SMS when something go wrong...
(as backup of the backup, the main Router send W–app message if the LTE device do not work as expected).

The main "The Dude" on another location, also warn if some device are unresponsive.
 
PortalNET
Member Candidate
Member Candidate
Posts: 126
Joined: Sun Apr 02, 2017 7:24 pm

Re: Telegram bot message when internet is down.

Mon Dec 26, 2022 10:35 pm

Hello!
I have an idea to run on my MT script which will send me telegram message when it is NO internet on it or MT switched off =)
Sounds interesting, doesn't it?
How MT will send a message if it is down or no internet?

But I have an idea!
When router loaded and have an internet - it will send me message "I am back"
Then MT will create scheduled message with 5 minuted delay.
After 4 minutes MT should delete this message and create new b]scheduled message[/b] and so on.
If it will be no internet - MT will not able to delete the previous message and this message will be automatically sent by Telegram even if MT is offline!

What do you think of my idea?
Maybe someone can explain the flaws of this idea to me, or maybe someone has already done it and can share the script?
Your idea is great at some point.. you either need dual WAN balance links in order to send the telegram notification to your telegram group..

in that case you can setup netwatch on mikrotik for each specific interface with your 2 Gateway IPs from your ISPs providers, then shortly after that you can get telegram bot api to receive notification.. if spefici interface LINK 1 or LINK2 gateway IP ping is down for over couple of seconds with ms timeout over 1000ms for example.. you will receive an alert for that.. and when it comes back online you will receive a message again.


The other option is USB or micro USB on your mikrotik in order to get a backup 4G GSM hub with sim active online.. só it can forward the messages from your main WAN unique link if it ever goes down.. u can setup also via netwatch..

Who is online

Users browsing this forum: No registered users and 20 guests