I need to execute a script on a remote linux machine when a netwatch event is detected
Something like :
on up ,
/system ssh user=myuser password=mypassword command= /home/myuser/myscript.sh
It seems automated ssh login via script doesn’t work
First of all , is it possible to run ssh CLIENT commands from inside a routeros script ?
If yes, assuming it is not possible to automate the ssh username/password mechanism, can routeros perform a passwordless client session to a remote linux machine using RSA key
As a workaround, you can use a different mechanism to send events to the remote Linux machine.
E.g. you can configure it as a remote syslog server (can be for a limited class of events, like “script,warning”)
and then you can use /log warning message=“text” to send a syslog message to the Linux machine, which you can
then handle in its syslog daemon (depending on which one you run).