MikroTik Telegram bot

  Рет қаралды 28,950

MikroTik

MikroTik

Күн бұрын

Пікірлер: 102
@mikrotik
@mikrotik 2 жыл бұрын
If you get an authentication failure, please set up an RSA key kzbin.info/www/bejne/bqXXaJmJq8l5iK8
@proeatalk
@proeatalk 2 жыл бұрын
Thank you. i set it up. But now i got interesting behaviour: if you add a public key accidentally to a private key list, then > when i have active ssh session and I run command /system ssh-exec, even with different user - my session drops immediately > i tried to exec "ssh-exec" via terminal in winbox and it just hangs and do nothing, no output, no log records but what i also noticed: the script fails with default firewall configuration (out of the box) with command /ip/firewall/filter/print it only sends four messages and then fails Received: /ip/firewall/filter/print Flags: X - disabled, I - invalid; D - dynamic 0 D ;;; special dummy rule to show fasttrack counters chain=forward action=passthrough the script output at this moment says status: failed failure: closing connection: 149.154.167.220:443 (5) so line contains something incorrect. Thank you anyway for the telegram script.
@uasrv
@uasrv 2 жыл бұрын
thanks it works
@RB01-lite
@RB01-lite 2 жыл бұрын
@@daviderisi9610 First check if you copied the bot access token and user id correctly and if they are correct, check routing and firewall rules.
@wisnuharyanto4999
@wisnuharyanto4999 2 жыл бұрын
Thank you
@dtb_toughbaby
@dtb_toughbaby Жыл бұрын
THANK YOU BEEN WORKING ON THIS
@jakirbasha69
@jakirbasha69 2 жыл бұрын
This is one of many things why I love Mikrotik so much.
@drumaddict89
@drumaddict89 2 жыл бұрын
this is huge! very comprehensive script. didn't know the scripting engine in ROS is THAT mighty thanks for that anyways.
@andrew-in-australia
@andrew-in-australia 2 жыл бұрын
Great idea and execution - thanks for adding variable support to the ssh-exec function so we can run this in near-realtime 🙂
@RB01-lite
@RB01-lite 2 жыл бұрын
It's the :execute function that currently does not have the variable output option, but it might get fixed. ssh-exec is just the workaround
@thepentoll
@thepentoll 4 күн бұрын
Awesome
@jesuseduardo5658
@jesuseduardo5658 2 жыл бұрын
HI, I made every step following all the instructions in the video, but whatever be the message setn, the answer is same all time: Received: "Any CLI Command Sent". So, what can I do?
@Aston701
@Aston701 Жыл бұрын
im having the same issue did you find an answer ? i get the recieved: but nothing else
@DumitruBodencov
@DumitruBodencov 2 жыл бұрын
I get the following error: action timed out - try again, if error continues contact MikroTik support and send a supout file (13). Although the router confirms script initiation and returns the received command in Telegram. ROS 7.5
@RB01-lite
@RB01-lite 2 жыл бұрын
First check if you copied the bot access token and user id correctly and if they are correct, check routing and firewall rules.
@DumitruBodencov
@DumitruBodencov 2 жыл бұрын
@@RB01-lite My router has full access and I use sme bot for my Netwatch notifications. As I mentioned before the router replies back what command it got from my telegram message, so that's not an internet access issue.
@RB01-lite
@RB01-lite 2 жыл бұрын
@@DumitruBodencov Oh, my apologies. Interesting, that needs investigating - it has to be some configuration issue.
@mirmigois
@mirmigois 2 жыл бұрын
I have the same isus. I executed the script line by line on terminal and i get "failure: authentication failure" at line /system/ssh-exec 0.0.0.0 "interface print". I disabled also the firewall rule action drop ssh without luck. I have enable ssh at services. I disabled user admin and i use another full access user. I also tried 127.0.0.1 and 192.168.10.251(my router ip) but nothing. :( :(. Now I have a suspicion that I need to generate RSA keys. But it should be both public and private on the router, definitely for a new user and with limited read-only access since I only want it for control.
@mirmigois
@mirmigois 2 жыл бұрын
Finally it worked. I created a new user (read_only__user) that initially had full access. I created the RSA keys logged in as the read_only__user and passed the public and private key onto the router again as read_only__user for the read_only__user. I passed both telegram and telestarter as the read_only__user to have rights, i changed the line [:system ssh-exec 0.0.0.0 $command as-value]->"output" to [:system ssh-exec 0.0.0.0 user=read_only_user $command as-value]->"output". I then connected with my regular user and move read_only__user in group read. I also set a firewall rule accept ssh from 127.0.0.1 above of the rules for knocking port to use ssh from 0.0.0.0/0, reboot and OK. You can do the same process for your normal user.
@acidmeerkat
@acidmeerkat 2 жыл бұрын
Great job! But here is the question what if me using custom ssh port, but not 22. Is there is way to work around it? I mean do will work? Also invalid value for argument address: failure: dns name exists, but no appropriate record failure: dns name exists, but no appropriate record
@daviderisi9610
@daviderisi9610 2 жыл бұрын
All Working very well! Thanks a lot !
@UlrichWessendorf
@UlrichWessendorf 2 жыл бұрын
Great, but it doesn´t work here. First I get an "authentification error" what I ´ve fixed with the RSA-Key, but now after e.g. a "interface print" command I get an "action timed out - try again, if error continues contact MikroTik support....." 😕
@RB01-lite
@RB01-lite 2 жыл бұрын
First check if you copied the bot access token and user id correctly and if they are correct, check routing and firewall rules.
@bBlackDen
@bBlackDen 2 жыл бұрын
Thank you for new perfect video. Information are more useful, chat with route awesome! Why you do not used rest api and paste command like uri path?
@kirksteinklauber260
@kirksteinklauber260 2 жыл бұрын
Nice Video!!!! is there a way to manage multiple routers? I have a configuration having my bot and myself on chat groups? and each chat group can have 1 or multiple Mikrotik routers? Maybe specifying the name of the router (that has to be unique) to tell Telegram to which router to talk? or do I need different bots (1 per router?) I use it today to get messages and alerts mostly from Netwatch
@RB01-lite
@RB01-lite 2 жыл бұрын
You could have multiple routers talking through the same bot. More efficient would be to have only one router running a script and then manage the others through ssh-exec, but you need to write your own script then.
@koleanmoldovan
@koleanmoldovan Жыл бұрын
Please add the possibility for sending to telegram directly, for example, backups.
@gpmdp
@gpmdp Жыл бұрын
Hi! I've do all steps in order, I have the notification of "Telegram script initiated.", I send a command like : interface print I receive the message "Received: interface print" as expected.... but it "dies" here, the information (i.e. the print of my router's interfaces) never arrives. What may be wrong? FORGET IT! You have subbmited an update of this and using new method (:execute against sss-execute) its working as expected!!!!! 1M 👏👏👏 Thanks to you and your work!!!!!
@Aurelien.IGT.237
@Aurelien.IGT.237 Жыл бұрын
Please help me I have a same problem … I received Telegram script initiated but whe I send command ie: ip address print I don’t have a result and I received a menu confirmations of the bot
@marlastephens4965
@marlastephens4965 Жыл бұрын
having the same issue also any update on this?
@gpmdp
@gpmdp Жыл бұрын
Have you tried the updated version of script? It use another method to execute, and it was succesful to me@@marlastephens4965
@proeatalk
@proeatalk 2 жыл бұрын
@MikrotikLatvia I see the error in the log "login failure for user admin from 127.0.0.1 via ssh" when script tries to use ':local fun ([:system ssh-exec 0.0.0.0 $command as-value]->"output");' and i got the same when i tried to run such command in the terminal Could you give any advices? RouterOS 7.7
@dtb_toughbaby
@dtb_toughbaby Жыл бұрын
YES BEEN LOOKING FOR THIS
@peterj.1086
@peterj.1086 Жыл бұрын
Cool feature, I would like to use it too. Are there any known problems with RS 7.11.2? Unfortunately the script crashes after the first request.
@vladimirbasistyy
@vladimirbasistyy 2 жыл бұрын
interesting! what about using this on multiple devises? like bot can print a list of devices that is runing script \ you pick one that you need to manage \ than send commands
@FoxSaneko
@FoxSaneko 2 жыл бұрын
you need a separate backend for that
@vladimirbasistyy
@vladimirbasistyy 2 жыл бұрын
@@FoxSaneko or script can add FOR cycle with the ID of device, generate a script with for_id and run it at all devices?
@uasrv
@uasrv 2 жыл бұрын
I get an error in the terminal: failure: authentication failure how to fix?
@RB01-lite
@RB01-lite 2 жыл бұрын
Where do you get the message?
@uasrv
@uasrv 2 жыл бұрын
@@RB01-lite after Received: interface print status: finished downloaded: 0KiBC-z pause]
@RB01-lite
@RB01-lite 2 жыл бұрын
@@uasrv That means the ':system ssh-exec 0.0.0.0 $command as-value' failed to ssh your own router, this is normal if you have set a password, to fix it please add an RSA key. There are videos on both on how to set up RSA keys and how to do automation with ssh-exec.
@proeatalk
@proeatalk 2 жыл бұрын
@@RB01-lite Same here, also in the log "login failure for user admin from 127.0.0.1 via ssh" when script tries to use ':local fun ([:system ssh-exec 0.0.0.0 $command as-value]->"output");' and i got the same when i tried to run such command in the terminal
@christianhesse3366
@christianhesse3366 2 жыл бұрын
I guess this is because ssh-exec failed to authenticate...
@Aurelien.IGT.237
@Aurelien.IGT.237 Жыл бұрын
i try it now and the scrip going on so I received the telegram script initiated but all the command I typing in my bot Telegram don’t something in my router
@RaviShankar-fh2zv
@RaviShankar-fh2zv Жыл бұрын
in script local user ID means which one I have insert in that place
@GixD_
@GixD_ 2 жыл бұрын
Telegram is very cool Messenger🥳
@cuvalibr3
@cuvalibr3 Жыл бұрын
I see the error in the log "login failure for user admin from 127.0.0.1 via ssh" when script tries to use ':local fun ([:system ssh-exec 0.0.0.0 $command as-value]->"output");' and i got the same when i tried to run such command in the terminal Could you give any advices? RouterOS 7.7
@40giaz
@40giaz 2 жыл бұрын
another reason why i could not live without MikroTik :v
@ulysses4536
@ulysses4536 2 жыл бұрын
does it really need to send every line as a separate message?
@RB01-lite
@RB01-lite 2 жыл бұрын
Actually, no. You could replace every newline character with %0A and it should work.
@maxXx_cz
@maxXx_cz 2 жыл бұрын
😪 i have only "failure: closing connection: 0.0.0.0:22 (6)" or "failure: authentication failure" when i open ssh to all
@chadtaylor1148
@chadtaylor1148 2 жыл бұрын
Authentication Failure - default admin account is removed from system. Setting an rsa keypair is nearly impossible to get working. Modified the script to add my port=xxx and user=myspecialuseraccount then generating a usable RSA keypair has been proving nearly impossible to accomplish.
@marlastephens4965
@marlastephens4965 Жыл бұрын
am not getting any reply from the mikrotik when i send ip address print
@Aurelien.IGT.237
@Aurelien.IGT.237 Жыл бұрын
nice video i really appreciate it but I’m receiving an reply “expected command name (line 13 column 119”) is the as-value how do i fix it please help me
@mikrotik
@mikrotik Жыл бұрын
Make sure you are using the latest routerOS v7 release
@Aurelien.IGT.237
@Aurelien.IGT.237 Жыл бұрын
@@mikrotik ok thanks i will try it
@Aurelien.IGT.237
@Aurelien.IGT.237 Жыл бұрын
@@mikrotik i try it now and the scrip going on so I received the telegram script initiated but all the command I typing in my bot Telegram don’t something in my router
@ashwin.gorityala
@ashwin.gorityala 2 жыл бұрын
I’m receiving an reply “expected command name (line 1 column 1” how do i fix it
@anhang4704
@anhang4704 Жыл бұрын
Hi, how to dhcp lease authorization using telegram? thanks.
@squid11160
@squid11160 2 жыл бұрын
My mechanic said something about my chakras being out of alignment...or maybe it was wheels
@Aurelien.IGT.237
@Aurelien.IGT.237 2 ай бұрын
hi please how to fixe a error failure: authentication failure
@mikrotik
@mikrotik 2 ай бұрын
Replace the ssh-exec command with the newer 'execute' command. help.mikrotik.com/docs/spaces/ROS/pages/47579229/Scripting#Scripting-Commands
@muhamadzainimansur9624
@muhamadzainimansur9624 2 жыл бұрын
Mikrotik is very impressive
@filanodev
@filanodev 2 жыл бұрын
Nice
@amralmohammedi
@amralmohammedi 9 ай бұрын
thank you so much
@mikrotik
@mikrotik 9 ай бұрын
You're welcome!
@encryptedroute3313
@encryptedroute3313 2 жыл бұрын
Please make video on mikrotik automation with ansible
@moritz3388
@moritz3388 2 жыл бұрын
Is it end-to-end encrypted?
@RB01-lite
@RB01-lite 2 жыл бұрын
No, data is literally in the URL. Do not exchange sensitive information in this manner.
@nikolashuminosky6987
@nikolashuminosky6987 2 жыл бұрын
well done!
@remoteservice8222
@remoteservice8222 Жыл бұрын
Not working Mikrotik OS6?
@mikrotik
@mikrotik Жыл бұрын
It's written for RouterOS v7, but you could adapt it yourself!
@olegkn7769
@olegkn7769 11 ай бұрын
it's nice ideas
@BlackICE1973
@BlackICE1973 2 жыл бұрын
Now it would be very nice to have something like this with Signal
@FinlayDaG33k
@FinlayDaG33k 2 жыл бұрын
If it has a webhooks API of sorts, it's very likely to be possible. I have an (albeit more limited) version for Discord that uses the MikroTik APIs (instead of scripting it on the router-side).
@ЗаболотнийМаксим-в9ж
@ЗаболотнийМаксим-в9ж 2 жыл бұрын
its cool
@m1nusasusplus897
@m1nusasusplus897 2 жыл бұрын
Guys, you are awesome, I asked a few weeks ago on forum how to use it, but already setup curl by my own, now I can just receive messages about a few importants ping for me. But what I didn`t find - how to get more system information and add these info in curl (maybe cpu tem, cpu loading, memory used % etc. And one more thing - didn`t get how to execute curl when router was rebooted (I need it because of fucking russians we have problem with electricity periodically), would be great to get this info that router started or rebooted.
@vladimirplaksin8724
@vladimirplaksin8724 Жыл бұрын
Гондон ты поношенный, а скажи пожалуйста: с какой целью ты, плюс/минус/отсос махровый пидорас, вплетаешь политику и националистические нотки в инженерный канал?
@bentoo93
@bentoo93 11 ай бұрын
If you failed in "failure: closing connection: 0.0.0.0:22 (6)" create user admin with blank password and edit source :local fun ([:system ssh-exec 0.0.0.0 user=admin $command as-value]->"output");
@pablopinet6476
@pablopinet6476 2 жыл бұрын
Que locura !!
@sijokun
@sijokun 2 жыл бұрын
You forgot to blur chat Id on 9:36, now we know that your account was created approximately in August :)
@daviesthecoach
@daviesthecoach 2 жыл бұрын
Thanks for this. here is the error I keep getting: status: failed failure: closing connection: ip;address:443
@Fatality2k6
@Fatality2k6 Жыл бұрын
I have the same issue and i don't know how to fix it
@saulotarsobc
@saulotarsobc Жыл бұрын
🥰
@hdb4491
@hdb4491 2 жыл бұрын
Looking forward to the Proxmox Video , same topology from this great video : kzbin.info/www/bejne/qqrNhmSsqqebo7M
@raldyadorable1875
@raldyadorable1875 2 жыл бұрын
up
@nicramtimzs6245
@nicramtimzs6245 2 жыл бұрын
nice gimmick
@hdb4491
@hdb4491 2 жыл бұрын
I have problem : proxmox single nic mikrotik , same topology from this great video : kzbin.info/www/bejne/qqrNhmSsqqebo7M thanks
@gaborgabor1338
@gaborgabor1338 Жыл бұрын
Hi! RSA key gen not working: [admin@oRouter] /user ssh-keys> private import private-key-file=admin_rsa user=admin public-key-file: Script Error: action cancelled [admin@oRouter] /user ssh-keys> why?
@gaborgabor1338
@gaborgabor1338 Жыл бұрын
solved...
@MTL543
@MTL543 Жыл бұрын
unfortunately it give error while I run the telegram src chat code failure: closing connection: 149.154.167.200:443 (4)
@Daniel-ki6wg
@Daniel-ki6wg Жыл бұрын
status: failed failure: closing connection: 139.147.169.50:443 (4)
@danielmelo707
@danielmelo707 Жыл бұрын
status: failed failure: closing connection: 149.154.167.220:443 (4)
Using MikroTik CHR in Hyper-V
2:21
MikroTik
Рет қаралды 10 М.
Telegram и Mikrotik. Возможности интеграции
1:14:36
Mikrotik Training
Рет қаралды 14 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
Multiple uplinks using PCC, Load balancing
16:22
MikroTik
Рет қаралды 94 М.
Port knocking with MikroTik
11:36
MikroTik
Рет қаралды 18 М.
Ultimate Guide: How to use Cloudflare DDNS on MikroTik
21:34
MikroTik Masters
Рет қаралды 372
MikroTips: How to firewall
21:56
MikroTik
Рет қаралды 159 М.
Уведомления в telegram с вашего роутера mikrotik | UnixHost
7:16
Self-hosted Guide [by UnixHost]
Рет қаралды 10 М.
How To Create A Telegram Bot With Python
20:23
CS Dojo
Рет қаралды 642 М.
RouterOS CLI features everyone should know
4:41
MikroTik
Рет қаралды 12 М.
DID YOU NOTICE ANY LAPSES IN THE VIDEO or NOT? / MARGO_FLURY
0:34
MARGO FLURY | Маргарита Дьяченкова
Рет қаралды 12 МЛН
Лайфхак: Легально делать деньги
0:43
Абзал неге келді? 4.10.22
3:53
QosLike fan club
Рет қаралды 31 М.
This thing is CRAZY 🤯 #shorts
0:20
House of Highlights
Рет қаралды 48 МЛН