Run a perl script on Linux from HA BUT they are on different vlans

First of all I should tell you that I know very little about Linux - I have an old windows pc that was converted to Linux and I wrote a perl script that I would like to execute from HA. HA is on a different vlan than this linux box.
Normally on a windows pc (that resides on a different vlan) I would use the Hass.Agent to run scripts. Is there an equivalent on linux to accomplish the same task?
If not, I have other windows pcs on the same vlan as the linux box which I could use Hass.Agent to start the task. My problem with this senario is that I don’t know how to have a windows pc start a perl script on a linux box. I did some google searches but haven’t found how to do this yet.

One possibility would be to get HA to use a shell command to run a shell script, and this script would in turn invoke ssh (Here is a setup guide) to your remote linux machine to run your perl script.

The first thing I would do is try to get ssh setup and running between HA and your remote machine to get your pearl script running, and then try setting up the HA shell command.

Thank you - greatly appreciated!

I have configured ssh. I can now from terminal perform ssh [email protected]. This logs me into the Linux machine. I can then execute my script.sh from this terminal window.

What I can’t figure out is the syntax for the shell command in configuration.yaml.

This is what I tried to test.

shell_command:
test_ssh: “ssh [email protected] touch test.log”

I just wanted to see if this would create a session and then create a file on the remote linux machine. With no success.

I do have other shell_commands set up on the HA system that perform tasks on the HA machine that work fine.

I don’t have a shell_command to do ssh, but I do have a sensor that makes a ssh call to get a remote machine’s temperature and the ssh call looks like:

"ssh -i /config/.ssh/id_rsa -o UserKnownHostsFile=/config/.ssh/known_hosts -o ConnectTimeout=9 [email protected] 'cat /sys/class/thermal/thermal_zone1/temp'"