Script communication between multiple routers?

is there a way to call a script on one router to execute a script on another router?

thanks in advance,

This command executes the script ‘yourscript’ on router 192.168.1.2. The script is saved on the same router that it is executed on.
system ssh 192.168.1.2 user=admin “/system script run yourscript”

excellent, my road here is “ssh”.

Thank you & Please accept my Karma :smiley:

without having a linux box, how to create a passkey so it won’t ask for password?

this is script communications between mikrotik to mikrotik only.

thanks in advance..

This can be achieved with importing ssh public key on your mikrotik device.
http://wiki.mikrotik.com/wiki/Use_SSH_to_execute_commands_(DSA_key_login)

the wiki provided involve linux box. is there any way to use just mikrotik routers?

i was able to create a user on remote mikrotik device without password and log-in using terminal
/system
ssh 192.168.1.1 user=myuser

but when using the same user in a script won’t work
/system ssh 192.168.1.1 user=myuser “:log info hello”

I followed the guide and still not a good result:

on ubuntu:

ssh-keygen -t dsa
Enter file in which to save the key:
“key”
no password

both file key & key.pub was copied to both routers (routerA and routerB)
on routerA
create user sshadmin (no password)
import ssh key
user = sshadmin
key file = key.pub

on routerB
create user sshadmin (no password)
import ssh private key
user = sshadmin
public key file = key.pub
private key file = key
passphrase = (blank)

on routerB create new script
/system ssh 192.168.1.1 user=sshadmin “:log info hello”

what’s my mistake here?

thanks,

You can also try an xxxx.auto.rsc file:
“Since RouterOS v3rc it is possible to automatically execute scripts - your script file has to be called anything.auto.rsc - once this file is uploaded with FTP to the router, it will automatically be executed, just like with the Import command.”
Source: http://wiki.mikrotik.com/wiki/Manual:Configuration_Management

To upload file you can use /tool fetch command, example:

[admin@mt-test] /tool> fetch address=192.168.88.2 src-path=conf.rsc user=admin mode=ftp password=123 dst-path=123.auto.rsc upload=yes

Source: http://wiki.mikrotik.com/wiki/Manual:Tools/Fetch

But, be aware of some bugs: http://forum.mikrotik.com/t/fetch-upload-auto-rsc-between-routers-not-executing/56819/1