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.
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
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?
@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
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
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
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....." 😕
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.
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
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.
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!!!!!
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
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 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.
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.
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.
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 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
@@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.
@@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
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
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");
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.
Гондон ты поношенный, а скажи пожалуйста: с какой целью ты, плюс/минус/отсос махровый пидорас, вплетаешь политику и националистические нотки в инженерный канал?
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).
I have problem : proxmox single nic mikrotik , same topology from this great video : ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-tyjU1vuBhmQ.html thanks