Created new notification in Dude (6.42.7), set it’s type to “execute on server” and I’m trying to use ssh to connect to linux box and run a command.
In notification command window I have command:
/system ssh address=a.b.c.d user=xxx command=“/bin/command/here”
I’ve set up ssh keys; when connecting to Dude with winbox and running same command from terminal, it works perfectly.
Clicking ‘Test’ in notification window yields nothing. If I start remote host’s ssh in debugging mode, I see that there’s no incoming
connection (when clicking ‘Test’). ‘/tool fetch’ in command window works.
We solved this by run script on ROS from Dude, and script can then SSH to the remote server and execute required commands. We also can pass variables from Dude to the script.
Dude
# Define Subject
:global notificationtext "Service [Probe.Name] on [Device.Name] is now [Service.Status]"
# Run script
system script run sms
ROS script
# Define subject
:global notificationtext "$notificationtext"
# Define IP of ROS with SMS access
:local rossms "192.168.64.4"
# Firstname Lastname
:local phonenumber "+xxxxxxxxxxx"
# Send SMS
system ssh-exec address="rossms" user=sms-sender command="/tool sms send usb1 \"$phonenumber\" message=\"$notificationtext\""